Message ID | 20200421024424.3112-1-pc@cjr.nz (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/3] cifs: do not share tcons with DFS | expand |
series looks good after initial review Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> On Tue, Apr 21, 2020 at 12:45 PM Paulo Alcantara <pc@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@cjr.nz> > Reviewed-by: Aurelien Aptel <aaptel@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 >
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);