提交 fe369bc8 编写于 作者: J Jaegeuk Kim

f2fs: return i_size if the hole is outside of i_size

When SEEK_HOLE is requeted, it should return i_size if the hole position is
found outside of i_size.
Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
上级 267378d4
...@@ -255,9 +255,9 @@ static loff_t f2fs_seek_block(struct file *file, loff_t offset, int whence) ...@@ -255,9 +255,9 @@ static loff_t f2fs_seek_block(struct file *file, loff_t offset, int whence)
if (whence == SEEK_DATA) if (whence == SEEK_DATA)
goto fail; goto fail;
else
data_ofs = isize;
found: found:
if (whence == SEEK_HOLE && data_ofs > isize)
data_ofs = isize;
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
return vfs_setpos(file, data_ofs, maxbytes); return vfs_setpos(file, data_ofs, maxbytes);
fail: fail:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册