linux-stable/fs/gfs2
Andreas Gruenbacher c7e9a84826 gfs2: don't withdraw if init_threads() got interrupted
commit 0cdc6f44e9 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 62dd0f98a0 ("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 b77b4a4815 ("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@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Cc: stable@vger.kernel.org # v6.5+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:20:11 +00:00
..
acl.c gfs2: convert to ctime accessor functions 2023-07-24 10:29:59 +02:00
acl.h fs: port ->set_acl() to pass mnt_idmap 2023-01-19 09:24:27 +01:00
aops.c gfs2 fixes 2023-09-05 13:00:28 -07:00
aops.h gfs2: support ludicrously large folios in gfs2_trans_add_databufs() 2023-06-19 16:19:30 -07:00
bmap.c gfs2 fixes 2023-09-05 13:00:28 -07:00
bmap.h gfs2: Eliminate gfs2_trim_blocks 2023-04-18 14:40:12 +02:00
dentry.c Reinstate "GFS2: free disk inode which is deleted by remote node -V2" 2023-03-23 19:37:56 +01:00
dir.c gfs2: convert to ctime accessor functions 2023-07-24 10:29:59 +02:00
dir.h
export.c Change calling conventions for filldir_t 2022-08-17 17:25:04 -04:00
file.c dlm for 6.6 2023-08-31 15:02:12 -07:00
gfs2.h
glock.c gfs2: fix glock shrinker ref issues 2023-09-18 16:00:50 +02:00
glock.h gfs2: Remove LM_FLAG_PRIORITY flag 2023-09-05 15:58:16 +02:00
glops.c gfs2: Fix another freeze/thaw hang 2023-09-18 16:00:49 +02:00
glops.h gfs2: Split up gfs2_meta_sync into inode and rgrp versions 2020-10-29 22:16:46 +01:00
incore.h gfs2: change qd_slot_count to qd_slot_ref 2023-09-05 15:58:18 +02:00
inode.c gfs2: Silence "suspicious RCU usage in gfs2_permission" warning 2023-11-28 17:19:49 +00:00
inode.h fs: port ->permission() to pass mnt_idmap 2023-01-19 09:24:28 +01:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
lock_dlm.c gfs2: Remove LM_FLAG_PRIORITY flag 2023-09-05 15:58:16 +02:00
log.c gfs2: Sanitize kthread stopping 2023-09-05 15:58:17 +02:00
log.h fs/gfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:32 -06:00
lops.c gfs2: Use mapping->gfp_mask for metadata inodes 2023-09-05 15:58:15 +02:00
lops.h fs/gfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:32 -06:00
main.c gfs2: Rename "freeze_workqueue" to "gfs2_freeze" 2023-09-05 15:58:17 +02:00
Makefile
meta_io.c gfs2: replace obvious uses of b_page with b_folio 2023-01-18 17:12:40 -08:00
meta_io.h gfs2: Use container_of() for gfs2_glock(aspace) 2022-05-24 21:29:14 +02:00
ops_fstype.c gfs2: don't withdraw if init_threads() got interrupted 2023-11-28 17:20:11 +00:00
quota.c gfs2: ignore negated quota changes 2023-11-28 17:19:46 +00:00
quota.h gfs2: Fix quota=quiet oversight 2023-09-18 16:26:24 +02:00
recovery.c gfs2: Rename "gfs_recovery" workqueue to "gfs2_recovery" 2023-09-05 15:58:17 +02:00
recovery.h gfs2: Rename "gfs_recovery" workqueue to "gfs2_recovery" 2023-09-05 15:58:17 +02:00
rgrp.c gfs2: Update rl_unlinked before releasing rgrp lock 2023-06-06 18:35:06 +02:00
rgrp.h Merge part of branch 'for-next.instantiate' into for-next 2022-08-05 18:37:03 +02:00
super.c gfs2: Fix slab-use-after-free in gfs2_qd_dealloc 2023-11-28 17:19:47 +00:00
super.h gfs2: Fix asynchronous thread destruction 2023-09-05 15:58:17 +02:00
sys.c gfs2 fixes 2023-09-05 13:00:28 -07:00
sys.h
trace_gfs2.h gfs2: Remove 'first' trace_gfs2_promote argument 2021-10-25 08:42:19 +02:00
trans.c gfs2: Fix freeze consistency check in gfs2_trans_add_meta 2023-08-07 18:40:51 +02:00
trans.h Merge branches 'rgrp-glock-sharing' and 'gfs2-revoke' from https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git 2021-02-23 18:54:22 +01:00
util.c gfs2: Fix withdraw race 2023-09-05 15:58:17 +02:00
util.h gfs2: gfs2_freeze_lock_shared cleanup 2023-07-03 22:30:26 +02:00
xattr.c gfs2: convert to ctime accessor functions 2023-07-24 10:29:59 +02:00
xattr.h