Commit 46e82fb1 authored by Kinglong Mee's avatar Kinglong Mee Committed by Jaegeuk Kim

f2fs: check new size by inode_newsize_ok in f2fs_insert_range

The inode_newsize_ok is better than only checking the maxbytes,
eg. the rlimit etc.
Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 3cecfa5f
......@@ -1264,8 +1264,9 @@ static int f2fs_insert_range(struct inode *inode, loff_t offset, loff_t len)
int ret = 0;
new_size = i_size_read(inode) + len;
if (new_size > inode->i_sb->s_maxbytes)
return -EFBIG;
ret = inode_newsize_ok(inode, new_size);
if (ret)
return ret;
if (offset >= i_size_read(inode))
return -EINVAL;
......
Markdown is supported
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