nilfs2: fix dirty page accounting leak causing hang at write
authorRyusuke Konishi <[email protected]>
Mon, 2 Nov 2009 15:25:53 +0000 (00:25 +0900)
committerRyusuke Konishi <[email protected]>
Tue, 3 Nov 2009 03:31:36 +0000 (12:31 +0900)
Bruno Prémont and Dunphy, Bill noticed me that NILFS will certainly
hang on ARM-based targets.

I found this was caused by an underflow of dirty pages counter.  A
b-tree cache routine was marking page dirty without adjusting page
account information.

This fixes the dirty page accounting leak and resolves the hang on
arm-based targets.

Reported-by: Bruno Prémont <[email protected]>
Reported-by: Dunphy, Bill <[email protected]>
Signed-off-by: Ryusuke Konishi <[email protected]>
Tested-by: Bruno Prémont <[email protected]>
Cc: stable <[email protected]>
fs/nilfs2/btnode.c

index 5941958f1e47325e9497cef3101065f3efd73f46..435864ce06be5ca076bf06fce5165e9b6b8dbc51 100644 (file)
@@ -276,8 +276,7 @@ void nilfs_btnode_commit_change_key(struct address_space *btnc,
                                       "invalid oldkey %lld (newkey=%lld)",
                                       (unsigned long long)oldkey,
                                       (unsigned long long)newkey);
-               if (!test_set_buffer_dirty(obh) && TestSetPageDirty(opage))
-                       BUG();
+               nilfs_btnode_mark_dirty(obh);
 
                spin_lock_irq(&btnc->tree_lock);
                radix_tree_delete(&btnc->page_tree, oldkey);