Re: [PATCH][SMB3] fix multiuser mount regression

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

 



On Thu, Mar 17, 2022 at 1:20 PM Steve French <smfrench@xxxxxxxxx> wrote:
>
> cifssmb3: fix incorrect session setup check for multiuser mounts

If it fixes multiuser then Acked-by me.
We are so close to rc8 that we can not do intrusive changes,   so if
it fixes it short term.
For longer term, post rc8 we need to rewrite the statemaching completely
and separate out "what happens in server->tcpStatus" as one statemachine and
"what happens in server->status" as a separate one. Right now it is a mess.


>
> A recent change to how the SMB3 server (socket) and session status
> is managed regressed multiuser mounts by changing the check
> for whether session setup is needed to the socket (TCP_Server_info)
> structure instead of the session struct (cifs_ses). Add additional
> check in cifs_setup_sesion to fix this.
>
> Fixes: 73f9bfbe3d81 ("cifs: maintain a state machine for tcp/smb/tcon sessions")
> Reported-by: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
> ---
>  fs/cifs/connect.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 053cb449eb16..d3020abfe404 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -3924,7 +3924,8 @@ cifs_setup_session(const unsigned int xid,
> struct cifs_ses *ses,
>
>   /* only send once per connect */
>   spin_lock(&cifs_tcp_ses_lock);
> - if (server->tcpStatus != CifsNeedSessSetup) {
> + if ((server->tcpStatus != CifsNeedSessSetup) &&
> +     (ses->status == CifsGood)) {
>   spin_unlock(&cifs_tcp_ses_lock);
>   return 0;
>   }
>
> --
> Thanks,
>
> Steve



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

  Powered by Linux