Add MP_RETRY flag for hw handlers to tell dm-mpath to retry pg_init
PATCH 2/3 Add MP_RETRY flag for hw handlers to tell dm-mpath to retry pg_init
Add MP_RETRY flag for hw handlers to tell dm-mpath to retry pg_init.
This patch adds a MP_RETRY flag and "pg_init_retries" feature to dm-multipath core. The flag is a generic one, but in this instance we use it to flag cases where we must retry a pg_init command. The patch is useful for cases where a hw handler sends a path initialization command to the storage and it sees the command complete with an error code indicating the command should be retried. In this case, the hardware handler should call dm_pg_init_complete() with MP_RETRY set in the err_flags, and this suggests to the dm-mpath core to retry the pg_init. However, it is not a guarantee that the dm-mpath core will actually retry the pg_init. The number of actual retries is governed by the multipath feature argument "pg_init_retries". Once the dm-mpath core has retried the command "pg_init_retries" times without success, a subsequent dm_pg_init_complete() with MP_RETRY will cause the path to be failed via fail_path(). To specify a value of pg_init_retries, add a line similar to the following in the 'device' section of your /etc/multipath.conf file:
features "2 pg_init_retries 7"
---
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 +50 -8
111 lines not on this page · raw message