Patch "gfs2: Fix another freeze/thaw hang" has been added to the 6.5-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 another freeze/thaw hang

to the 6.5-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-another-freeze-thaw-hang.patch
and it can be found in the queue-6.5 subdirectory.

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



commit 14be3766c9ec51e659d23a762306b09c5223ea89
Author: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Date:   Mon Sep 11 20:00:28 2023 +0200

    gfs2: Fix another freeze/thaw hang
    
    [ Upstream commit 52954b750958dcab9e44935f0c32643279091c85 ]
    
    On a thawed filesystem, the freeze glock is held in shared mode.  In
    order to initiate a cluster-wide freeze, the node initiating the freeze
    drops the freeze glock and grabs it in exclusive mode.  The other nodes
    recognize this as contention on the freeze glock; function
    freeze_go_callback is invoked.  This indicates to them that they must
    freeze the filesystem locally, drop the freeze glock, and then
    re-acquire it in shared mode before being able to unfreeze the
    filesystem locally.
    
    While a node is trying to re-acquire the freeze glock in shared mode,
    additional contention can occur.  In that case, the node must behave in
    the same way as above.
    
    Unfortunately, freeze_go_callback() contains a check that causes it to
    bail out when the freeze glock isn't held in shared mode.  Fix that to
    allow the glock to be unlocked or held in shared mode.
    
    In addition, update a reference to trylock_super() which has been
    renamed to super_trylock_shared() in the meantime.
    
    Fixes: b77b4a4815a9 ("gfs2: Rework freeze / thaw logic")
    Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 54319328b16b5..0a3b069386ec9 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -567,15 +567,16 @@ static void freeze_go_callback(struct gfs2_glock *gl, bool remote)
 	struct super_block *sb = sdp->sd_vfs;
 
 	if (!remote ||
-	    gl->gl_state != LM_ST_SHARED ||
+	    (gl->gl_state != LM_ST_SHARED &&
+	     gl->gl_state != LM_ST_UNLOCKED) ||
 	    gl->gl_demote_state != LM_ST_UNLOCKED)
 		return;
 
 	/*
 	 * Try to get an active super block reference to prevent racing with
-	 * unmount (see trylock_super()).  But note that unmount isn't the only
-	 * place where a write lock on s_umount is taken, and we can fail here
-	 * because of things like remount as well.
+	 * unmount (see super_trylock_shared()).  But note that unmount isn't
+	 * the only place where a write lock on s_umount is taken, and we can
+	 * fail here because of things like remount as well.
 	 */
 	if (down_read_trylock(&sb->s_umount)) {
 		atomic_inc(&sb->s_active);



[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