mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
cifs: fail i/o on soft mounts if sessionsetup errors out
commit b0dd940e582b6a60296b9847a54012a4b080dc72 upstream. 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> Signed-off-by: Steve French <stfrench@microsoft.com> CC: Stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9a473fc4c8
commit
640d7fb2d2
@ -257,9 +257,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;
|
||||
@ -301,6 +306,7 @@ out:
|
||||
case SMB2_SET_INFO:
|
||||
rc = -EAGAIN;
|
||||
}
|
||||
failed:
|
||||
unload_nls(nls_codepage);
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user