dm mpath: add retry pg init
Alasdair G Kergon
maintainerPATCH 21/25 dm mpath: add retry pg init
From: Dave Wysochanski <[email protected]>
This patch allows a failed path group initialisation command to be retried.
It adds a generic MP_RETRY flag and a "pg_init_retries" feature to device-mapper multipath which limits the number of retries.
1. A hw handler sends a path initialization command to the storage and the command completes with an error code indicating the command should be retried.
2. The hardware handler calls dm_pg_init_complete() with MP_RETRY set in err_flags to ask the dm multipath core to retry.
3. If the retry limit has not been exceeded, pg_init() is retried. Otherwise fail_path() is called.
If you are using the userspace multipath-tools or device-mapper-multipath package, you can set pg_init_retries in the 'device' section of your /etc/multipath.conf file. For example:
features "2 pg_init_retries 7"
The number of PG retries attempted is reported in the 'dmsetup status' output.
---
[AGK TODO: Perform a fresh review of the state machine changes related to dm_pg_init_complete.]
drivers/md/dm-hw-handler.h | 1 drivers/md/dm-mpath.c | 81 +++++++++++++++++++++++++++++++++++++-------- 2 files changed, 68 insertions(+), 14 deletions(-)
drivers/md/dm-hw-handler.h +1 -0
@@ -58,5 +58,6 @@ unsigned dm_scsi_err_handler(struct hw_h#define MP_FAIL_PATH 1#define MP_BYPASS_PG 2#define MP_ERROR_IO 4/* Don't retry this I/O */ +#define MP_RETRY 8#endif
drivers/md/dm-mpath.c +67 -14
138 lines not on this page · raw message