From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Aring Date: Tue, 5 Oct 2021 13:34:10 -0400 Subject: [Cluster-devel] [PATCH dlm/next 2/2] fs: dlm: use dlm_recovery_stopped in condition In-Reply-To: <20211005173410.4004891-1-aahringo@redhat.com> References: <20211005173410.4004891-1-aahringo@redhat.com> Message-ID: <20211005173410.4004891-2-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch will change to evaluate the dlm_recovery_stopped() in the condition of the if branch instead fetch it before evaluating the condition. As this is an atomic test-set operation it should be evaluated in the condition itself. Reported-by: Andreas Gruenbacher Signed-off-by: Alexander Aring --- fs/dlm/dir.c | 3 +-- fs/dlm/member.c | 3 +-- fs/dlm/recoverd.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c index 45ebbe602bbf..b6692f81ec83 100644 --- a/fs/dlm/dir.c +++ b/fs/dlm/dir.c @@ -84,8 +84,7 @@ int dlm_recover_directory(struct dlm_ls *ls) for (;;) { int left; - error = dlm_recovery_stopped(ls); - if (error) { + if (dlm_recovery_stopped(ls)) { error = -EINTR; goto out_free; } diff --git a/fs/dlm/member.c b/fs/dlm/member.c index 3122c5a718c4..7eca9148d25c 100644 --- a/fs/dlm/member.c +++ b/fs/dlm/member.c @@ -442,8 +442,7 @@ static int ping_members(struct dlm_ls *ls) int error = 0; list_for_each_entry(memb, &ls->ls_nodes, list) { - error = dlm_recovery_stopped(ls); - if (error) { + if (dlm_recovery_stopped(ls)) { error = -EINTR; break; } diff --git a/fs/dlm/recoverd.c b/fs/dlm/recoverd.c index 62642dc67c2d..3ccb2395b663 100644 --- a/fs/dlm/recoverd.c +++ b/fs/dlm/recoverd.c @@ -129,8 +129,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv) dlm_recover_waiters_pre(ls); - error = dlm_recovery_stopped(ls); - if (error) { + if (dlm_recovery_stopped(ls)) { error = -EINTR; goto fail; } -- 2.27.0