]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dlm: fix error if inactive rsb is not hashed
authorAlexander Aring <aahringo@redhat.com>
Fri, 28 Feb 2025 22:48:50 +0000 (17:48 -0500)
committerDavid Teigland <teigland@redhat.com>
Sat, 1 Mar 2025 00:24:21 +0000 (19:24 -0500)
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>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lock.c

index c8ff88f1cdcf2c87859ba00c7045c6c7e57ee5a7..499fa999ae830978873a137a63b536cb3fc856f3 100644 (file)
@@ -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;
        }