]> git.hungrycats.org Git - linux/commitdiff
btrfs: stripe_alloc: show per-group trapped bytes in the space info dump
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 5 Sep 2026 09:50:30 +0000 (05:50 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Wed, 16 Sep 2026 21:40:06 +0000 (17:40 -0400)
Assisted-by: Claude:claude-fable-5
fs/btrfs/space-info.c

index 829b1719e71a6926d14def26153c5cbbfb1f7632..6bf657efe988c2c63149e120b2123e989692d45a 100644 (file)
@@ -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);