Neil Brown <neilb@xxxxxxx> writes: > Jes.Sorensen@xxxxxxxxxx writes: > >> From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> >> >> Hi, >> >> Bill Kuzeja reported a problem to me about data corruption when >> repeatedly removing and re-adding devices in raid1 arrays. It showed >> up to be caused by the return value of submit_bio_wait() being handled >> incorrectly. Tracking this down is credit of Bill! >> >> Looks like commit 9e882242c6193ae6f416f2d8d8db0d9126bd996b changed the >> return of submit_bio_wait() to return != 0 on error, whereas before it >> returned 0 on error. >> >> This fix should be suitable for -stable as far back as 3.9 > > 3.10? Yes, I guess there is no 3.9 stable, but certainly 3.10+ > Thanks to both of you! > > I took the liberty of changing the patches a little so they are now: > > - if (submit_bio_wait(WRITE, wbio) == 0) > + if (submit_bio_wait(WRITE, wbio) < 0) > > because when there is no explicit test I tend to expect a Bool but these > values are not Bool. I based it on this from block/bio.c: /** * submit_bio_wait - submit a bio, and wait until it completes * @rw: whether to %READ or %WRITE, or maybe to %READA (read ahead) * @bio: The &struct bio which describes the I/O * * Simple wrapper around submit_bio(). Returns 0 on success, or the error from * bio_endio() on failure. */ assuming anything but 0 is an error, but < 0 should be fine as well. > Patches are in my for-linus branch and will be forwarded sometime this > week. Sounds great! Thanks! Jes -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html