[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] shmem fixes against 2.4.3-ac2
Hi,
The following patch fixes two bugs in the shm code in 2.4.3-ac2 (and ac3,
too):
- shmem_writepage() does not set the page dirty bit on a page in case it
does not get moved to the swapcache because it has pte's mapped to it.
- in case of a SIGBUS for a page fault on an shmem page, the inode lock
will remain locked forever.
--- mm/shmem.c.orig Wed Apr 4 06:44:45 2001
+++ mm/shmem.c Thu Apr 5 04:39:03 2001
@@ -236,8 +236,10 @@
/* Only move to the swap cache if there are no other users of
* the page. */
- if (atomic_read(&page->count) > 2)
+ if (atomic_read(&page->count) > 2) {
+ set_page_dirty(page);
goto out;
+ }
inode = page->mapping->host;
info = &inode->u.shmem_i;
@@ -432,6 +434,7 @@
*ptr = NOPAGE_SIGBUS;
return error;
sigbus:
+ up (&inode->i_sem);
*ptr = NOPAGE_SIGBUS;
return -EFAULT;
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/