Don't enter recovery move over pending paths
Benjamin Marzinski
maintainercover Don't enter recovery move over pending paths
After commit 2e61b8fb, I started seeing multipath devices switching into recovery mode briefly on startup. They come back out shortly, so unless no_path_retry is set very low, this won't be an issue, but multipathd shouldn't enter recovery mode at all over pending paths.
Benjamin Marzinski (3):
libmultipath: fix DI_NOIO pathinfo PATH_PENDING handling
libmultipath: simplify out __set_no_path_retry()
libmultipath: don't enter recovery mode with pending paths
libmultipath/discovery.c | 5 ++++- libmultipath/libmultipath.version | 2 +- libmultipath/structs_vec.c | 13 ++++++------- libmultipath/structs_vec.h | 3 +-- 4 files changed, 12 insertions(+), 11 deletions(-)
Signature · 6 lines
2.17.2 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerPATCH 1/3 libmultipath: fix DI_NOIO pathinfo PATH_PENDING handling
pp->state should only be set to PATH_PENDING if it is currently in the PATH_UNCHECKED or PATH_WILD states. Otherwise, it should retain its current state. Fix this in pathinfo() calls with DI_NOIO, to match with the rest of the code.
--- libmultipath/discovery.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
libmultipath/discovery.c +4 -1
@@ -2345,7 +2345,10 @@ int pathinfo(struct path *pp, struct config *conf, int mask)* Avoid any IO on the device itself. * simply use the path_offline() return as its state */ - pp->chkrstate = pp->state = path_state; +if (path_state !=PATH_PENDING || + pp->state ==PATH_UNCHECKED || + pp->state ==PATH_WILD ) + pp->chkrstate = pp->state = path_state;return PATHINFO_OK ; }
Signature · 6 lines
2.17.2 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerPATCH 2/3 libmultipath: simplify out __set_no_path_retry()
In reply to Benjamin MarzinskiThe only caller of __set_no_path_retry() is set_no_path_retry(), so remove the define and the unneeded arguments from the function.
--- libmultipath/libmultipath.version | 2 +- libmultipath/structs_vec.c | 11 +++++------ libmultipath/structs_vec.h | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-)
libmultipath/libmultipath.version +1 -1
@@ -176,7 +176,7 @@ global: select_reservation_key; send_packet; set_max_fds; - __set_no_path_retry; + set_no_path_retry; set_path_removed; set_prkey; setup_map;
libmultipath/structs_vec.c +5 -6
@@ -588,23 +588,22 @@ static void leave_recovery_mode(struct multipath *mpp) } } -void __set_no_path_retry (struct multipath *mpp,bool check_features) +void set_no_path_retry (struct multipath *mpp) {bool is_queueing = false;/* assign a value to make gcc happy */ - check_features = check_features && mpp->features !=NULL ; -if (check_features) +if (mpp->features) is_queueing =strstr (mpp->features,"queue_if_no_path" );switch (mpp->no_path_retry) {case NO_PATH_RETRY_UNDEF :break ;case NO_PATH_RETRY_FAIL : -if (!check_features || is_queueing) +if (!mpp->features || is_queueing)dm_queue_if_no_path (mpp->alias,0 );break ;case NO_PATH_RETRY_QUEUE : -if (!check_features || !is_queueing) +if (!mpp->features || !is_queueing)dm_queue_if_no_path (mpp->alias,1 );break ;default :
@@ -613,7 +612,7 @@ void __set_no_path_retry(struct multipath *mpp, bool check_features)* If in_recovery is set, leave_recovery_mode() takes * care of dm_queue_if_no_path. Otherwise, do it here. */ -if ((!check_features || !is_queueing) && +if ((!mpp->features || !is_queueing) && !mpp->in_recovery)dm_queue_if_no_path (mpp->alias,1 );leave_recovery_mode (mpp);
libmultipath/structs_vec.h +1 -2
@@ -11,8 +11,7 @@ struct vectors {struct mutex_lock lock;/* defined in lock.h */ }; -void __set_no_path_retry (struct multipath *mpp,bool check_features); -#define set_no_path_retry (mpp) __set_no_path_retry(mpp, true) +void set_no_path_retry (struct multipath *mpp);int adopt_paths (vector pathvec,struct multipath * mpp);void orphan_path (struct path * pp,const char *reason);
Signature · 6 lines
2.17.2 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerPATCH 3/3 libmultipath: don't enter recovery mode with pending paths
In reply to Benjamin Marzinskiset_no_path_retry() could make a multipath device enter recovery mode simply because its paths were still in the PATH_PENDING state. This is possible when a multipath device is first created. After commit 2e61b8fb [libmultipath (coverity): Revert "setup_map: wait for pending path checkers to finish"] it has become much more likely.
To avoid this, don't enter recovery mode as long as there are some paths in PATH_PENDING. Since path's can only be in this state if they've never had their state checker finish, this change will only effect recently created devices, whose checker hasn't completed yet.
--- libmultipath/structs_vec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/structs_vec.c +1 -1
@@ -616,7 +616,7 @@ void set_no_path_retry(struct multipath *mpp) !mpp->in_recovery)dm_queue_if_no_path (mpp->alias,1 );leave_recovery_mode (mpp); - }else + }else if (pathcount (mpp,PATH_PENDING ) ==0 )enter_recovery_mode (mpp);break ; }
Signature · 6 lines
2.17.2 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 12 lines · Benjamin Marzinski
After commit
2e61b8fb, I started seeing multipath devices switching into
recovery mode briefly on startup. They come back out shortly, so unlessno_path_retryis set very low, this won't be an issue, but multipathd shouldn't enter recovery mode at all over pending paths.Benjamin Marzinski (3):
libmultipath: fixDI_NOIOpathinfoPATH_PENDINGhandling
libmultipath: simplify out__set_no_path_retry()
libmultipath: don't enter recovery mode with pending paths
Quoted 6 lines
libmultipath/discovery.c | 5 ++++- libmultipath/libmultipath.version | 2 +- libmultipath/structs_vec.c | 13 ++++++------- libmultipath/structs_vec.h | 3 +--
4 files changed, 12 insertions(+), 11 deletions(-)
For the set:
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel