Skip to content

Commit

Permalink
gfs2: fix recovery during unmount
Browse files Browse the repository at this point in the history
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 <teigland@redhat.com>
  • Loading branch information
David Teigland committed May 2, 2012
1 parent 4875647 commit 1a058f5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fs/gfs2/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 1a058f5

Please sign in to comment.