diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 0f0368e63e5af14fbbdde3497f98801897a17368..c6411c849fea0499ed7996f0affc1c52768ca05b 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -2118,9 +2118,12 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) atomic_set(&rbio->error, 0); /* - * read everything that hasn't failed. Thanks to the - * stripe cache, it is possible that some or all of these - * pages are going to be uptodate. + * Read everything that hasn't failed. However this time we will + * not trust any cached sector. + * As we may read out some stale data but higher layer is not reading + * that stale part. + * + * So here we always re-read everything in recovery path. */ for (total_sector_nr = 0; total_sector_nr < rbio->nr_sectors; total_sector_nr++) { @@ -2135,11 +2138,7 @@ static int __raid56_parity_recover(struct btrfs_raid_bio *rbio) total_sector_nr += rbio->stripe_nsectors - 1; continue; } - /* The RMW code may have already read this page in. */ sector = rbio_stripe_sector(rbio, stripe, sectornr); - if (sector->uptodate) - continue; - ret = rbio_add_io_sector(rbio, &bio_list, sector, stripe, sectornr, rbio->stripe_len, REQ_OP_READ);