This patch introduces the mechanism to recover from I/O failures by re-initializing the path if the device is running on only one path. Problem: Device mapper fails the path for every I/O error. It does not care about the type of error. There are certain errors which can be recovered by re-initializing the path again. I have seen this problem during my testing on rdac device handler. I have observed I/O errors when there is a change in Lun ownership. When Lun ownership changes device will return back with check condition with sense 0x05/0x94/0x01(SK/ASC/ASCQ -meaning Lun ownership changed). Currently, device mapper fails the path for this error and eventually this will lead to I/O error. We don't want to see I/O error for this reason. The patch will set the flag pg_init_required if the device is running on single path. The process_queued_ios will re-initialize path if required. I have tested this patch on LSI rdac handler. Signed-off-by: Babu Moger <babu.moger@xxxxxxx> --- --- linux-2.6.30-rc2/drivers/md/dm-mpath.c.orig 2009-04-17 16:49:33.000000000 -0500 +++ linux-2.6.30-rc2/drivers/md/dm-mpath.c 2009-04-17 17:09:51.000000000 -0500 @@ -1152,6 +1152,15 @@ static int do_end_io(struct multipath *m return error; spin_lock_irqsave(&m->lock, flags); + /* + * If this is the only path left, then lets try to + * re-initialize the PG one last time.. + */ + if (m->nr_valid_paths == 1 && m->hw_handler_name) { + m->pg_init_required = 1; + spin_unlock_irqrestore(&m->lock, flags); + goto requeue; + } if (!m->nr_valid_paths) { if (__must_push_back(m)) { spin_unlock_irqrestore(&m->lock, flags); -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel