Set unicode flag on cifs echo request to avoid Mac error
authorSteve French <smfrench@gmail.com>
Tue, 2 May 2017 18:35:20 +0000 (13:35 -0500)
committerSteve French <smfrench@gmail.com>
Tue, 2 May 2017 19:57:34 +0000 (14:57 -0500)
Mac requires the unicode flag to be set for cifs, even for the smb
echo request (which doesn't have strings).

Without this Mac rejects the periodic echo requests (when mounting
with cifs) that we use to check if server is down

Signed-off-by: Steve French <smfrench@gmail.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/cifssmb.c

index 5d21f00ae341b4ec002eb33dd79c7a16a1e1dfa4..205fd94f52fdf48361b800c3b29ebba6c00fe49b 100644 (file)
@@ -718,6 +718,9 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
        if (rc)
                return rc;
 
+       if (server->capabilities & CAP_UNICODE)
+               smb->hdr.Flags2 |= SMBFLG2_UNICODE;
+
        /* set up echo request */
        smb->hdr.Tid = 0xffff;
        smb->hdr.WordCount = 1;