From: Zygo Blaxell Date: Sat, 5 Sep 2026 09:50:30 +0000 (-0400) Subject: btrfs: stripe_alloc: show per-group trapped bytes in the space info dump X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b28f1fd8ca4cb2e590b97287c9a028ae1cf827e;p=linux btrfs: stripe_alloc: show per-group trapped bytes in the space info dump Assisted-by: Claude:claude-fable-5 --- diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index 829b1719e71a6..6bf657efe988c 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -783,11 +783,15 @@ again: spin_lock(&cache->lock); avail = cache->length - cache->used - cache->pinned - cache->reserved - cache->bytes_super - cache->zone_unusable; + if (READ_ONCE(cache->stripe_unusable_ready)) + avail -= min(avail, READ_ONCE(cache->stripe_unusable)); btrfs_info(fs_info, -"block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %llu delalloc %llu super %llu zone_unusable (%llu bytes available) %s", +"block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %llu delalloc %llu super %llu zone_unusable %llu stripe_unusable (%llu bytes available) %s", cache->start, cache->length, cache->used, cache->pinned, cache->reserved, cache->delalloc_bytes, cache->bytes_super, cache->zone_unusable, + READ_ONCE(cache->stripe_unusable_ready) ? + READ_ONCE(cache->stripe_unusable) : 0, avail, cache->ro ? "[readonly]" : ""); spin_unlock(&cache->lock); btrfs_dump_free_space(cache, bytes);