]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dlm: fix error if active rsb is not hashed
authorAlexander Aring <aahringo@redhat.com>
Fri, 28 Feb 2025 22:48:51 +0000 (17:48 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:18:20 +0000 (10:18 +0200)
commit a3672304abf2a847ac0c54c84842c64c5bfba279 upstream.

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>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/dlm/lock.c

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