Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: fix to cover f2fs_inline_data_fiemap with inode_lock

This patch fix to cover f2fs_inline_data_fiemap with inode_lock in order
to make that interface avoiding race with mapping change.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
f1b43d4c 7dff55d2

+3 -3
+3 -3
fs/f2fs/data.c
··· 1154 1154 if (ret) 1155 1155 return ret; 1156 1156 1157 + inode_lock(inode); 1158 + 1157 1159 if (f2fs_has_inline_data(inode)) { 1158 1160 ret = f2fs_inline_data_fiemap(inode, fieinfo, start, len); 1159 1161 if (ret != -EAGAIN) 1160 - return ret; 1162 + goto out; 1161 1163 } 1162 - 1163 - inode_lock(inode); 1164 1164 1165 1165 if (logical_to_blk(inode, len) == 0) 1166 1166 len = blk_to_logical(inode, 1);