Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de1475cc authored by Fan Li's avatar Fan Li Committed by Jaegeuk Kim
Browse files

f2fs: read isize while holding i_mutex in fiemap



make sure the isize we read doesn't change during the process.

Signed-off-by: default avatarFan li <fanofcode.li@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 957efb0c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -784,7 +784,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;
@@ -800,6 +800,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;