From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Thu, 21 Jun 2018 18:05:45 -0400 (EDT) Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Skip taking journal recovery locks for spectators In-Reply-To: <2061107895.44805743.1529618725855.JavaMail.zimbra@redhat.com> Message-ID: <602032757.44805751.1529618745642.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Before this patch, spectator mounts would try to acquire the dlm's control lock and mounted lock as part of its normal recovery sequence. It's not necessary because spectators don't ever do journal recovery. And if they acquire those locks (at all) it will prevent another first-mounter from acquiring the lock in EX mode, which means it also cannot do journal recovery because it doesn't think it's the first node to mount the file system. This patch checks if the mounter is a spectator, and if so, avoids grabbing the control lock and mounted lock. This allows a secondary mounter who is really the first rw mounter, to do journal recovery: since the spectator doesn't acquire those locks, it can grab them in EX mode, and therefore consider itself to be the first mounter. Signed-off-by: Bob Peterson --- fs/gfs2/lock_dlm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index 006c6164f759..59c7f2e8f077 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c @@ -807,6 +807,8 @@ static int control_mount(struct gfs2_sbd *sdp) msleep_interruptible(500); + if (sdp->sd_args.ar_spectator) + goto locks_done; /* * Acquire control_lock in EX and mounted_lock in either EX or PR. * control_lock lvb keeps track of any pending journal recoveries.