Re: WARNING: "test_clear_page_dirty" [fs/cifs/cifs.ko] undefined!

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

 




On Sat, 23 Dec 2006, Randy Dunlap wrote:
> 
> BTW, reiserfs has similar build problems:  it uses clear_page_dirty()
> so it won't build.

Not any more. I fixed that one (very different issue, btw: it's not 
actually doign writeout, it actually wanted to cancel IO on truncated 
buffers.

However, it's certainly possible that my fix hasn't mirrored out yet, I 
pushed it just a couple of hours ago. So if you want to test it, here are 
the two commits in question..

(The "cancel_dirty_page()" cleanup is needed not just to do reiserfs as a 
module, it's also to make it more robust against reiserfs possibly feeding 
that function with strange pages, and to match the other related functions 
in the accounting functions).

Len Brown tested the reiserfs changes, and claims that it was all good, 
but if somebody wants to run fsx-linux or some other filesystem stress 
testing tool that actually tests shared mmap (and truncate), that would be 
really appreciated.

		Linus

--
commit 8368e328dfe1c534957051333a87b3210a12743b
Author: Linus Torvalds <[email protected]>
Date:   Sat Dec 23 09:25:04 2006 -0800

    Clean up and export cancel_dirty_page() to modules
    
    Make cancel_dirty_page() act more like all the other dirty and writeback
    accounting functions: test for "mapping" being NULL, and do the
    NR_FILE_DIRY accounting purely based on mapping_cap_account_dirty()).
    
    Also, add it to the exports, so that modular filesystems can use it.
    
    Acked-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
---
 mm/truncate.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/mm/truncate.c b/mm/truncate.c
index 4a38dd1..ecdfdcc 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -60,12 +60,16 @@ void cancel_dirty_page(struct page *page, unsigned int account_size)
 		WARN_ON(++warncount < 5);
 	}
 		
-	if (TestClearPageDirty(page) && account_size &&
-			mapping_cap_account_dirty(page->mapping)) {
-		dec_zone_page_state(page, NR_FILE_DIRTY);
-		task_io_account_cancelled_write(account_size);
+	if (TestClearPageDirty(page)) {
+		struct address_space *mapping = page->mapping;
+		if (mapping && mapping_cap_account_dirty(mapping)) {
+			dec_zone_page_state(page, NR_FILE_DIRTY);
+			if (account_size)
+				task_io_account_cancelled_write(account_size);
+		}
 	}
 }
+EXPORT_SYMBOL(cancel_dirty_page);
 
 /*
  * If truncate cannot remove the fs-private metadata from the page, the page

commit ffaa82008f1aad52a6d3979f49d2a76c2928b60f
Author: Linus Torvalds <[email protected]>
Date:   Sat Dec 23 09:32:45 2006 -0800

    Fix reiserfs after "test_clear_page_dirty()" removal
    
    Thanks to Len Brown for testing this fix, since while they have in the
    past, none of my machines run reiserfs at the moment.
    
    Cc: Vladimir V. Saveliev <[email protected]>
    Acked-by: Len Brown <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
---
 fs/reiserfs/stree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index 47e7027..afb21ea 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -1459,7 +1459,7 @@ static void unmap_buffers(struct page *page, loff_t pos)
 				bh = next;
 			} while (bh != head);
 			if (PAGE_SIZE == bh->b_size) {
-				clear_page_dirty(page);
+				cancel_dirty_page(page, PAGE_CACHE_SIZE);
 			}
 		}
 	}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux