f2fs: fix unlocked nat set cache operation
authorWanpeng Li <wanpeng.li@linux.intel.com>
Mon, 9 Mar 2015 03:00:55 +0000 (11:00 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 10 Apr 2015 22:08:39 +0000 (15:08 -0700)
commit57ed1e95babbd2df33f70eb820c7a9984199557b
tree3d277b6e2f932be5bca5ab8735b7ae60ebf28e13
parente0150392ddfaaf5ccf338893f6db177a2c64a7ee
f2fs: fix unlocked nat set cache operation

nm_i->nat_tree_lock is used to sync both the operations of nat entry
cache tree and nat set cache tree, however, it isn't held when flush
nat entries during checkpoint which lead to potential race, this patch
fix it by holding the lock when gang lookup nat set cache and delete
item from nat set cache.

Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c