- reiser4-reget-page-mapping.patch removed from -mm tree

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

 



The patch titled

     reiser4: vfs: re-check page->mapping after calling try_to_release_page()

has been removed from the -mm tree.  Its filename is

     reiser4-reget-page-mapping.patch

This patch was dropped because it is obsolete

------------------------------------------------------
Subject: reiser4: vfs: re-check page->mapping after calling try_to_release_page()
From: Hans Reiser <reiser@xxxxxxxxxxx>


reiser4 keeps its meta-data pages in the page cache, attached to a special
"fake" inode.  Meta-data blocks have "znodes" attached to them (reiser4 analog
of buffer_head) and initially don't have real disk block numbers assigned. 
Later meta-data blocks can be "relocated" to decrease fragmentation.  As a
result, their pages cannot be easily indexed by block number.  Instead reiser4
indexes pages of fake inode by some function of znode address.  This looks
weird, but it works.  The only problem is that there is a race involving
->releasepage(): there is a window when znode has already been freed by
reiser4_releasepage(), but its page still exists (albeit locked).  If at this
moment another znode is allocated at the same address as one just destroyed,
then some other thread can acquire a reference to lingering page (because it
is indexed by address of znode), and prevent shrink_list() from freeing it.

To avoid this, reiser4_releasepage() removes page from radix-tree manually. 
This requires re-checking page->mapping after calling try_to_release_page().

Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 mm/truncate.c |    7 +++++++
 mm/vmscan.c   |    5 +++++
 2 files changed, 12 insertions(+)

diff -puN mm/truncate.c~reiser4-reget-page-mapping mm/truncate.c
--- 25/mm/truncate.c~reiser4-reget-page-mapping	Thu Apr  6 16:02:30 2006
+++ 25-akpm/mm/truncate.c	Thu Apr  6 16:02:30 2006
@@ -67,6 +67,13 @@ invalidate_complete_page(struct address_
 	if (PagePrivate(page) && !try_to_release_page(page, 0))
 		return 0;
 
+	/*
+	 * file system may manually remove page from the page
+	 * cache in ->releasepage(). Check for this.
+	 */
+	if (page->mapping != mapping)
+		return 0;
+
 	write_lock_irq(&mapping->tree_lock);
 	if (PageDirty(page)) {
 		write_unlock_irq(&mapping->tree_lock);
diff -puN mm/vmscan.c~reiser4-reget-page-mapping mm/vmscan.c
--- 25/mm/vmscan.c~reiser4-reget-page-mapping	Thu Apr  6 16:02:30 2006
+++ 25-akpm/mm/vmscan.c	Thu Apr  6 16:02:30 2006
@@ -532,6 +532,11 @@ static unsigned long shrink_page_list(st
 		if (PagePrivate(page)) {
 			if (!try_to_release_page(page, sc->gfp_mask))
 				goto activate_locked;
+			/*
+			 * file system may manually remove page from the page
+			 * cache in ->releasepage(). Check for this.
+			 */
+			mapping = page_mapping(page);
 			if (!mapping && page_count(page) == 1)
 				goto free_it;
 		}
_

Patches currently in -mm which might be from reiser@xxxxxxxxxxx are

add-address_space_operationsbatch_write.patch
pass-io-size-to-batch_write-address-space-operation.patch
reiser4-export-handle_ra_miss.patch
reiser4-sb_sync_inodes.patch
reiser4-export-remove_from_page_cache.patch
reiser4-export-radix_tree_preload.patch
reiser4.patch
reiser4-reiser4_drop_page-dont-call-remove_from_page_cache.patch
reiser4-fix-trivial-tyops-which-were-hard-to-hit.patch
reiser4-run-truncate_inode_pages-in-reiser4_delete_inode.patch
reiser4-bug-fixes.patch
reiser4-write-via-do_sync_write.patch
fs-reiser4-possible-cleanups.patch
reiser4-rename-generic_sounding_globalspatch.patch
reiser4-rename-generic_sounding_globalspatch-fix.patch
reiser4-get-rid-of-semaphores-wherever-it-is-possible.patch
reiser4-decribe-new-atom-locking-and-nested-atom-locks-to-lock-validator.patch
reiser4-use-generic-file-read.patch
reiser4-simplify-reading-of-partially-converted-files.patch
reiser4-use-page_offset.patch
reiser4-use-reiser4_gfp_mask_get-in-reiser4-inode-allocation.patch
reiser4-re-add-page_count-check-to-reiser4_releasepage.patch
reiser4-restore-fibmap-ioctl-support-for-packed-files.patch
reiser4-possible-cleanups-2.patch

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

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux