Skip to content

Commit dba72cb

Browse files
Holger Hoffstättemasoncl
authored andcommitted
btrfs: fix balance range usage filters in 4.4-rc
There's a regression in 4.4-rc since commit bc30946 (btrfs: extend balance filter usage to take minimum and maximum) in that existing (non-ranged) balance with -dusage=x no longer works; all chunks are skipped. After staring at the code for a while and wondering why a non-ranged balance would even need min and max thresholds (..which then were not set correctly, leading to the bug) I realized that the only problem was the fact that the filter functions were named wrong, thanks to patching copypasta. Simply renaming both functions lets the existing btrfs-progs call balance with -dusage=x and now the non-ranged filter function is invoked, properly using only a single chunk limit. Signed-off-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com> Fixes: bc30946 ("btrfs: extend balance filter usage to take minimum and maximum") Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Chris Mason <clm@fb.com>
1 parent 82bd101 commit dba72cb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/btrfs/volumes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,7 +3122,7 @@ static int chunk_profiles_filter(u64 chunk_type,
31223122
return 1;
31233123
}
31243124

3125-
static int chunk_usage_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset,
3125+
static int chunk_usage_range_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset,
31263126
struct btrfs_balance_args *bargs)
31273127
{
31283128
struct btrfs_block_group_cache *cache;
@@ -3155,7 +3155,7 @@ static int chunk_usage_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset,
31553155
return ret;
31563156
}
31573157

3158-
static int chunk_usage_range_filter(struct btrfs_fs_info *fs_info,
3158+
static int chunk_usage_filter(struct btrfs_fs_info *fs_info,
31593159
u64 chunk_offset, struct btrfs_balance_args *bargs)
31603160
{
31613161
struct btrfs_block_group_cache *cache;

0 commit comments

Comments
 (0)