btrfs: accept zero for balance usage filter
PATCH 1/1 btrfs: accept zero for balance usage filter
The condition can be relaxed to accept also 0 which will delete unoccupied chunks and does not need space for the actual data relocation. Until there is an automatic empty chunk reclaim, we can use this as a last resort option under enospc.
---
Also needs progs update, but is not required for the kernel side.
fs/btrfs/volumes.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
fs/btrfs/volumes.c +4 -1
@@ -2623,7 +2623,10 @@ static int chunk_usage_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset, user_thresh =div_factor_fine (cache->key.offset, bargs->usage); -if (chunk_used < user_thresh) +pr_debug ("btrfs: chunk_used %llu, user_thresh %llu\n" , + (unsigned long long )chunk_used, + (unsigned long long )user_thresh); +if (chunk_used <= user_thresh) ret =0 ;btrfs_put_block_group (cache);
Signature · 1 line
1.7.9
Quoted 7 lines · David Sterba
The condition can be relaxed to accept also 0 which will delete unoccupied chunks and does not need space for the actual data relocation. Until there is an automatic empty chunk reclaim, we can use this as a last resort option under enospc.
CC Ilya Dryomov <[email protected]>Signed-off-by David Sterba <[email protected]>
Josef, please don't pull this one into btrfs-next, it's been deprecated by "Btrfs: allow for selecting only completely empty chunks" from me. David and I discussed this on IRC, he is OK with it.
Thanks,
Ilya
Quoted 3 lines · Ilya Dryomov
Josef, please don't pull this one into btrfs-next, it's been deprecated by "Btrfs: allow for selecting only completely empty chunks" from me. David and I discussed this on IRC, he is OK with it.
Ack.
david