[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20180111063735.37395-1-yuchao0@huawei.com>
Date: Thu, 11 Jan 2018 14:37:35 +0800
From: Chao Yu <yuchao0@...wei.com>
To: <jaegeuk@...nel.org>
CC: <linux-f2fs-devel@...ts.sourceforge.net>,
<linux-kernel@...r.kernel.org>, <chao@...nel.org>,
Chao Yu <yuchao0@...wei.com>
Subject: [PATCH v2] 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@...wei.com>
---
v2:
- change to just cover inode lock for f2fs_inline_data_fiemap
fs/f2fs/data.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index d6302051a65d..12155ee90468 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1150,14 +1150,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);
--
2.15.0.55.gc2ece9dc4de6
Powered by blists - more mailing lists