cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Skip taking journal recovery locks for spectators
Date: Thu, 21 Jun 2018 18:05:45 -0400 (EDT)	[thread overview]
Message-ID: <602032757.44805751.1529618745642.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <2061107895.44805743.1529618725855.JavaMail.zimbra@redhat.com>

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 <rpeterso@redhat.com>
---
 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.



       reply	other threads:[~2018-06-21 22:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2061107895.44805743.1529618725855.JavaMail.zimbra@redhat.com>
2018-06-21 22:05 ` Bob Peterson [this message]
2018-06-22 20:03   ` [Cluster-devel] [GFS2 PATCH] GFS2: Skip taking journal recovery locks for spectators Andreas Gruenbacher
2018-06-24 12:49     ` Bob Peterson
2018-06-25 13:48       ` Steven Whitehouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=602032757.44805751.1529618745642.JavaMail.zimbra@redhat.com \
    --to=rpeterso@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).