Skip to content

Commit 0cdc6f4

Browse files
author
Andreas Gruenbacher
committed
gfs2: don't withdraw if init_threads() got interrupted
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 62dd0f9 ("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 b77b4a4 ("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 <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Cc: [email protected] # v6.5+
1 parent bb25b97 commit 0cdc6f4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/gfs2/ops_fstype.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,10 +1279,8 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)
12791279

12801280
if (!sb_rdonly(sb)) {
12811281
error = init_threads(sdp);
1282-
if (error) {
1283-
gfs2_withdraw_delayed(sdp);
1282+
if (error)
12841283
goto fail_per_node;
1285-
}
12861284
}
12871285

12881286
error = gfs2_freeze_lock_shared(sdp);

0 commit comments

Comments
 (0)