From: Andreas Gruenbacher <agruenba@xxxxxxxxxx> commit 0cdc6f44e9fdc2d20d720145bf99a39f611f6d61 upstream. In gfs2_fill_super(), when mounting a gfs2 filesystem is interrupted, kthread_create() can return -EINTR. When that happens, we roll back what has already been done and abort the mount. Since commit 62dd0f98a0e5 ("gfs2: Flag a withdraw if init_threads() fails), we are calling gfs2_withdraw_delayed() in gfs2_fill_super(); first via gfs2_make_fs_rw(), then directly. But gfs2_withdraw_delayed() only marks the filesystem as withdrawing and relies on a caller further up the stack to do the actual withdraw, which doesn't exist in the gfs2_fill_super() case. Because the filesystem is marked as withdrawing / withdrawn, function gfs2_lm_unmount() doesn't release the dlm lockspace, so when we try to mount that filesystem again, we get: gfs2: fsid=gohan:gohan0: Trying to join cluster "lock_dlm", "gohan:gohan0" gfs2: fsid=gohan:gohan0: dlm_new_lockspace error -17 Since commit b77b4a4815a9 ("gfs2: Rework freeze / thaw logic"), the deadlock this gfs2_withdraw_delayed() call was supposed to work around cannot occur anymore because freeze_go_callback() won't take the sb->s_umount semaphore unconditionally anymore, so we can get rid of the gfs2_withdraw_delayed() in gfs2_fill_super() entirely. Reported-by: Alexander Aring <aahringo@xxxxxxxxxx> Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx # v6.5+ Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/gfs2/ops_fstype.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -1259,10 +1259,8 @@ static int gfs2_fill_super(struct super_ if (!sb_rdonly(sb)) { error = init_threads(sdp); - if (error) { - gfs2_withdraw_delayed(sdp); + if (error) goto fail_per_node; - } } error = gfs2_freeze_lock_shared(sdp, &sdp->sd_freeze_gh, 0); Patches currently in stable-queue which might be from agruenba@xxxxxxxxxx are queue-6.1/pid-replace-struct-pid-1-element-array-with-flex-arr.patch queue-6.1/gfs2-remove-freeze_go_demote_ok.patch queue-6.1/gfs2-rename-sdf_-fs_frozen-freeze_initiator.patch queue-6.1/gfs2-setattr_chown-add-missing-initialization.patch queue-6.1/gfs2-remove-lm_flag_priority-flag.patch queue-6.1/gfs2-rename-gfs2_freeze_lock-_shared.patch queue-6.1/gfs2-rework-freeze-thaw-logic.patch queue-6.1/gfs2-stop-using-gfs2_make_fs_ro-for-withdraw.patch queue-6.1/gfs2-don-t-withdraw-if-init_threads-got-interrupted.patch queue-6.1/gfs2-refcounting-fix-in-gfs2_thaw_super.patch queue-6.1/gfs2-rename-remaining-transaction-glock-references.patch queue-6.1/gfs2-fix-another-freeze-thaw-hang.patch queue-6.1/gfs2-rename-the-freeze-thaw-_super-callbacks.patch