f2fs: avoid f2fs_lock_op for IPU writes
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 12 May 2017 20:51:34 +0000 (13:51 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 24 May 2017 04:07:15 +0000 (21:07 -0700)
commitcc15620bc826b14006956fd321e026ae96aff53a
tree1bb4cbe573d4eadbee4fb62ae9514b0499570a29
parenta912b54d3aaa011266dc266e3694f782f27233cf
f2fs: avoid f2fs_lock_op for IPU writes

Currently, if we do get_node_of_data before f2fs_lock_op, there may be dead lock
as follows, where process A would be in infinite loop, and B will NOT be awaked.

Process A(cp):            Process B:
f2fs_lock_all(sbi)
                        get_dnode_of_data <---- lock dn.node_page
flush_nodes             f2fs_lock_op

So, this patch adds f2fs_trylock_op to avoid f2fs_lock_op done by IPU.

Signed-off-by: Hou Pengyang <houpengyang@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/gc.c
fs/f2fs/segment.c