Skip to contentSkip to conversation

gfs2: don't try to lockfs after shutdown

PATCH In review David Teigland 2 participants 2 messages Dec 6, 2006 – Dec 8, 2006 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2: don't try to lockfs after shutdown

If an fs has already been shut down, a lockfs callback should do nothing. An fs that's been shut down can't acquire locks or do anything with respect to the cluster.

Also, remove FIXME comment in withdraw function. The missing bits of the withdraw procedure are now all done by user space.

fs/gfs2/lm.c +1 -7
Index: linux-2.6.19-quilt/fs/gfs2/lm.c
===================================================================
@@ -104,15 +104,9 @@
 	vprintk(fmt, args);
 	va_end(args);
 
-	fs_err(sdp, "about to withdraw from the cluster\n");
+	fs_err(sdp, "about to withdraw this file system\n");
 	BUG_ON(sdp->sd_args.ar_debug);
 
-
-	fs_err(sdp, "waiting for outstanding I/O\n");
-
-	/* FIXME: suspend dm device so oustanding bio's complete
-	   and all further io requests fail */
-
 	fs_err(sdp, "telling LM to withdraw\n");
 	gfs2_withdraw_lockproto(&sdp->sd_lockstruct);
 	fs_err(sdp, "withdrawn\n");
fs/gfs2/ops_super.c +3 -0
Index: linux-2.6.19-quilt/fs/gfs2/ops_super.c
===================================================================
@@ -172,6 +172,9 @@
 	struct gfs2_sbd *sdp = sb->s_fs_info;
 	int error;
 
+	if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
+		return;
+
 	for (;;) {
 		error = gfs2_freeze_fs(sdp);
 		if (!error)
#1 lore raw

Hi,

This has the honour of being the first patch in the new -nmw tree,

Steve.

Quoted 44 lines · David Teigland

If an fs has already been shut down, a lockfs callback should do nothing. An fs that's been shut down can't acquire locks or do anything with respect to the cluster.

Also, remove FIXME comment in withdraw function. The missing bits of the withdraw procedure are now all done by user space.

Index: linux-2.6.19-quilt/fs/gfs2/lm.c
===================================================================

fs/gfs2/lm.c +1 -7
@@ -104,15 +104,9 @@
 	vprintk(fmt, args);
 	va_end(args);
 
-	fs_err(sdp, "about to withdraw from the cluster\n");
+	fs_err(sdp, "about to withdraw this file system\n");
 	BUG_ON(sdp->sd_args.ar_debug);
 
-
-	fs_err(sdp, "waiting for outstanding I/O\n");
-
-	/* FIXME: suspend dm device so oustanding bio's complete
-	   and all further io requests fail */
-
 	fs_err(sdp, "telling LM to withdraw\n");
 	gfs2_withdraw_lockproto(&sdp->sd_lockstruct);
 	fs_err(sdp, "withdrawn\n");

Index: linux-2.6.19-quilt/fs/gfs2/ops_super.c
===================================================================

fs/gfs2/ops_super.c +3 -0
@@ -172,6 +172,9 @@
 	struct gfs2_sbd *sdp = sb->s_fs_info;
 	int error;
 
+	if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags))
+		return;
+
 	for (;;) {
 		error = gfs2_freeze_fs(sdp);
 		if (!error)