mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
f2fs: read isize while holding i_mutex in fiemap
make sure the isize we read doesn't change during the process. Signed-off-by: Fan li <fanofcode.li@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
83ef8a9fcd
commit
3cb1aba93a
1 changed files with 3 additions and 1 deletions
|
@ -785,7 +785,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
|
|||
{
|
||||
struct buffer_head map_bh;
|
||||
sector_t start_blk, last_blk;
|
||||
loff_t isize = i_size_read(inode);
|
||||
loff_t isize;
|
||||
u64 logical = 0, phys = 0, size = 0;
|
||||
u32 flags = 0;
|
||||
int ret = 0;
|
||||
|
@ -801,6 +801,8 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
|
|||
}
|
||||
|
||||
mutex_lock(&inode->i_mutex);
|
||||
|
||||
isize = i_size_read(inode);
|
||||
if (start >= isize)
|
||||
goto out;
|
||||
|
||||
|
|
Loading…
Reference in a new issue