gfs2 filesystem and dlm development
 help / color / mirror / Atom feed
* [PATCH dlm/next 1/2] dlm: fix error if inactive rsb is not hashed
@ 2025-02-28 22:48 Alexander Aring
  2025-02-28 22:48 ` [PATCH dlm/next 2/2] dlm: fix error if active " Alexander Aring
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Aring @ 2025-02-28 22:48 UTC (permalink / raw)
  To: teigland; +Cc: stable, gfs2, aahringo

If an inactive rsb is not hashed anymore and this could occur because we
releases and acquired locks we need to signal the followed code that the
lookup failed. Since the lookup was successful, but it isn't part of the
rsb hash anymore we need to signal it by setting error to -EBADR as
dlm_search_rsb_tree() does it.

Cc: stable@vger.kernel.org
Fixes: 01fdeca1cc2d ("dlm: use rcu to avoid an extra rsb struct lookup")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
 fs/dlm/lock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index c8ff88f1cdcf..499fa999ae83 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -784,6 +784,7 @@ static int find_rsb_dir(struct dlm_ls *ls, const void *name, int len,
 		}
 	} else {
 		write_unlock_bh(&ls->ls_rsbtbl_lock);
+		error = -EBADR;
 		goto do_new;
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH dlm/next 2/2] dlm: fix error if active rsb is not hashed
  2025-02-28 22:48 [PATCH dlm/next 1/2] dlm: fix error if inactive rsb is not hashed Alexander Aring
@ 2025-02-28 22:48 ` Alexander Aring
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Aring @ 2025-02-28 22:48 UTC (permalink / raw)
  To: teigland; +Cc: stable, gfs2, aahringo

If an active rsb is not hashed anymore and this could occur because we
releases and acquired locks we need to signal the followed code that
the lookup failed. Since the lookup was successful, but it isn't part of
the rsb hash anymore we need to signal it by setting error to -EBADR as
dlm_search_rsb_tree() does it.

Cc: stable@vger.kernel.org
Fixes: 5be323b0c64d ("dlm: move dlm_search_rsb_tree() out of lock")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
 fs/dlm/lock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 499fa999ae83..e01d5f29f4d2 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -741,6 +741,7 @@ static int find_rsb_dir(struct dlm_ls *ls, const void *name, int len,
 	read_lock_bh(&ls->ls_rsbtbl_lock);
 	if (!rsb_flag(r, RSB_HASHED)) {
 		read_unlock_bh(&ls->ls_rsbtbl_lock);
+		error = -EBADR;
 		goto do_new;
 	}
 	
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-28 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 22:48 [PATCH dlm/next 1/2] dlm: fix error if inactive rsb is not hashed Alexander Aring
2025-02-28 22:48 ` [PATCH dlm/next 2/2] dlm: fix error if active " Alexander Aring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox