diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2007-07-20 15:02:14 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2007-08-09 20:25:38 -0400 |
commit | ce76fd30ce98cdaeb38dca0dfbb3fa6d2801c5ce (patch) | |
tree | b204814a30df3e5ef5f21032ee8fb3639249b99a | |
parent | 7c08d70c69150148c14f02633855f1591219c37c (diff) |
ocfs2: check ia_size limits in setattr
We have to manually check the requested truncate size as the check in
vmtruncate() comes too late for Ocfs2.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
-rw-r--r-- | fs/ocfs2/file.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index b1ae4c754157..4ffa715be09c 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1028,6 +1028,11 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) | |||
1028 | } | 1028 | } |
1029 | 1029 | ||
1030 | if (size_change && attr->ia_size != i_size_read(inode)) { | 1030 | if (size_change && attr->ia_size != i_size_read(inode)) { |
1031 | if (attr->ia_size > sb->s_maxbytes) { | ||
1032 | status = -EFBIG; | ||
1033 | goto bail_unlock; | ||
1034 | } | ||
1035 | |||
1031 | if (i_size_read(inode) > attr->ia_size) | 1036 | if (i_size_read(inode) > attr->ia_size) |
1032 | status = ocfs2_truncate_file(inode, bh, attr->ia_size); | 1037 | status = ocfs2_truncate_file(inode, bh, attr->ia_size); |
1033 | else | 1038 | else |