]> git.hungrycats.org Git - linux/commitdiff
btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe
authorFilipe Manana <fdmanana@suse.com>
Thu, 15 Oct 2026 17:45:45 +0000 (18:45 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Oct 2026 20:36:16 +0000 (21:36 +0100)
If we find errors we are returning the value of 'ret', which has a value
of 0 from some previous function call that succeeded, instead of returning
an -EIO error. Fix this by returning -EIO instead of 'ret'.

Fixes: fab0c0f03cfd ("btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helper")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c

index 479c0e037015ab27344031d2798a7cc40b96a8a0..ba2e27cc53519c1aa7be5ef3fddf43fa3e043fe2 100644 (file)
@@ -2250,7 +2250,7 @@ static int scrub_raid56_parity_stripe(struct scrub_ctx *sctx,
 "scrub: unrepaired sectors detected, full stripe %llu data stripe %u errors %*pbl",
                                  full_stripe_start, i, stripe->nr_sectors,
                                  &error);
-                       return ret;
+                       return -EIO;
                }
                bitmap_or(&extent_bitmap, &extent_bitmap, &has_extent,
                          stripe->nr_sectors);