[PATCH 1/3] cifs: do not share tcons with DFS

ronnie sahlberg ronniesahlberg at gmail.com
Tue Apr 21 10:48:33 UTC 2020


series looks good after initial review

Reviewed-by: Ronnie Sahlberg <lsahlber at redhat.com>


On Tue, Apr 21, 2020 at 12:45 PM Paulo Alcantara <pc at cjr.nz> wrote:
>
> This disables tcon re-use for DFS shares.
>
> tcon->dfs_path stores the path that the tcon should connect to when
> doing failing over.
>
> If that tcon is used multiple times e.g. 2 mounts using it with
> different prefixpath, each will need a different dfs_path but there is
> only one tcon. The other solution would be to split the tcon in 2
> tcons during failover but that is much harder.
>
> Signed-off-by: Paulo Alcantara (SUSE) <pc at cjr.nz>
> Reviewed-by: Aurelien Aptel <aaptel at suse.com>
> ---
>  fs/cifs/connect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 95b3ab0ca8c0..ac6d286fe79f 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -3373,7 +3373,7 @@ cifs_find_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
>         spin_lock(&cifs_tcp_ses_lock);
>         list_for_each(tmp, &ses->tcon_list) {
>                 tcon = list_entry(tmp, struct cifs_tcon, tcon_list);
> -               if (!match_tcon(tcon, volume_info))
> +               if (!match_tcon(tcon, volume_info) || tcon->dfs_path)
>                         continue;
>                 ++tcon->tc_count;
>                 spin_unlock(&cifs_tcp_ses_lock);
> --
> 2.26.0
>



More information about the samba-technical mailing list