diff options
author | Hugh Dickins <hugh@veritas.com> | 2004-10-18 08:54:48 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-18 08:54:48 -0700 |
commit | c76aaef04194fdaad83dc6c27eb5edce77d4a7f9 (patch) | |
tree | 6ae5722ba4efa497007b4e827a5a9af67238f25c /mm | |
parent | fef60c1b89ca4518a1b424854a3758a658bbe748 (diff) | |
download | history-c76aaef04194fdaad83dc6c27eb5edce77d4a7f9.tar.gz |
[PATCH] __set_page_dirty_nobuffers mappings
Marcelo noticed that the BUG_ON in __set_page_dirty_nobuffers doesn't make
much sense: it lost its way in 2.6.7, amidst so many page_mappings!
It's supposed to be checking that, although page->mapping may suddenly go NULL
from truncation, and although tmpfs swizzles page_mapping(page) between tmpfs
inode address_space and swapper_space, there's sufficient stabilization while
here in __set_page_dirty_nobuffers that the mapping after we locked
mapping->tree_lock is the same as the mapping before we locked
mapping->tree_lock i.e. the lock we hold is the right one.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page-writeback.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 343998d46bb033..a3f185e9fc2f18 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -580,12 +580,13 @@ int __set_page_dirty_nobuffers(struct page *page) if (!TestSetPageDirty(page)) { struct address_space *mapping = page_mapping(page); + struct address_space *mapping2; if (mapping) { spin_lock_irq(&mapping->tree_lock); - mapping = page_mapping(page); - if (page_mapping(page)) { /* Race with truncate? */ - BUG_ON(page_mapping(page) != mapping); + mapping2 = page_mapping(page); + if (mapping2) { /* Race with truncate? */ + BUG_ON(mapping2 != mapping); if (!mapping->backing_dev_info->memory_backed) inc_page_state(nr_dirty); radix_tree_tag_set(&mapping->page_tree, |