diff options
author | Omar Sandoval <osandov@fb.com> | 2018-05-11 22:13:32 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-28 18:23:46 +0200 |
commit | f7e9e8fc792fe2f823ff7d64d23f4363b3f2203a (patch) | |
tree | 82343d002f8e64dbabc211d1b23cfaca6a259609 /fs/btrfs/free-space-cache.c | |
parent | Btrfs: don't BUG_ON() in btrfs_truncate_inode_items() (diff) | |
download | linux-f7e9e8fc792fe2f823ff7d64d23f4363b3f2203a.tar.xz linux-f7e9e8fc792fe2f823ff7d64d23f4363b3f2203a.zip |
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 7f4f6e0a3f6d ("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>
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
-rw-r--r-- | fs/btrfs/free-space-cache.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index e5b569bebc73..d5f80cb300be 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -253,10 +253,8 @@ int btrfs_truncate_free_space_cache(struct btrfs_trans_handle *trans, truncate_pagecache(inode, 0); /* - * We don't need an orphan item because truncating the free space cache - * will never be split across transactions. - * We don't need to check for -EAGAIN because we're a free space - * cache inode + * We skip the throttling logic for free space cache inodes, so we don't + * need to check for -EAGAIN. */ ret = btrfs_truncate_inode_items(trans, root, inode, 0, BTRFS_EXTENT_DATA_KEY); |