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.