diff options
author | Josef Bacik <josef@redhat.com> | 2010-11-22 13:55:39 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-11-27 13:00:07 -0500 |
commit | 0ed42a63f3edb144b091d9528401fce95c3c4d8d (patch) | |
tree | d98573473d916eecbeb949d45f8ac9b530440080 /fs/btrfs | |
parent | 55a61d1d06a3dc443d0db8aaa613365dcb83b98a (diff) |
Btrfs: make sure new inode size is ok in fallocate
We have been failing xfstest 228 forever, because we don't check to make sure
the new inode size is acceptable as far as RLIMIT is concerned. Just check to
make sure it's ok to create a inode with this new size and error out if not.
With this patch we now pass 228.
Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 0058fb3c2561..0eeacd93e8e5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -7102,6 +7102,10 @@ static long btrfs_fallocate(struct inode *inode, int mode, | |||
7102 | btrfs_wait_ordered_range(inode, alloc_start, alloc_end - alloc_start); | 7102 | btrfs_wait_ordered_range(inode, alloc_start, alloc_end - alloc_start); |
7103 | 7103 | ||
7104 | mutex_lock(&inode->i_mutex); | 7104 | mutex_lock(&inode->i_mutex); |
7105 | ret = inode_newsize_ok(inode, alloc_end); | ||
7106 | if (ret) | ||
7107 | goto out; | ||
7108 | |||
7105 | if (alloc_start > inode->i_size) { | 7109 | if (alloc_start > inode->i_size) { |
7106 | ret = btrfs_cont_expand(inode, alloc_start); | 7110 | ret = btrfs_cont_expand(inode, alloc_start); |
7107 | if (ret) | 7111 | if (ret) |