]> Gentwo Git Trees - linux/.git/commitdiff
gfs2: No longer thaw filesystems during a withdraw
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 28 Oct 2025 21:38:54 +0000 (21:38 +0000)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 26 Nov 2025 23:52:28 +0000 (23:52 +0000)
Previously, when a withdraw occurred, we would wait for another node to
recover our journal.  This also meant that frozen filesystem needed to
be thawed because otherwise, other nodes wouldn't be able to recover the
filesystem.  With the reversal of commit 601ef0d52e96 ("gfs2: Force
withdraw to replay journals and wait for it to finish"), we are no
longer waiting for journal recovery during a withdraw, so we no longer
need to thaw frozen filesystems, either.  This also fixes a potential
deadlock reported by lockdep when running xfstest generic/108.

In addition, there is nothing left in do_withdraw() that would require
taking sd_freeze_mutex, so don't bother taking that lock there anymore.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/super.c
fs/gfs2/super.h
fs/gfs2/util.c

index 0c398866dbb4380d83b13d7a837a6bae7368c3a6..f6cd907b3ec6c46b780357cc7d7af2ac7e11f9d0 100644 (file)
@@ -817,20 +817,6 @@ static int gfs2_thaw_super(struct super_block *sb, enum freeze_holder who,
        return error;
 }
 
-void gfs2_thaw_freeze_initiator(struct super_block *sb)
-{
-       struct gfs2_sbd *sdp = sb->s_fs_info;
-
-       mutex_lock(&sdp->sd_freeze_mutex);
-       if (!test_bit(SDF_FREEZE_INITIATOR, &sdp->sd_flags))
-               goto out;
-
-       gfs2_freeze_unlock(sdp);
-
-out:
-       mutex_unlock(&sdp->sd_freeze_mutex);
-}
-
 /**
  * statfs_slow_fill - fill in the sg for a given RG
  * @rgd: the RG
index b27a774d95808e318f8f772387b833d547364805..173f1e74c2a96c79997fb9abeba4a8f2608ee8fc 100644 (file)
@@ -47,7 +47,6 @@ void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc,
 void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh);
 int gfs2_statfs_sync(struct super_block *sb, int type);
 void gfs2_freeze_func(struct work_struct *work);
-void gfs2_thaw_freeze_initiator(struct super_block *sb);
 
 void free_local_statfs_inodes(struct gfs2_sbd *sdp);
 struct inode *find_local_statfs_inode(struct gfs2_sbd *sdp,
index ff63070ed6dee5bd2149b17f5068683126b1c991..b8ce04338b24a4fdad797d903979e97290113894 100644 (file)
@@ -131,8 +131,6 @@ static void do_withdraw(struct gfs2_sbd *sdp)
         */
        clear_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
        if (!sb_rdonly(sdp->sd_vfs)) {
-               bool locked = mutex_trylock(&sdp->sd_freeze_mutex);
-
                wake_up(&sdp->sd_logd_waitq);
                wake_up(&sdp->sd_quota_wait);
 
@@ -142,17 +140,12 @@ static void do_withdraw(struct gfs2_sbd *sdp)
 
                sdp->sd_vfs->s_flags |= SB_RDONLY;
 
-               if (locked)
-                       mutex_unlock(&sdp->sd_freeze_mutex);
-
                /*
                 * Dequeue any pending non-system glock holders that can no
                 * longer be granted because the file system is withdrawn.
                 */
                gfs2_withdraw_glocks(sdp);
        }
-
-       gfs2_thaw_freeze_initiator(sdp->sd_vfs);
 }
 
 void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...)