summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2018-10-19 08:45:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-22 09:32:44 +0300
commita1f82fd7bcec3ad32265fe296bfde4a7fa824507 (patch)
treef346d993b76f99900d4aebf1923d7159796d3b5e /fs/cifs
parentef61a0bdb01ec8b3515fdb7fee4807d1feb950ad (diff)
downloadlinux-a1f82fd7bcec3ad32265fe296bfde4a7fa824507.tar.xz
smb3: do not attempt cifs operation in smb3 query info error path
commit 1e77a8c204c9d1b655c61751b8ad0fde22421dbb upstream. If backupuid mount option is sent, we can incorrectly retry (on access denied on query info) with a cifs (FindFirst) operation on an smb3 mount which causes the server to force the session close. We set backup intent on open so no need for this fallback. See kernel bugzilla 201435 Signed-off-by: Steve French <stfrench@microsoft.com> CC: Stable <stable@vger.kernel.org> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/inode.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index ff226cc6d391..e603a3a28bae 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -741,7 +741,15 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
} else if (rc == -EREMOTE) {
cifs_create_dfs_fattr(&fattr, sb);
rc = 0;
- } else if (rc == -EACCES && backup_cred(cifs_sb)) {
+ } else if ((rc == -EACCES) && backup_cred(cifs_sb) &&
+ (strcmp(server->vals->version_string, SMB1_VERSION_STRING)
+ == 0)) {
+ /*
+ * For SMB2 and later the backup intent flag is already
+ * sent if needed on open and there is no path based
+ * FindFirst operation to use to retry with
+ */
+
srchinf = kzalloc(sizeof(struct cifs_search_info),
GFP_KERNEL);
if (srchinf == NULL) {