Skip to contentSkip to conversation

gfs2: fix recovery during unmount

PATCH New David Teigland 1 participant 1 message May 21, 2012 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 7/8 gfs2: fix recovery during unmount

Journal recovery from lock_dlm should not be ignored if there is an unmount in progress. Ignoring it will causes the recovery to get stuck. The recovery process will correctly handle an in-progess unmount.

---
 fs/gfs2/sys.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
fs/gfs2/sys.c +6 -4
index d33172c..9c2592b 100644
@@ -368,10 +368,7 @@ int gfs2_recover_set(struct gfs2_sbd *sdp, unsigned jid)
 	struct gfs2_jdesc *jd;
 	int rv;
 
-	rv = -ESHUTDOWN;
 	spin_lock(&sdp->sd_jindex_spin);
-	if (test_bit(SDF_NORECOVERY, &sdp->sd_flags))
-		goto out;
 	rv = -EBUSY;
 	if (sdp->sd_jdesc->jd_jid == jid)
 		goto out;
@@ -396,8 +393,13 @@ static ssize_t recover_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
 	if (rv != 1)
 		return -EINVAL;
 
-	rv = gfs2_recover_set(sdp, jid);
+	if (test_bit(SDF_NORECOVERY, &sdp->sd_flags)) {
+		rv = -ESHUTDOWN;
+		goto out;
+	}
 
+	rv = gfs2_recover_set(sdp, jid);
+out:
 	return rv ? rv : len;
 }
 
Signature · 1 line
1.7.10.1.362.g242cab3