]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix handling orphan inodes
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 30 Jul 2013 02:36:53 +0000 (11:36 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 30 Jul 2013 06:17:03 +0000 (15:17 +0900)
commita9526c74127b622e0fa3ec0bb73dbd23c79f4173
tree44962739f9ce15214fc5f0587b2174aae1f032f5
parentc51841a4ab0284d76fd6408ade916de167e8e53c
f2fs: fix handling orphan inodes

This patch fixes mishandling of the sbi->n_orphans variable.

If users request lots of f2fs_unlink(), check_orphan_space() could be contended.
In such the case, sbi->n_orphans can be read incorrectly so that f2fs_unlink()
would fall into the wrong state which results in the failure of
add_orphan_inode().

So, let's increment sbi->n_orphans virtually prior to the actual orphan inode
stuffs. After that, let's release sbi->n_orphans by calling release_orphan_inode
or remove_orphan_inode.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/checkpoint.c
fs/f2fs/dir.c
fs/f2fs/f2fs.h
fs/f2fs/namei.c