btrfs-progs: balance: usage range filter not working
PATCH 1/1 btrfs-progs: balance: usage range filter not working
When range support was added to the usage filter, a bug was introduced, as BTRFS_BALANCE_ARGS_USAGE is set unconditionally, even when BTRFS_BALANCE_ARGS_USAGE_RANGE is also set.
If BTRFS_BALANCE_ARGS_USAGE is set, BTRFS_BALANCE_ARGS_USAGE_RANGE is ignored, see fs/btrfs/volumes.c:should_balance_chunk().
Signed-off-by Illia Bobyr <[email protected]>
--- cmds/balance.c | 1 - 1 file changed, 1 deletion(-)
cmds/balance.c +0 -1
@@ -141,7 +141,6 @@ static int parse_filters(char *filters, struct btrfs_balance_args *args) args->flags &= ~BTRFS_BALANCE_ARGS_USAGE_RANGE ; args->flags |=BTRFS_BALANCE_ARGS_USAGE ; } - args->flags |=BTRFS_BALANCE_ARGS_USAGE ; }else if (strcmp (this_char,"devid" ) ==0 ) {if (!value || !*value) {error ("the devid filter requires an argument" );
Signature · 1 line
2.51.0
Quoted 8 lines · Illia Bobyr
When range support was added to the usage filter, a bug was introduced, as
BTRFS_BALANCE_ARGS_USAGEis set unconditionally, even whenBTRFS_BALANCE_ARGS_USAGE_RANGEis also set.If
BTRFS_BALANCE_ARGS_USAGEis set,BTRFS_BALANCE_ARGS_USAGE_RANGEis ignored, seefs/btrfs/volumes.c:should_balance_chunk().Signed-off-by Illia Bobyr <[email protected]>
Added to devel, thanks.