summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-01-11 07:37:35 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2018-01-19 07:09:10 +0100
commitf1b43d4cd5f2563f0f1bb2c84eff94faa4c2853b (patch)
tree91dac37dde7be56bf8419390db29426b19c00756 /fs/f2fs/data.c
parentf2fs: check node page again in write end io (diff)
downloadlinux-f1b43d4cd5f2563f0f1bb2c84eff94faa4c2853b.tar.xz
linux-f1b43d4cd5f2563f0f1bb2c84eff94faa4c2853b.zip
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>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 31add841ec39..664fe0aa18bb 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1154,14 +1154,14 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
if (ret)
return ret;
+ inode_lock(inode);
+
if (f2fs_has_inline_data(inode)) {
ret = f2fs_inline_data_fiemap(inode, fieinfo, start, len);
if (ret != -EAGAIN)
- return ret;
+ goto out;
}
- inode_lock(inode);
-
if (logical_to_blk(inode, len) == 0)
len = blk_to_logical(inode, 1);