fs: dlm: always run complete for possible waiters
authorAlexander Aring <aahringo@redhat.com>
Fri, 21 May 2021 19:08:33 +0000 (15:08 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 25 May 2021 14:22:20 +0000 (09:22 -0500)
This patch changes the ping_members() result that we always run
complete() for possible waiters. We handle the -EINTR error code as
successful. This error code is returned if the recovery is stopped which
is likely that a new recovery is triggered with a new members
configuration and ping_members() runs again.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/member.c

index ceef3f2..48245ba 100644 (file)
@@ -576,12 +576,18 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
        *neg_out = neg;
 
        error = ping_members(ls);
-       if (!error || error == -EPROTO) {
-               /* new_lockspace() may be waiting to know if the config
-                  is good or bad */
-               ls->ls_members_result = error;
-               complete(&ls->ls_members_done);
-       }
+       /* error -EINTR means that a new recovery action is triggered.
+        * We ignore this recovery action and let run the new one which might
+        * have new member configuration.
+        */
+       if (error == -EINTR)
+               error = 0;
+
+       /* new_lockspace() may be waiting to know if the config
+        * is good or bad
+        */
+       ls->ls_members_result = error;
+       complete(&ls->ls_members_done);
 
        log_rinfo(ls, "dlm_recover_members %d nodes", ls->ls_num_nodes);
        return error;