md: In raid1_write_request(), when WriteErrorSeen and first_bad <= r1_bio->sector , why max_sectors is updated?

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

 



if (test_bit(WriteErrorSeen, &rdev->flags)) {
        ...
        if (is_bad && first_bad <= r1_bio->sector) {
                bad_sectors -= (r1_bio->sector - first_bad);
                if (bad_sectors < max_sectors)
                        max_sectors = bad_sectors;
                rdev_dec_pending(rdev, mddev);
                continue;
        }

        ...
}


When the condition "is_bad && first_bad <= r1_bio->sector" is true,
this rdev device will be skipped and will no participate in io, so I
think the following code snippet is unnecessary:

bad_sectors -= (r1_bio->sector - first_bad);
if (bad_sectors < max_sectors)
    max_sectors = bad_sectors;

So I am confused why we need to update max_sectors in this case?




[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