From: David Teigland Date: Tue, 1 May 2012 20:50:48 +0000 (-0500) Subject: gfs2: fix recovery during unmount X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1a058f5288a74a20d5567a85ab1a04a9de69a212;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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. Signed-off-by: David Teigland --- diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index d33172c291ba..9c2592b1d5ff 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c @@ -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; }