From e8ca5cc571a60339491f8c273a01093096ff8704 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Mon, 9 Jan 2012 14:40:06 -0500 Subject: GFS2: let spectator mount do read only recovery Previously, a spectator mount would not even attempt to do journal recovery for a failed node. This meant that if all mounted nodes were spectators, everyone would be stuck after a node failed, all waiting for recovery to be performed. This is unnecessary since the failed node had a clean journal. Instead, allow a spectator mount to do a partial "read only" recovery, which means it will check if the failed journal is clean, and if so, report a successful recovery. If the failed journal is not clean, it reports that journal recovery failed. This makes it work the same as a read only mount on a read only block device. Signed-off-by: David Teigland Signed-off-by: Steven Whitehouse --- fs/gfs2/recovery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/gfs2/recovery.c') diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index af49e8f432fe..80701d1566a1 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c @@ -516,7 +516,9 @@ void gfs2_recover_func(struct work_struct *work) if (error) goto fail_gunlock_ji; - if (test_bit(SDF_JOURNAL_CHECKED, &sdp->sd_flags)) { + if (test_bit(SDF_RORECOVERY, &sdp->sd_flags)) { + ro = 1; + } else if (test_bit(SDF_JOURNAL_CHECKED, &sdp->sd_flags)) { if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) ro = 1; } else { -- cgit v1.2.3