Commit fe369bc8 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

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: default avatarJaegeuk Kim <>
parent 267378d4
......@@ -255,9 +255,9 @@ static loff_t f2fs_seek_block(struct file *file, loff_t offset, int whence)
if (whence == SEEK_DATA)
goto fail;
data_ofs = isize;
if (whence == SEEK_HOLE && data_ofs > isize)
data_ofs = isize;
return vfs_setpos(file, data_ofs, maxbytes);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment