Do not fall back to SMBWriteX in set_file_size error cases
[pandora-kernel.git] / fs / cifs / transport.c
index 0cc9584..4e5dfb7 100644 (file)
@@ -265,12 +265,12 @@ static int wait_for_free_request(struct TCP_Server_Info *server,
 
        spin_lock(&GlobalMid_Lock);
        while (1) {
-               if (atomic_read(&server->inFlight) >= cifs_max_pending) {
+               if (atomic_read(&server->inFlight) >= server->maxReq) {
                        spin_unlock(&GlobalMid_Lock);
                        cifs_num_waiters_inc(server);
                        wait_event(server->request_q,
                                   atomic_read(&server->inFlight)
-                                    < cifs_max_pending);
+                                    < server->maxReq);
                        cifs_num_waiters_dec(server);
                        spin_lock(&GlobalMid_Lock);
                } else {
@@ -485,6 +485,13 @@ send_nt_cancel(struct TCP_Server_Info *server, struct smb_hdr *in_buf,
                mutex_unlock(&server->srv_mutex);
                return rc;
        }
+
+       /*
+        * The response to this call was already factored into the sequence
+        * number when the call went out, so we must adjust it back downward
+        * after signing here.
+        */
+       --server->sequence_number;
        rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
        mutex_unlock(&server->srv_mutex);