+ if (is_bad && bio->bi_opf & REQ_ATOMIC) {
+ /* We just cannot atomically write this ... */
+ error = -EFAULT;
+ goto err_handle;
+ }
One nit here. If the write range are all badblocks, then this rdev is
skipped, and bio won't be splited, so I think atomic write is still fine
in this case. Perhaps move this conditon below?
Same for raid10.