Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce76fd30ce98cdaeb38dca0dfbb3fa6d2801c5ce Commit: ce76fd30ce98cdaeb38dca0dfbb3fa6d2801c5ce Parent: 7c08d70c69150148c14f02633855f1591219c37c Author: Mark Fasheh <[EMAIL PROTECTED]> AuthorDate: Fri Jul 20 12:02:14 2007 -0700 Committer: Mark Fasheh <[EMAIL PROTECTED]> CommitDate: Thu Aug 9 17:25:38 2007 -0700
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 <[EMAIL PROTECTED]> --- 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 b1ae4c7..4ffa715 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1028,6 +1028,11 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) } if (size_change && attr->ia_size != i_size_read(inode)) { + if (attr->ia_size > sb->s_maxbytes) { + status = -EFBIG; + goto bail_unlock; + } + if (i_size_read(inode) > attr->ia_size) status = ocfs2_truncate_file(inode, bh, attr->ia_size); else - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html