[parisc-linux] unreliable mmap

Jochen Friedrich jochen@scram.de
Sun, 3 Nov 2002 12:33:56 +0100 (CET)


Hi Randolph,

> no one has managed to really track this down yet. i can insert a dcache
> flush into the kernel to 'fix' this, but it is not the right place to be
> doing the flush.

I can confirm this. The following patch "fixes" the problem for me. Please
do NOT apply this dirty hack to CVS!

cvs server: Diffing .
Index: filemap.c
===================================================================
RCS file: /var/cvs/linux/mm/filemap.c,v
retrieving revision 1.27
diff -u -r1.27 filemap.c
--- filemap.c   4 Aug 2002 23:00:15 -0000       1.27
+++ filemap.c   3 Nov 2002 11:37:52 -0000
@@ -3075,6 +3075,7 @@
                        goto sync_failure;
                page_fault = __copy_from_user(kaddr+offset, buf, bytes);
                flush_dcache_page(page);
+               flush_cache_all();
                status = mapping->a_ops->commit_write(file, page, offset,
offset+bytes);
                if (page_fault)
                        goto fail_write;


--jochen