gfs2: don't withdraw if init_threads() got interrupted
PATCH 1/1 gfs2: don't withdraw if init_threads() got interrupted
When interrupting a gfs2 mount process by e.g. SIGKILL it could be that kthread_create() returns -EINTR. If this happens we see on the kernel log:
[55942.843273] gfs2: fsid=gohan:gohan0.2: can't create logd thread: -4 [56186.441647] gfs2: fsid=gohan:gohan0: Trying to join cluster
"lock_dlm", "gohan:gohan0"
The issue is that we can never mount it again because gfs2 does not cleanup the lockspace and it returns -EEXIST without mounting anything:
[56186.443041] gfs2: fsid=gohan:gohan0: dlm_new_lockspace error -17
The issue is (so far I see on the code) that init_threads() can returns -4 (-EINTR) what we see above and then calls gfs2_withdraw_delayed(). This will set the SDF_WITHDRAWING and gfs2_lm_unmount() will then not call unmount and will never release the lockspace.
This patch just don't call gfs2_withdraw_delayed() if init_threads() returns -EINTR.
--- fs/gfs2/ops_fstype.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/gfs2/ops_fstype.c +7 -1
@@ -1281,7 +1281,13 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)if (!sb_rdonly (sb)) { error =init_threads (sdp); -if (error) { +if (error == -EINTR ) { +/* no setting of SDF_WITHDRAWING when +* kthread_create() returns -EINTR to +* allow lockspace getting released. +*/ + goto fail_per_node; + }else if (error) {gfs2_withdraw_delayed (sdp); goto fail_per_node; }
Signature · 1 line
2.39.3
Andreas Gruenbacher
maintainerAlex,
Quoted 2 lines · Alexander Aring
This patch just don't call
gfs2_withdraw_delayed()ifinit_threads()returns-EINTR.
that's close, but calling gfs2_withdraw_delayed() actually never makes sense in this context. I'll follow up with a patch that describes why.
Thanks,
Andreas