projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cecfa5
)
f2fs: check new size by inode_newsize_ok in f2fs_insert_range
author
Kinglong Mee
<kinglongmee@gmail.com>
Fri, 10 Mar 2017 09:54:52 +0000
(17:54 +0800)
committer
Jaegeuk Kim
<jaegeuk@kernel.org>
Wed, 22 Mar 2017 02:34:29 +0000
(22:34 -0400)
The inode_newsize_ok is better than only checking the maxbytes,
eg. the rlimit etc.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/f2fs/file.c
b/fs/f2fs/file.c
index cbde4d23e817fb725a38763924f2c9f4f00ce244..bc853dd9b7a3a9d876f7f3e04b35dadd032fef08 100644
(file)
--- a/
fs/f2fs/file.c
+++ b/
fs/f2fs/file.c
@@
-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;