From: Andreas Gruenbacher Date: Tue, 28 Oct 2025 21:38:54 +0000 (+0000) Subject: gfs2: No longer thaw filesystems during a withdraw X-Git-Url: https://gentwo.org/gitweb/?a=commitdiff_plain;h=16c31979840399e6e5542f861c6fb18f9086f3c9;p=linux%2F.git gfs2: No longer thaw filesystems during a withdraw 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 --- diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 0c398866dbb4..f6cd907b3ec6 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -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 diff --git a/fs/gfs2/super.h b/fs/gfs2/super.h index b27a774d9580..173f1e74c2a9 100644 --- a/fs/gfs2/super.h +++ b/fs/gfs2/super.h @@ -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, diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c index ff63070ed6de..b8ce04338b24 100644 --- a/fs/gfs2/util.c +++ b/fs/gfs2/util.c @@ -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, ...)