All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] DLM: Do not count redundant connection attempts against retries
Date: Thu, 20 Apr 2017 15:33:38 -0500	[thread overview]
Message-ID: <20170420203338.GA525@redhat.com> (raw)
In-Reply-To: <483789947.17531984.1492718540635.JavaMail.zimbra@redhat.com>

On Thu, Apr 20, 2017 at 04:02:20PM -0400, Bob Peterson wrote:
> Hi,
> 
> Before this patch, multiple GFS2 mounts would result in multiple
> connection attempts. They were all ignored, and rightly so, but
> they were being counted against the connection attempt retries.
> This patch moves the retry check later those redundant attempts
> are simply ignored, as they should be.

Each mount/dlm_new_lockspace() calls dlm_lowcomm_connect_node() to
establish connections to other nodes in the lockspace.  If a connection to
a node already exists, nothing is needed, but it seems strange this isn't
checked earlier, e.g. in dlm_lowcomms_connect_node() or
lowcomms_connect_sock().  Maybe concurrent closes or connects require
checking things in tcp_connect_to_sock()?

Dave

> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> ---
> diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
> index 7d398d3..42c8457 100644
> --- a/fs/dlm/lowcomms.c
> +++ b/fs/dlm/lowcomms.c
> @@ -1123,13 +1123,13 @@ static void tcp_connect_to_sock(struct connection *con)
>  	}
>  
>  	mutex_lock(&con->sock_mutex);
> -	if (con->retries++ > MAX_CONNECT_RETRIES)
> -		goto out;
> -
>  	/* Some odd races can cause double-connects, ignore them */
>  	if (con->sock)
>  		goto out;
>  
> +	if (con->retries++ > MAX_CONNECT_RETRIES)
> +		goto out;
> +
>  	/* Create a socket to communicate with */
>  	result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family,
>  				  SOCK_STREAM, IPPROTO_TCP, &sock);



  reply	other threads:[~2017-04-20 20:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 20:02 [Cluster-devel] DLM: Do not count redundant connection attempts against retries Bob Peterson
2017-04-20 20:33 ` David Teigland [this message]
2017-04-24 12:37   ` Bob Peterson
2017-04-24 13:52     ` Christine Caulfield

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=20170420203338.GA525@redhat.com \
    --to=teigland@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.