lkml.org 
[lkml]   [2018]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] f2fs: fix to cover f2fs_inline_data_fiemap with inode_lock
Date
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>
---
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
\
 
 \ /
  Last update: 2018-01-14 23:22    [W:0.021 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site