btrfs: raid56: fix stripes if vertical errors are found
authorTanmay Bhushan <007047221b@gmail.com>
Sun, 15 Jan 2023 20:32:15 +0000 (21:32 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 25 Jan 2023 19:11:07 +0000 (20:11 +0100)
We take two stripe numbers if vertical errors are found.  In case it is
just a pstripe it does not matter but in case of raid 6 it matters as
both stripes need to be fixed.

Fixes: 7a3150723061 ("btrfs: raid56: do data csum verification during RMW cycle")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Tanmay Bhushan <007047221b@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/raid56.c

index 6a2cf754912df27a9573aeb5f11e8bc85d217aa0..f35898a78b16b8bc72bcce137ca678bfb35011c3 100644 (file)
@@ -1886,7 +1886,7 @@ pstripe:
                sector->uptodate = 1;
        }
        if (failb >= 0) {
-               ret = verify_one_sector(rbio, faila, sector_nr);
+               ret = verify_one_sector(rbio, failb, sector_nr);
                if (ret < 0)
                        goto cleanup;