diff options
author | Jeff Mahoney <jeffm@suse.com> | 2015-06-15 09:41:19 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-07-29 08:15:29 -0700 |
commit | e33e17ee1098d8d751552ac11c111e1c1a3db014 (patch) | |
tree | 49b4c9b5c4123db86d9256a5b9122da73275d730 /fs/btrfs/super.c | |
parent | e44163e177960ee60e32a73bffdd53c3a5827406 (diff) | |
download | talos-obmc-linux-e33e17ee1098d8d751552ac11c111e1c1a3db014.tar.gz talos-obmc-linux-e33e17ee1098d8d751552ac11c111e1c1a3db014.zip |
btrfs: add missing discards when unpinning extents with -o discard
When we clear the dirty bits in btrfs_delete_unused_bgs for extents
in the empty block group, it results in btrfs_finish_extent_commit being
unable to discard the freed extents.
The block group removal patch added an alternate path to forget extents
other than btrfs_finish_extent_commit. As a result, any extents that
would be freed when the block group is removed aren't discarded. In my
test run, with a large copy of mixed sized files followed by removal, it
left nearly 2/3 of extents undiscarded.
To clean up the block groups, we add the removed block group onto a list
that will be discarded after transaction commit.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Tested-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index a1077e0ffaa8..8da24e242896 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -69,7 +69,7 @@ static struct file_system_type btrfs_fs_type; static int btrfs_remount(struct super_block *sb, int *flags, char *data); -static const char *btrfs_decode_error(int errno) +const char *btrfs_decode_error(int errno) { char *errstr = "unknown"; |