]> git.hungrycats.org Git - linux/commitdiff
btrfs: print the error when reclaim fails to relocate a block group
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 27 Sep 2026 19:02:40 +0000 (15:02 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Mon, 2 Nov 2026 02:16:33 +0000 (21:16 -0500)
When the background reclaim of a block group fails, the error is logged
as just "error relocating chunk <start>".  The reclaim worker retries
the group on its next pass, so a persistent failure shows up as the same
line every 30 seconds with nothing saying why: -ENOSPC from a
reservation, -EIO from a bad read, and -ETXTBSY from an active swapfile
all look alike, and telling them apart takes tracing the relocation
path.

Print the error code.

Assisted-by: Claude:claude-opus-5-5
fs/btrfs/block-group.c

index 4333b3067a44f59b2f686bf98d932106a8dd1818..dfe7e5eb7511cf6e88e27bc9bf51aafb289a4c1f 100644 (file)
@@ -5598,8 +5598,8 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
        }
        if (ret) {
                btrfs_dec_block_group_ro(bg);
-               btrfs_err(fs_info, "error relocating chunk %llu",
-                         bg->start);
+               btrfs_err(fs_info, "error relocating chunk %llu: %d",
+                         bg->start, ret);
                used = 0;
                reserved = 0;
                spin_lock(&space_info->lock);