On 2025/09/09 10:02, Yu Kuai wrote: > Hi, > > 在 2025/09/09 1:29, Kenta Akagi 写道: >> On 2025/09/08 10:20, Yu Kuai wrote: >>> >>> >>> 在 2025/09/02 0:48, Kenta Akagi 写道: >>>> In the current raid1_end_write_request implementation, >>>> - md_error is called only in the Failfast case. >>>> - Afterwards, if the rdev is not Faulty (that is, not Failfast, >>>> or Failfast but the last rdev — which originally was not expected >>>> MD_BROKEN in RAID1), R1BIO_WriteError is set. >>>> In the suggested implementation, it seems that a non-Failfast write >>>> failure will immediately mark the rdev as Faulty, without retries. >>> >>> I still prefer a common helper to unify the code, not sure if I still >>> missing something ... >>> >>> In general, if bio failed, for read/write/metadata/resync should be the >>> same: >>> >>> 1) failfast is set, and not last rdev, md_error(); >>> 2) otherwise, we should always retry; >>> >>> And I do believe it's the best to unify this by a common helper. >> >> Yes, I realized that my idea is bad. Your idea is best, >> especially considering the error handling in super_written. >> I'll implement a common helper. >> >> By the way, I think md_error should only be serialized on RAID1 and 10 >> for now. Serializing unnecessary personalities is inefficient and can >> lead to unfavorable results. What do you think? > > Just make code cleaner and I don't have preference here, md_error is > super cold path I think. Thank you for your advice. Understood. Thanks, Akagi > Thanks, > Kuai > >> >> Thanks, >> Akagi >> >>> Thanks, >>> Kuai >>> >>> >> >> . >> > >