linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@cjr.nz>
To: "Aurélien Aptel" <aaptel@suse.com>,
	linux-cifs@vger.kernel.org, smfrench@gmail.com
Subject: Re: [PATCH] cifs: include regular shares to the list of unshared tcp servers
Date: Mon, 05 Jul 2021 11:37:55 -0300	[thread overview]
Message-ID: <87a6n0967w.fsf@cjr.nz> (raw)
In-Reply-To: <87im1powxn.fsf@suse.com>

Aurélien Aptel <aaptel@suse.com> writes:

> Paulo Alcantara <pc@cjr.nz> writes:
>> We need to make regular shares to also not share tcp servers because
>> we might have both regular and dfs mounts connecting to same server.
>
> So with this change we never reuse tcp connections, and nosharesock
> because the default mount option for all cases. We might as well remove
> all the code for searching/matching/reusing tcp connection, smb session,
> tree connects.

Sounds like a good idea, yes.  Of course, if we really want to do this
regardless CONFIG_CIFS_DFS_UPCALL, it would probably be better off doing
it in a separate series.

> That doesn't seem good. If dfs connections are made with the nosharesock
> flag they should not be reused already no?

The previous version only made sure to not share tcp servers among DFS
shares, however, we must do it for all shares when we have
CONFIG_CIFS_DFS_UPCALL option enabled.

Without this change, the following would occur:

mount //dfsroot/dfs (new tcp)
mount //dfsroot/share (reuse tcp because


	rc = mount_get_conns(ctx, cifs_sb, &xid, &server, &ses, &tcon);
	/*
	 * If called with 'nodfs' mount option, then skip DFS resolving.  Otherwise unconditionally
	 * try to get an DFS referral (even cached) to determine whether it is an DFS mount.
	 *
	 * Skip prefix path to provide support for DFS referrals from w2k8 servers which don't seem
	 * to respond with PATH_NOT_COVERED to requests that include the prefix.
	 */
	if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS) ||
	    dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), ctx->UNC + 1, NULL,
			   NULL)) {
		if (rc)
			goto error;
		/* Check if it is fully accessible and then mount it */
		rc = is_path_remote(cifs_sb, ctx, xid, server, tcon);
		if (!rc)
			goto out;
		if (rc != -EREMOTE)
			goto error;
	}

would get executed in cifs_mount() and we only set nosharesock after that)

With this patch:

mount //dfsroot/dfs (new tcp)
mount //dfsroot/share (new tcp)

      reply	other threads:[~2021-07-05 14:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 17:17 [PATCH] cifs: include regular shares to the list of unshared tcp servers Paulo Alcantara
2021-07-05 10:51 ` Aurélien Aptel
2021-07-05 14:37   ` Paulo Alcantara [this message]

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=87a6n0967w.fsf@cjr.nz \
    --to=pc@cjr.nz \
    --cc=aaptel@suse.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.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).