[patch 2/8] mm: write_cache_pages AOP_WRITEPAGE_ACTIVATE fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In write_cache_pages, if AOP_WRITEPAGE_ACTIVATE is returned, the filesystem is
calling on us to drop the page lock and retry, however the existing code would
just skip that page regardless of whether or not it was a data interity
operation. Change this to always retry such a result.

This is a data interity bug.

Signed-off-by: Nick Piggin <npiggin@xxxxxxx>
---
Index: linux-2.6/mm/page-writeback.c
===================================================================
--- linux-2.6.orig/mm/page-writeback.c
+++ linux-2.6/mm/page-writeback.c
@@ -916,6 +916,7 @@ retry:
 			 * swizzled back from swapper_space to tmpfs file
 			 * mapping
 			 */
+again:
 			lock_page(page);
 
 			if (unlikely(page->mapping != mapping)) {
@@ -940,10 +941,11 @@ retry:
 			}
 
 			ret = (*writepage)(page, wbc, data);
-
 			if (unlikely(ret == AOP_WRITEPAGE_ACTIVATE)) {
+				/* Must retry the write */
 				unlock_page(page);
 				ret = 0;
+				goto again;
 			}
 			if (ret || (--(wbc->nr_to_write) <= 0))
 				done = 1;

-- 

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux