]> git.karo-electronics.de Git - karo-tx-linux.git/commit
nilfs2: fix missing zero-fill initialization of btree node cache
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 27 Sep 2009 16:46:11 +0000 (01:46 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:31:50 +0000 (09:31 -0700)
commit3a9b96ab8d6cb30f27db8a7e24770c1654d4e14e
treef1f8f659c9a3a3055633b195896bd49eb61e1b3f
parentb634e7f6b89c3a6fa3af4a709164b19d64bf9413
nilfs2: fix missing zero-fill initialization of btree node cache

commit 1f28fcd925b2b3157411bbd08f0024b55b70d8dd upstream.

This will fix file system corruption which infrequently happens after
mount.  The problem was reported from users with the title "[NILFS
users] Fail to mount NILFS." (Message-ID:
<200908211918.34720.yuri@itinteg.net>), and so forth.  I've also
experienced the corruption multiple times on kernel 2.6.30 and 2.6.31.

The problem turned out to be caused due to discordance between
mapping->nrpages of a btree node cache and the actual number of pages
hung on the cache; if the mapping->nrpages becomes zero even as it has
pages, truncate_inode_pages() returns without doing anything.  Usually
this is harmless except it may cause page leak, but garbage collection
fairly infrequently sees a stale page remained in the btree node cache
of DAT (i.e. disk address translation file of nilfs), and induces the
corruption.

I identified a missing initialization in btree node caches was the
root cause.  This corrects the bug.

I've tested this for kernel 2.6.30 and 2.6.31.

Reported-by: Yuri Chislov <yuri@itinteg.net>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nilfs2/btnode.c