Re: The read data is wrong from raid5 when recovery happens

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




在 2023/5/27 上午8:56, Xiao Ni 写道:
Hi all

The attachment is the scripts.

1. It needs to modify the member disks and raid name in prepare_rebuild_env.sh
2. It needs to modify the member disks and raid name in 01-test.sh
3. Then run 01-test.sh directly


Hi all

I have tried with a work around patch and can confirm this problem can't be reproduced again with this patch.

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 4cdb35e54251..96d7f8048876 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -6190,7 +6190,8 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
                        md_write_end(mddev);
                return true;
        }
-       md_account_bio(mddev, &bi);
+       if (rw == WRITE)
+               md_account_bio(mddev, &bi);

        /*
         * Lets start with the stripe with the lowest chunk offset in the first


This patch only disables the accounting for non-align read requests. I know it's not a good one. But the data corruption is more

serious than io accouting.

Regards

Xiao




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux