]> git.hungrycats.org Git - btrfs-progs/commitdiff
btrfs-progs: scrub: update the error message to reduce confusion
authorQu Wenruo <wqu@suse.com>
Sat, 30 May 2026 01:07:52 +0000 (10:37 +0930)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Jul 2026 21:14:26 +0000 (23:14 +0200)
[BUG]
There is a bug report that scrub is reporting confusing and conflicting
messages:

  $ sudo btrfs scrub start -B /mnt
  Starting scrub on devid 1
  scrub done for 44cb181f-faf6-48c2-a462-904cfe493576
  Scrub started:    Fri May 29 23:54:53 2026
  Status:           finished
  Duration:         0:10:23
  Total to scrub:   911.45GiB
  Rate:             1.46GiB/s
  Error summary:    csum=18
    Corrected:      0
    Uncorrectable:  18
    Unverified:     0
  ERROR: there are 1 uncorrectable errors

There are 18 uncorrectable errors, but the final line only shows one.

[CAUSE]
The "1" is for the number of devices with uncorrectable errors, not the
total errors found in the device.

[FIX]
Change the error message to "there are 1 device(s) with uncorrectable
errors" instead.

Pull-request: #1127
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds/scrub.c

index 28cfc6e7eb55fe75a5e08f97b6f58022b1ac4626..2b256f9d08b074a8b9593a3081842d4442b967fb 100644 (file)
@@ -1727,7 +1727,7 @@ out:
        if (nothing_to_resume)
                return 2;
        if (e_uncorrectable) {
-               error("there are %d uncorrectable errors", e_uncorrectable);
+               error("there are %d device(s) with uncorrectable errors", e_uncorrectable);
                return 3;
        }
        if (e_correctable)