Re: [PATCH 2/2] cifs: force new session setup and tcon for dfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 1, 2022 at 12:42 AM Paulo Alcantara <pc@xxxxxx> wrote:
>
> Do not reuse existing sessions and tcons in DFS failover as it might
> connect to different servers and shares.
>
> Signed-off-by: Paulo Alcantara (SUSE) <pc@xxxxxx>
> ---
>  fs/cifs/connect.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 3ca06bd88b6e..3956672a11ae 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -536,8 +536,11 @@ int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session)
>                 return __cifs_reconnect(server, mark_smb_session);
>         }
>         spin_unlock(&cifs_tcp_ses_lock);
> -
> -       return reconnect_dfs_server(server, mark_smb_session);
> +       /*
> +        * Ignore @mark_smb_session and invalidate all sessions & tcons as we might be connecting to
> +        * a different server or share during failover.
> +        */
> +       return reconnect_dfs_server(server, true);
>  }
>  #else
>  int cifs_reconnect(struct TCP_Server_Info *server, bool mark_smb_session)
> --
> 2.35.1
>
This makes sense.
Wondering if you could check if the reconnect happens to a new
server/share and then change mark_smb_session? Maybe that complicates
the logic.

Looks good to me.
Reviewed-by: Shyam Prasad N <sprasad@xxxxxxxxxxxxx>

-- 
Regards,
Shyam



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux