Merge tag '4.14-smb3-xattr-enable' of git://git.samba.org/sfrench/cifs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Sep 2017 23:06:14 +0000 (16:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Sep 2017 23:06:14 +0000 (16:06 -0700)
Pull cifs update from Steve French:
 "Enable xattr support for smb3 and also a bugfix"

* tag '4.14-smb3-xattr-enable' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: Check for timeout on Negotiate stage
  cifs: Add support for writing attributes on SMB2+
  cifs: Add support for reading attributes on SMB2+

1  2 
fs/cifs/cifssmb.c

diff --combined fs/cifs/cifssmb.c
index 118a63e7e221fa54630a6149d3e664d688a805ba,7cbe283159713cb5a2d95390c3407cb02ebdcdc2..35dc5bf01ee2ab96f62a793c466e033bf0659de4
@@@ -178,6 -178,18 +178,18 @@@ cifs_reconnect_tcon(struct cifs_tcon *t
         * reconnect the same SMB session
         */
        mutex_lock(&ses->session_mutex);
+       /*
+        * Recheck after acquire mutex. If another thread is negotiating
+        * and the server never sends an answer the socket will be closed
+        * and tcpStatus set to reconnect.
+        */
+       if (server->tcpStatus == CifsNeedReconnect) {
+               rc = -EHOSTDOWN;
+               mutex_unlock(&ses->session_mutex);
+               goto out;
+       }
        rc = cifs_negotiate_protocol(0, ses);
        if (rc == 0 && ses->need_reconnect)
                rc = cifs_setup_session(0, ses, nls_codepage);
@@@ -2522,7 -2534,7 +2534,7 @@@ CIFSSMBPosixLock(const unsigned int xid
                        pLockData->fl_start = le64_to_cpu(parm_data->start);
                        pLockData->fl_end = pLockData->fl_start +
                                        le64_to_cpu(parm_data->length) - 1;
 -                      pLockData->fl_pid = le32_to_cpu(parm_data->pid);
 +                      pLockData->fl_pid = -le32_to_cpu(parm_data->pid);
                }
        }
  
@@@ -6264,7 -6276,7 +6276,7 @@@ in
  CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
             const char *fileName, const char *ea_name, const void *ea_value,
             const __u16 ea_value_len, const struct nls_table *nls_codepage,
-            int remap)
+            struct cifs_sb_info *cifs_sb)
  {
        struct smb_com_transaction2_spi_req *pSMB = NULL;
        struct smb_com_transaction2_spi_rsp *pSMBr = NULL;
        int rc = 0;
        int bytes_returned = 0;
        __u16 params, param_offset, byte_count, offset, count;
+       int remap = cifs_remap(cifs_sb);
  
        cifs_dbg(FYI, "In SetEA\n");
  SetEARetry: