]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: only update disk_i_size as we remove extents
authorJosef Bacik <jbacik@fusionio.com>
Thu, 29 Aug 2013 20:43:28 +0000 (16:43 -0400)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:16:40 +0000 (08:16 -0400)
commit6fde9df48601b06a60bf1b004faef5204578aaf8
treeaaf7daed23b75d8c5400cee9cc39f12db134a7b3
parentb194cd6a2031fd6ae283af8c3e59421ad0977b5a
Btrfs: only update disk_i_size as we remove extents

This fixes a problem where if we fail a truncate we will leave the i_size set
where we wanted to truncate to instead of where we were able to truncate to.
Fix this by making btrfs_truncate_inode_items do the disk_i_size update as it
removes extents, that way it will always be consistent with where its extents
are.  Then if the truncate fails at all we can update the in-ram i_size with
what we have on disk and delete the orphan item.  Thanks,

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