]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use btrfs_ordered_update_i_size in clone_finish_inode_update
authorJosef Bacik <josef@toxicpanda.com>
Fri, 17 Jan 2020 14:02:19 +0000 (09:02 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:24 +0000 (17:01 +0100)
commit3ee80068da1f9204c139e3abf88f17d6f582b293
treefc20499f48b27268ebf9a8cde038634b1e0f5262
parentc2b05316b03d0438f16b74447700e31ac3d011d3
btrfs: use btrfs_ordered_update_i_size in clone_finish_inode_update

We were using btrfs_i_size_write(), which unconditionally jacks up
inode->disk_i_size.  However since clone can operate on ranges we could
have pending ordered extents for a range prior to the start of our clone
operation and thus increase disk_i_size too far and have a hole with no
file extent.

Fix this by using the btrfs_ordered_update_i_size helper which will do
the right thing in the face of pending ordered extents outside of our
clone range.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c