From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Pavel Shilovsky
<piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] CIFS: Add match_port check during looking for an existing connection (try #2)
Date: Tue, 16 Nov 2010 13:57:14 -0500 [thread overview]
Message-ID: <20101116135714.358d6b10@corrin.poochiereds.net> (raw)
In-Reply-To: <AANLkTinX6o59YD2EAL4ahJoD1PBLNUCF-MXUss9yhZnd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Tue, 16 Nov 2010 12:47:07 -0600
Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Tue, Nov 16, 2010 at 1:48 AM, Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > If we have a share mounted by non-standard port and try to mount another share
> > on the same host with standard port, we connect to the first share again -
> > that's wrong. This patch fixes this bug.
>
> The description seems a little strange - can you clarify?
>
> If we have an existing session with a server (using whatever port), by
> default we want to use it (unless the user forces a different port
> than the existing connection was made with). If we have a firewall
> issue and therefore go through a non-standard port (port=something on
> mount), we usually wouldn't want to fork a new connection on a second
> connection to the same server.
>
> So if we specify port=5000 on a mount and we already have a mount on
> port 139, it makes sense that we would want to create a new session.
> But if you already have a mount on port 5000, and did a mount with no
> port specified - why wouldn't you use the existing port? It saves
> server, client and network resources.
>
That doesn't match what the manpage says. It says:
port=arg
sets the port number on the server to attempt to contact to
negotiate CIFS support. If the CIFS server is not listening on this
port or if it is not specified, the default ports will be tried
i.e. port 445 is tried and if no response then port 139 is tried.
...which to me says that if you want the new mount to share the socket
already on port 5000, you need to specify port=5000 in the mount
options. The code doesn't do this today, but I think it probably ought
to conform to the above description, or more accurately, with the
manpage update that Pavel proposed.
Now, to be pedantic...the code that Pavel proposed still isn't 100%
compliant with the description. If someone specifies port=139 and the
server is also listening on 445, a second mount with no port= option
will end up using the socket on 139. Still, I think his patches are
good enough here and that corner case really isn't worth sweating over
too much.
--
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
next prev parent reply other threads:[~2010-11-16 18:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-16 7:48 [PATCH 1/2] CIFS: Simplify ipv*_connect functions into one (try #2) Pavel Shilovsky
[not found] ` <1289893710-7352-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-16 7:48 ` [PATCH 2/2] CIFS: Add match_port check during looking for an existing connection " Pavel Shilovsky
[not found] ` <1289893710-7352-2-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-16 18:19 ` Jeff Layton
2010-11-16 18:47 ` Steve French
[not found] ` <AANLkTinX6o59YD2EAL4ahJoD1PBLNUCF-MXUss9yhZnd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-16 18:57 ` Jeff Layton [this message]
[not found] ` <20101116135714.358d6b10-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-11-16 19:02 ` Steve French
[not found] ` <AANLkTimUVphDeWti-mid5jS2g-sF1jDVU7rMuyaPExUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-16 19:21 ` Jeff Layton
2010-11-16 19:22 ` Pavel Shilovsky
2010-11-16 19:29 ` Jeff Layton
2010-11-16 19:13 ` Pavel Shilovsky
2010-11-16 18:17 ` [PATCH 1/2] CIFS: Simplify ipv*_connect functions into one " Jeff Layton
[not found] ` <20101116131755.37043f53-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-11-16 18:25 ` Jeff Layton
[not found] ` <20101116132500.7865f16b-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-11-16 19:28 ` Pavel Shilovsky
2010-11-22 17:01 ` Jeff Layton
[not found] ` <20101122120145.20989d38-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-11-22 19:26 ` Pavel Shilovsky
[not found] ` <AANLkTi=V89tV62iyD+_DeSjwDBBVTfyfHMJ6t1mtBrCD-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-22 19:51 ` Jeff Layton
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=20101116135714.358d6b10@corrin.poochiereds.net \
--to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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