signal: Implement SIL_FAULT_TRAPNO
[linux-2.6-microblaze.git] / fs / cifs / smb2ops.c
index 20f1fb6..dd0eb66 100644 (file)
@@ -848,11 +848,9 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
                };
 
                /*
-                * caller expects this func to set pfid to a valid
-                * cached root, so we copy the existing one and get a
-                * reference.
+                * caller expects this func to set the fid in crfid to valid
+                * cached root, so increment the refcount.
                 */
-               memcpy(pfid, tcon->crfid.fid, sizeof(*pfid));
                kref_get(&tcon->crfid.refcount);
 
                mutex_unlock(&tcon->crfid.fid_mutex);
@@ -885,7 +883,6 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
        oparms.fid->mid = le64_to_cpu(o_rsp->sync_hdr.MessageId);
 #endif /* CIFS_DEBUG2 */
 
-       memcpy(tcon->crfid.fid, pfid, sizeof(struct cifs_fid));
        tcon->crfid.tcon = tcon;
        tcon->crfid.is_valid = true;
        tcon->crfid.dentry = dentry;
@@ -894,6 +891,10 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
 
        /* BB TBD check to see if oplock level check can be removed below */
        if (o_rsp->OplockLevel == SMB2_OPLOCK_LEVEL_LEASE) {
+               /*
+                * See commit 2f94a3125b87. Increment the refcount when we
+                * get a lease for root, release it if lease break occurs
+                */
                kref_get(&tcon->crfid.refcount);
                tcon->crfid.has_lease = true;
                smb2_parse_contexts(server, o_rsp,
@@ -1566,7 +1567,10 @@ SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon,
                        NULL, 0 /* no input */, CIFSMaxBufSize,
                        (char **)&res_key, &ret_data_len);
 
-       if (rc) {
+       if (rc == -EOPNOTSUPP) {
+               pr_warn_once("Server share %s does not support copy range\n", tcon->treeName);
+               goto req_res_key_exit;
+       } else if (rc) {
                cifs_tcon_dbg(VFS, "refcpy ioctl error %d getting resume key\n", rc);
                goto req_res_key_exit;
        }
@@ -2264,7 +2268,7 @@ smb3_notify(const unsigned int xid, struct file *pfile,
                goto notify_exit;
        }
 
-       utf16_path = cifs_convert_path_to_utf16(path + 1, cifs_sb);
+       utf16_path = cifs_convert_path_to_utf16(path, cifs_sb);
        if (utf16_path == NULL) {
                rc = -ENOMEM;
                goto notify_exit;
@@ -4285,7 +4289,7 @@ smb2_get_enc_key(struct TCP_Server_Info *server, __u64 ses_id, int enc, u8 *key)
        }
        spin_unlock(&cifs_tcp_ses_lock);
 
-       return 1;
+       return -EAGAIN;
 }
 /*
  * Encrypt or decrypt @rqst message. @rqst[0] has the following format: