From: Ryusuke Konishi Date: Mon, 2 Nov 2009 15:25:53 +0000 (+0900) Subject: nilfs2: fix dirty page accounting leak causing hang at write X-Git-Tag: v2.6.31.6~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61ac9e400eb6c0c3d3e9da24c78176fbe272fc1b;p=thirdparty%2Fkernel%2Fstable.git nilfs2: fix dirty page accounting leak causing hang at write commit b1e19e5601277845b4f17ecd7c9ba04f73ee11aa upstream. 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 Reported-by: Dunphy, Bill Signed-off-by: Ryusuke Konishi Tested-by: Bruno Prémont Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index 5be2c8b6549a9..862ad299aad0b 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c @@ -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);