]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
Btrfs: fix typo in fallocate to make it honor actual size
authorJosef Bacik <josef@redhat.com>
Mon, 22 Nov 2010 18:50:32 +0000 (18:50 +0000)
committerChris Mason <chris.mason@oracle.com>
Sat, 27 Nov 2010 17:59:16 +0000 (12:59 -0500)
commit55a61d1d06a3dc443d0db8aaa613365dcb83b98a
tree39f59ec200674081b086f9e25393401d08848ffd
parent45f49bce99d008d6864a20324548f35936ba46fb
Btrfs: fix typo in fallocate to make it honor actual size

There is a typo in __btrfs_prealloc_file_range() where we set the i_size to
actual_len/cur_offset, and then just set it to cur_offset again, and do the same
with btrfs_ordered_update_i_size().  This fixes it back to keeping i_size in a
local variable and then updating i_size properly.  Tested this with

xfs_io -F -f -c "falloc 0 1" -c "pwrite 0 1" foo

stat'ing foo gives us a size of 1 instead of 4096 like it was.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c