Re: [PATCH] Re: innd mmap bug in 2.4.0-test12

From: Daniel Phillips (phillips@innominate.de)
Date: Thu Dec 28 2000 - 14:17:10 EST


Linus Torvalds wrote:
> No, I'd much rather have
>
> if (PageDirty(page)) BUG();
>
> there, and then have the free_swap_cache code clear the dirty bit.
>
> We don't want to lose dirty bits by mistake. The only cases where it's ok
> to clear the dirty bit is when we truncate a page completely (so it won't
> be needed and obviously really shouldn't be written out) and when we've
> lost the last user of a swap cache entry.
>
> Any other cases might be bugs, where we remove a page from a mapping
> without noticing that it is dirty (we had this bug in reclaim_pages(), for
> example).

And in this case it's clear we lose data with nfs and smbfs that way.
Maybe this is more like it:

--- 2.4.0-test13.clean/mm/filemap.c Fri Dec 29 03:14:58 2000
+++ 2.4.0-test13/mm/filemap.c Fri Dec 29 04:13:27 2000
@@ -132,7 +132,7 @@
                 curr = curr->next;
 
                 /* We cannot invalidate a locked page */
- if (TryLockPage(page))
+ if (PageDirty(page) || TryLockPage(page))
                         continue;
 
                 /* Neither can we invalidate something in use.. */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Dec 31 2000 - 21:00:11 EST