]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: stop creating orphan items for truncate
authorOmar Sandoval <osandov@fb.com>
Fri, 11 May 2018 20:13:32 +0000 (13:13 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:23:46 +0000 (18:23 +0200)
commit763c40b658acad627b4aef65cd25fa798b1ae454
tree82343d002f8e64dbabc211d1b23cfaca6a259609
parentc992d02edcd35aa9d05041a3b092fff7a60faa6a
Btrfs: stop creating orphan items for truncate

Currently, we insert an orphan item during a truncate so that if there's
a crash, we don't leak extents past the on-disk i_size. However, since
commit 5d51ca6de609 ("Btrfs: only update disk_i_size as we remove
extents"), we keep disk_i_size in sync with the extent items as we
truncate, so orphan cleanup will never have any extents to remove. Don't
bother with the superfluous orphan item.

Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.c
fs/btrfs/inode.c