]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: zoned: use filesystem size not disk size for reclaim decision
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tue, 20 May 2025 07:20:47 +0000 (09:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:04 +0000 (16:26 +0200)
commite50baade7b62a61327514002c09016b0b2df110b
tree324b38b2cc72eb0031b31ba089cfc4e23f00dc35
parent29ea05b11a4094fdd51aebf32f04b962362981e3
btrfs: zoned: use filesystem size not disk size for reclaim decision

commit 55f7c65b2f69c7e4cb7aa7c1654a228ccf734fd8 upstream.

When deciding if a zoned filesystem is reaching the threshold to reclaim
data block groups, look at the size of the filesystem not to potentially
total available size of all drives in the filesystem.

Especially if a filesystem was created with mkfs' -b option, constraining
it to only a portion of the block device, the numbers won't match and
potentially garbage collection is kicking in too late.

Fixes: 3687fcb0752a ("btrfs: zoned: make auto-reclaim less aggressive")
CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/zoned.c