cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH RESEND v5.15-rc7 07/18] fs: dlm: use dlm_recovery_stopped in condition
Date: Tue,  2 Nov 2021 15:17:13 -0400	[thread overview]
Message-ID: <20211102191724.210095-8-aahringo@redhat.com> (raw)
In-Reply-To: <20211102191724.210095-1-aahringo@redhat.com>

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 <agruenba@redhat.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
 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 731d489aa323..61f906e705db 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 97d052cea5a9..a55dfce705dd 100644
--- a/fs/dlm/recoverd.c
+++ b/fs/dlm/recoverd.c
@@ -124,8 +124,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



  parent reply	other threads:[~2021-11-02 19:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 19:17 [Cluster-devel] [PATCH RESEND v5.15-rc7 00/18] fs: dlm: cleanups, trace and debugfs Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 01/18] fs: dlm: remove obsolete INBUF define Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 02/18] fs: dlm: fix small lockspace typo Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 03/18] fs: dlm: debug improvements print nodeid Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 04/18] fs: dlm: remove check SCTP is loaded message Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 05/18] fs: dlm: move version conversion to compile time Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 06/18] fs: dlm: use dlm_recovery_stopped instead of test_bit Alexander Aring
2021-11-02 19:17 ` Alexander Aring [this message]
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 08/18] fs: dlm: make dlm_callback_resume quite Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 09/18] fs: dlm: initial support for tracepoints Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 10/18] fs: dlm: trace socket handling Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 11/18] fs: dlm: requestqueue busy wait to event based wait Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 12/18] fs: dlm: ls_count " Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 13/18] fs: dlm: let handle callback data as void Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 14/18] fs: dlm: add debugfs rawmsg send functionality Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 15/18] fs: dlm: allow create lkb with specific id range Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 16/18] fs: dlm: add lkb debugfs functionality Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 17/18] fs: dlm: add lkb waiters " Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 18/18] fs: dlm: filter user dlm messages for kernel locks Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211102191724.210095-8-aahringo@redhat.com \
    --to=aahringo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).