Re: [Patch 1/6] dm: endio method

From: Mike Christie
Date: Sat Feb 21 2004 - 05:31:59 EST


Joe Thornber wrote:

Add an endio method to targets. This method is allowed to request
another shot at failed ios (think multipath).


+ if (endio) {
+ /* Restore bio fields. */
+ bio->bi_sector = tio->bi_sector;
+ bio->bi_bdev = tio->bi_bdev;
+ bio->bi_size = tio->bi_size;
+ bio->bi_idx = tio->bi_idx;
+
+ r = endio(tio->ti, bio, error, &tio->info);


+ r = ti->type->map(ti, clone, &tio->info);
+ if (r > 0) {
+ /* Save the bio info so we can restore it during endio. */
+ tio->bi_sector = clone->bi_sector;
+ tio->bi_bdev = clone->bi_bdev;
+ tio->bi_size = clone->bi_size;
+ tio->bi_idx = clone->bi_idx;


Saving and restoring bi_bdev is going to break multipath. When a bio is remapped and resent multiple times by the target becuase of multiple path failures, restoring bi_bdev to the original value will cause only that path to be marked as failed instead of the paths that the bio was remapped to.

This is DM's cloned bio. Is there a guarantee that this value should be safe from lower level drivers overwriting it, or is it similar to b_rdev for buffer_heads?

Mike Christie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/