Patch "gfs2: Fix "ignore unlock failures after withdraw"" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    gfs2: Fix "ignore unlock failures after withdraw"

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gfs2-fix-ignore-unlock-failures-after-withdraw.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9f45c663a8141e877b41ac630dc2613ff02a5395
Author: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Date:   Fri Apr 5 13:47:51 2024 +0200

    gfs2: Fix "ignore unlock failures after withdraw"
    
    [ Upstream commit 5d9231111966b6c5a65016d58dcbeab91055bc91 ]
    
    Commit 3e11e53041502 tries to suppress dlm_lock() lock conversion errors
    that occur when the lockspace has already been released.
    
    It does that by setting and checking the SDF_SKIP_DLM_UNLOCK flag.  This
    conflicts with the intended meaning of the SDF_SKIP_DLM_UNLOCK flag, so
    check whether the lockspace is still allocated instead.
    
    (Given the current DLM API, checking for this kind of error after the
    fact seems easier that than to make sure that the lockspace is still
    allocated before calling dlm_lock().  Changing the DLM API so that users
    maintain the lockspace references themselves would be an option.)
    
    Fixes: 3e11e53041502 ("GFS2: ignore unlock failures after withdraw")
    Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 34540f9d011ca..385561cd4f4c7 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -802,11 +802,13 @@ __acquires(&gl->gl_lockref.lock)
 	}
 
 	if (sdp->sd_lockstruct.ls_ops->lm_lock)	{
+		struct lm_lockstruct *ls = &sdp->sd_lockstruct;
+
 		/* lock_dlm */
 		ret = sdp->sd_lockstruct.ls_ops->lm_lock(gl, target, lck_flags);
 		if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
 		    target == LM_ST_UNLOCKED &&
-		    test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags)) {
+		    test_bit(DFL_UNMOUNT, &ls->ls_recover_flags)) {
 			finish_xmote(gl, target);
 			gfs2_glock_queue_work(gl, 0);
 		} else if (ret) {
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index f52141ce94853..fc3ecb180ac53 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -350,7 +350,6 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)
 			fs_err(sdp, "telling LM to unmount\n");
 			lm->lm_unmount(sdp);
 		}
-		set_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags);
 		fs_err(sdp, "File system withdrawn\n");
 		dump_stack();
 		clear_bit(SDF_WITHDRAW_IN_PROG, &sdp->sd_flags);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux