On 23/09/2024 10:38, Yu Kuai wrote:
Are you saying that some improvement needs to be made to the current
code for badblocks handling, like initially try to skip bio_split()?
Apart from that, what about the change in raid10_write_request(),
w.r.t error handling?
There, for an error in bio_split(), I think that we need to do some
tidy-up if bio_split() fails, i.e. undo increase in rdev->nr_pending
when looping conf->copies
BTW, feel free to comment in patch 6/6 for that.
Yes, raid1/raid10 write are the same. If you want to enable atomic write
for raid1/raid10, you must add a new branch to handle badblocks now,
otherwise, as long as one copy contain any badblocks, atomic write will
fail while theoretically I think it can work.
ok, I'll check the badblocks code further to understand this.
The point really for atomic writes support is that we should just not be
attempting to split a bio, and handle an attempt to split an atomic
write bio like any other bio split failure, e.g. if it does happen we
either have a software bug or out-of-resources (-ENOMEM). Properly
stacked atomic write queue limits should ensure that we are not in the
situation where we do need to split, and the new checking in bio_split()
is just an insurance policy.
Thanks,
John