linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: Ronnie Sahlberg <lsahlber@redhat.com>
Cc: linux-cifs <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH] cifs: fail i/o on soft mounts if sessionsetup errors out
Date: Wed, 5 Feb 2020 03:45:11 -0600	[thread overview]
Message-ID: <CAH2r5mt+d_NTaA40-4nKRSdr3qXdtLjhPPLos99azYyK8hde5g@mail.gmail.com> (raw)
In-Reply-To: <20200205010801.27759-1-lsahlber@redhat.com>

Added cc:stable and merged into cifs-2.6.git for-next

On Tue, Feb 4, 2020 at 7:08 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> RHBZ: 1579050
>
> If we have a soft mount we should fail commands for session-setup
> failures (such as the password having changed/ account being deleted/ ...)
> and return an error back to the application.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/smb2pdu.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 14f209f7376f..7996d81230aa 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -350,9 +350,14 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
>         }
>
>         rc = cifs_negotiate_protocol(0, tcon->ses);
> -       if (!rc && tcon->ses->need_reconnect)
> +       if (!rc && tcon->ses->need_reconnect) {
>                 rc = cifs_setup_session(0, tcon->ses, nls_codepage);
> -
> +               if ((rc == -EACCES) && !tcon->retry) {
> +                       rc = -EHOSTDOWN;
> +                       mutex_unlock(&tcon->ses->session_mutex);
> +                       goto failed;
> +               }
> +       }
>         if (rc || !tcon->need_reconnect) {
>                 mutex_unlock(&tcon->ses->session_mutex);
>                 goto out;
> @@ -397,6 +402,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
>         case SMB2_SET_INFO:
>                 rc = -EAGAIN;
>         }
> +failed:
>         unload_nls(nls_codepage);
>         return rc;
>  }
> --
> 2.13.6
>


-- 
Thanks,

Steve

  reply	other threads:[~2020-02-05  9:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  1:08 [PATCH] cifs: fail i/o on soft mounts if sessionsetup errors out Ronnie Sahlberg
2020-02-05  9:45 ` Steve French [this message]
2020-02-06  7:47   ` Aurélien Aptel
  -- strict thread matches above, loose matches on Subject: below --
2020-02-05  0:05 Ronnie Sahlberg

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=CAH2r5mt+d_NTaA40-4nKRSdr3qXdtLjhPPLos99azYyK8hde5g@mail.gmail.com \
    --to=smfrench@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=lsahlber@redhat.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).