summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2010-02-04 19:33:03 +0300
committerChris Mason <chris.mason@oracle.com>2010-02-04 19:33:03 +0300
commit23b5c50945f2294add0137799400329c0ebba290 (patch)
treeb7bb2ea17bc2244162adef8a288db12cacbf3524 /fs
parentefd049fb26a162c3830fd3cb1001fdc09b147f3b (diff)
downloadlinux-23b5c50945f2294add0137799400329c0ebba290.tar.xz
Btrfs: apply updated fallocate i_size fix
This version of the i_size fix for fallocate makes sure we only update the i_size when the current fallocate is really operating outside of i_size. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 6782aa19130d..4deb280f8969 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5799,7 +5799,9 @@ static int prealloc_file_range(struct inode *inode, u64 start, u64 end,
inode->i_ctime = CURRENT_TIME;
BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC;
if (!(mode & FALLOC_FL_KEEP_SIZE) &&
- cur_offset > inode->i_size) {
+ (actual_len > inode->i_size) &&
+ (cur_offset > inode->i_size)) {
+
if (cur_offset > actual_len)
i_size = actual_len;
else