diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2011-12-26 13:53:34 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-07-24 11:25:20 -0400 |
commit | 2dc7e1c03316940dec899fa3206a595de000e99b (patch) | |
tree | c74127806717b23e226b3ee81135d091d859bd7a /fs/cifs | |
parent | ddfbefbd393fb1a935bdf27cba5ad2eb24a76e75 (diff) |
CIFS: Make transport routines work with SMB2
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/Makefile | 2 | ||||
-rw-r--r-- | fs/cifs/cifsglob.h | 5 | ||||
-rw-r--r-- | fs/cifs/cifsproto.h | 1 | ||||
-rw-r--r-- | fs/cifs/smb1ops.c | 1 | ||||
-rw-r--r-- | fs/cifs/smb2ops.c | 17 | ||||
-rw-r--r-- | fs/cifs/smb2pdu.h | 59 | ||||
-rw-r--r-- | fs/cifs/smb2proto.h | 5 | ||||
-rw-r--r-- | fs/cifs/smb2transport.c | 151 | ||||
-rw-r--r-- | fs/cifs/transport.c | 13 |
9 files changed, 246 insertions, 8 deletions
diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile index 4a7727143721..a73d7f888846 100644 --- a/fs/cifs/Makefile +++ b/fs/cifs/Makefile | |||
@@ -16,4 +16,4 @@ cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o | |||
16 | 16 | ||
17 | cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o | 17 | cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o |
18 | 18 | ||
19 | cifs-$(CONFIG_CIFS_SMB2) += smb2ops.o smb2maperror.o | 19 | cifs-$(CONFIG_CIFS_SMB2) += smb2ops.o smb2maperror.o smb2transport.o |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 6d18962c9903..3575f0f832b1 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/in.h> | 22 | #include <linux/in.h> |
23 | #include <linux/in6.h> | 23 | #include <linux/in6.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/mempool.h> | ||
25 | #include <linux/workqueue.h> | 26 | #include <linux/workqueue.h> |
26 | #include "cifs_fs_sb.h" | 27 | #include "cifs_fs_sb.h" |
27 | #include "cifsacl.h" | 28 | #include "cifsacl.h" |
@@ -218,6 +219,7 @@ struct smb_version_values { | |||
218 | size_t header_size; | 219 | size_t header_size; |
219 | size_t max_header_size; | 220 | size_t max_header_size; |
220 | size_t read_rsp_size; | 221 | size_t read_rsp_size; |
222 | __le16 lock_cmd; | ||
221 | }; | 223 | }; |
222 | 224 | ||
223 | #define HEADER_SIZE(server) (server->vals->header_size) | 225 | #define HEADER_SIZE(server) (server->vals->header_size) |
@@ -812,6 +814,7 @@ typedef void (mid_callback_t)(struct mid_q_entry *mid); | |||
812 | /* one of these for every pending CIFS request to the server */ | 814 | /* one of these for every pending CIFS request to the server */ |
813 | struct mid_q_entry { | 815 | struct mid_q_entry { |
814 | struct list_head qhead; /* mids waiting on reply from this server */ | 816 | struct list_head qhead; /* mids waiting on reply from this server */ |
817 | struct TCP_Server_Info *server; /* server corresponding to this mid */ | ||
815 | __u64 mid; /* multiplex id */ | 818 | __u64 mid; /* multiplex id */ |
816 | __u32 pid; /* process id */ | 819 | __u32 pid; /* process id */ |
817 | __u32 sequence_number; /* for CIFS signing */ | 820 | __u32 sequence_number; /* for CIFS signing */ |
@@ -1153,6 +1156,8 @@ void cifs_oplock_break(struct work_struct *work); | |||
1153 | extern const struct slow_work_ops cifs_oplock_break_ops; | 1156 | extern const struct slow_work_ops cifs_oplock_break_ops; |
1154 | extern struct workqueue_struct *cifsiod_wq; | 1157 | extern struct workqueue_struct *cifsiod_wq; |
1155 | 1158 | ||
1159 | extern mempool_t *cifs_mid_poolp; | ||
1160 | |||
1156 | /* Operations for different SMB versions */ | 1161 | /* Operations for different SMB versions */ |
1157 | #define SMB1_VERSION_STRING "1.0" | 1162 | #define SMB1_VERSION_STRING "1.0" |
1158 | extern struct smb_version_operations smb1_operations; | 1163 | extern struct smb_version_operations smb1_operations; |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 8797e4064662..88967d0885bf 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -68,6 +68,7 @@ extern char *cifs_compose_mount_options(const char *sb_mountdata, | |||
68 | extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, | 68 | extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, |
69 | struct TCP_Server_Info *server); | 69 | struct TCP_Server_Info *server); |
70 | extern void DeleteMidQEntry(struct mid_q_entry *midEntry); | 70 | extern void DeleteMidQEntry(struct mid_q_entry *midEntry); |
71 | extern void cifs_wake_up_task(struct mid_q_entry *mid); | ||
71 | extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, | 72 | extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, |
72 | unsigned int nvec, mid_receive_t *receive, | 73 | unsigned int nvec, mid_receive_t *receive, |
73 | mid_callback_t *callback, void *cbdata, | 74 | mid_callback_t *callback, void *cbdata, |
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 728595f096c9..8f873863142a 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -445,4 +445,5 @@ struct smb_version_values smb1_values = { | |||
445 | .header_size = sizeof(struct smb_hdr), | 445 | .header_size = sizeof(struct smb_hdr), |
446 | .max_header_size = MAX_CIFS_HDR_SIZE, | 446 | .max_header_size = MAX_CIFS_HDR_SIZE, |
447 | .read_rsp_size = sizeof(READ_RSP), | 447 | .read_rsp_size = sizeof(READ_RSP), |
448 | .lock_cmd = cpu_to_le16(SMB_COM_LOCKING_ANDX), | ||
448 | }; | 449 | }; |
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index f065e89756a1..09530f416123 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -18,10 +18,27 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "cifsglob.h" | 20 | #include "cifsglob.h" |
21 | #include "smb2pdu.h" | ||
22 | #include "smb2proto.h" | ||
23 | |||
24 | static __u64 | ||
25 | smb2_get_next_mid(struct TCP_Server_Info *server) | ||
26 | { | ||
27 | __u64 mid; | ||
28 | /* for SMB2 we need the current value */ | ||
29 | spin_lock(&GlobalMid_Lock); | ||
30 | mid = server->CurrentMid++; | ||
31 | spin_unlock(&GlobalMid_Lock); | ||
32 | return mid; | ||
33 | } | ||
21 | 34 | ||
22 | struct smb_version_operations smb21_operations = { | 35 | struct smb_version_operations smb21_operations = { |
36 | .setup_request = smb2_setup_request, | ||
37 | .check_receive = smb2_check_receive, | ||
38 | .get_next_mid = smb2_get_next_mid, | ||
23 | }; | 39 | }; |
24 | 40 | ||
25 | struct smb_version_values smb21_values = { | 41 | struct smb_version_values smb21_values = { |
26 | .version_string = SMB21_VERSION_STRING, | 42 | .version_string = SMB21_VERSION_STRING, |
43 | .lock_cmd = SMB2_LOCK, | ||
27 | }; | 44 | }; |
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index d35ac689f24b..c7f52e363d37 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h | |||
@@ -27,6 +27,65 @@ | |||
27 | #include <net/sock.h> | 27 | #include <net/sock.h> |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * Note that, due to trying to use names similar to the protocol specifications, | ||
31 | * there are many mixed case field names in the structures below. Although | ||
32 | * this does not match typical Linux kernel style, it is necessary to be | ||
33 | * be able to match against the protocol specfication. | ||
34 | * | ||
35 | * SMB2 commands | ||
36 | * Some commands have minimal (wct=0,bcc=0), or uninteresting, responses | ||
37 | * (ie no useful data other than the SMB error code itself) and are marked such. | ||
38 | * Knowing this helps avoid response buffer allocations and copy in some cases. | ||
39 | */ | ||
40 | |||
41 | /* List of commands in host endian */ | ||
42 | #define SMB2_NEGOTIATE_HE 0x0000 | ||
43 | #define SMB2_SESSION_SETUP_HE 0x0001 | ||
44 | #define SMB2_LOGOFF_HE 0x0002 /* trivial request/resp */ | ||
45 | #define SMB2_TREE_CONNECT_HE 0x0003 | ||
46 | #define SMB2_TREE_DISCONNECT_HE 0x0004 /* trivial req/resp */ | ||
47 | #define SMB2_CREATE_HE 0x0005 | ||
48 | #define SMB2_CLOSE_HE 0x0006 | ||
49 | #define SMB2_FLUSH_HE 0x0007 /* trivial resp */ | ||
50 | #define SMB2_READ_HE 0x0008 | ||
51 | #define SMB2_WRITE_HE 0x0009 | ||
52 | #define SMB2_LOCK_HE 0x000A | ||
53 | #define SMB2_IOCTL_HE 0x000B | ||
54 | #define SMB2_CANCEL_HE 0x000C | ||
55 | #define SMB2_ECHO_HE 0x000D | ||
56 | #define SMB2_QUERY_DIRECTORY_HE 0x000E | ||
57 | #define SMB2_CHANGE_NOTIFY_HE 0x000F | ||
58 | #define SMB2_QUERY_INFO_HE 0x0010 | ||
59 | #define SMB2_SET_INFO_HE 0x0011 | ||
60 | #define SMB2_OPLOCK_BREAK_HE 0x0012 | ||
61 | |||
62 | /* The same list in little endian */ | ||
63 | #define SMB2_NEGOTIATE cpu_to_le16(SMB2_NEGOTIATE_HE) | ||
64 | #define SMB2_SESSION_SETUP cpu_to_le16(SMB2_SESSION_SETUP_HE) | ||
65 | #define SMB2_LOGOFF cpu_to_le16(SMB2_LOGOFF_HE) | ||
66 | #define SMB2_TREE_CONNECT cpu_to_le16(SMB2_TREE_CONNECT_HE) | ||
67 | #define SMB2_TREE_DISCONNECT cpu_to_le16(SMB2_TREE_DISCONNECT_HE) | ||
68 | #define SMB2_CREATE cpu_to_le16(SMB2_CREATE_HE) | ||
69 | #define SMB2_CLOSE cpu_to_le16(SMB2_CLOSE_HE) | ||
70 | #define SMB2_FLUSH cpu_to_le16(SMB2_FLUSH_HE) | ||
71 | #define SMB2_READ cpu_to_le16(SMB2_READ_HE) | ||
72 | #define SMB2_WRITE cpu_to_le16(SMB2_WRITE_HE) | ||
73 | #define SMB2_LOCK cpu_to_le16(SMB2_LOCK_HE) | ||
74 | #define SMB2_IOCTL cpu_to_le16(SMB2_IOCTL_HE) | ||
75 | #define SMB2_CANCEL cpu_to_le16(SMB2_CANCEL_HE) | ||
76 | #define SMB2_ECHO cpu_to_le16(SMB2_ECHO_HE) | ||
77 | #define SMB2_QUERY_DIRECTORY cpu_to_le16(SMB2_QUERY_DIRECTORY_HE) | ||
78 | #define SMB2_CHANGE_NOTIFY cpu_to_le16(SMB2_CHANGE_NOTIFY_HE) | ||
79 | #define SMB2_QUERY_INFO cpu_to_le16(SMB2_QUERY_INFO_HE) | ||
80 | #define SMB2_SET_INFO cpu_to_le16(SMB2_SET_INFO_HE) | ||
81 | #define SMB2_OPLOCK_BREAK cpu_to_le16(SMB2_OPLOCK_BREAK_HE) | ||
82 | |||
83 | #define NUMBER_OF_SMB2_COMMANDS 0x0013 | ||
84 | |||
85 | /* BB FIXME - analyze following length BB */ | ||
86 | #define MAX_SMB2_HDR_SIZE 0x78 /* 4 len + 64 hdr + (2*24 wct) + 2 bct + 2 pad */ | ||
87 | |||
88 | /* | ||
30 | * SMB2 Header Definition | 89 | * SMB2 Header Definition |
31 | * | 90 | * |
32 | * "MBZ" : Must be Zero | 91 | * "MBZ" : Must be Zero |
diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index 08249eecdf69..0e59afb5edf9 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h | |||
@@ -34,4 +34,9 @@ struct statfs; | |||
34 | */ | 34 | */ |
35 | extern int map_smb2_to_linux_error(char *buf, bool log_err); | 35 | extern int map_smb2_to_linux_error(char *buf, bool log_err); |
36 | 36 | ||
37 | extern int smb2_check_receive(struct mid_q_entry *mid, | ||
38 | struct TCP_Server_Info *server, bool log_error); | ||
39 | extern int smb2_setup_request(struct cifs_ses *ses, struct kvec *iov, | ||
40 | unsigned int nvec, struct mid_q_entry **ret_mid); | ||
41 | |||
37 | #endif /* _SMB2PROTO_H */ | 42 | #endif /* _SMB2PROTO_H */ |
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c new file mode 100644 index 000000000000..b4b6b9a6c0fb --- /dev/null +++ b/fs/cifs/smb2transport.c | |||
@@ -0,0 +1,151 @@ | |||
1 | /* | ||
2 | * fs/cifs/smb2transport.c | ||
3 | * | ||
4 | * Copyright (C) International Business Machines Corp., 2002, 2011 | ||
5 | * Etersoft, 2012 | ||
6 | * Author(s): Steve French (sfrench@us.ibm.com) | ||
7 | * Jeremy Allison (jra@samba.org) 2006 | ||
8 | * Pavel Shilovsky (pshilovsky@samba.org) 2012 | ||
9 | * | ||
10 | * This library is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU Lesser General Public License as published | ||
12 | * by the Free Software Foundation; either version 2.1 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This library is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | ||
18 | * the GNU Lesser General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU Lesser General Public License | ||
21 | * along with this library; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | */ | ||
24 | |||
25 | #include <linux/fs.h> | ||
26 | #include <linux/list.h> | ||
27 | #include <linux/wait.h> | ||
28 | #include <linux/net.h> | ||
29 | #include <linux/delay.h> | ||
30 | #include <linux/uaccess.h> | ||
31 | #include <asm/processor.h> | ||
32 | #include <linux/mempool.h> | ||
33 | #include "smb2pdu.h" | ||
34 | #include "cifsglob.h" | ||
35 | #include "cifsproto.h" | ||
36 | #include "smb2proto.h" | ||
37 | #include "cifs_debug.h" | ||
38 | #include "smb2status.h" | ||
39 | |||
40 | /* | ||
41 | * Set message id for the request. Should be called after wait_for_free_request | ||
42 | * and when srv_mutex is held. | ||
43 | */ | ||
44 | static inline void | ||
45 | smb2_seq_num_into_buf(struct TCP_Server_Info *server, struct smb2_hdr *hdr) | ||
46 | { | ||
47 | hdr->MessageId = get_next_mid(server); | ||
48 | } | ||
49 | |||
50 | static struct mid_q_entry * | ||
51 | smb2_mid_entry_alloc(const struct smb2_hdr *smb_buffer, | ||
52 | struct TCP_Server_Info *server) | ||
53 | { | ||
54 | struct mid_q_entry *temp; | ||
55 | |||
56 | if (server == NULL) { | ||
57 | cERROR(1, "Null TCP session in smb2_mid_entry_alloc"); | ||
58 | return NULL; | ||
59 | } | ||
60 | |||
61 | temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS); | ||
62 | if (temp == NULL) | ||
63 | return temp; | ||
64 | else { | ||
65 | memset(temp, 0, sizeof(struct mid_q_entry)); | ||
66 | temp->mid = smb_buffer->MessageId; /* always LE */ | ||
67 | temp->pid = current->pid; | ||
68 | temp->command = smb_buffer->Command; /* Always LE */ | ||
69 | temp->when_alloc = jiffies; | ||
70 | temp->server = server; | ||
71 | |||
72 | /* | ||
73 | * The default is for the mid to be synchronous, so the | ||
74 | * default callback just wakes up the current task. | ||
75 | */ | ||
76 | temp->callback = cifs_wake_up_task; | ||
77 | temp->callback_data = current; | ||
78 | } | ||
79 | |||
80 | atomic_inc(&midCount); | ||
81 | temp->mid_state = MID_REQUEST_ALLOCATED; | ||
82 | return temp; | ||
83 | } | ||
84 | |||
85 | static int | ||
86 | smb2_get_mid_entry(struct cifs_ses *ses, struct smb2_hdr *buf, | ||
87 | struct mid_q_entry **mid) | ||
88 | { | ||
89 | if (ses->server->tcpStatus == CifsExiting) | ||
90 | return -ENOENT; | ||
91 | |||
92 | if (ses->server->tcpStatus == CifsNeedReconnect) { | ||
93 | cFYI(1, "tcp session dead - return to caller to retry"); | ||
94 | return -EAGAIN; | ||
95 | } | ||
96 | |||
97 | if (ses->status != CifsGood) { | ||
98 | /* check if SMB2 session is bad because we are setting it up */ | ||
99 | if ((buf->Command != SMB2_SESSION_SETUP) && | ||
100 | (buf->Command != SMB2_NEGOTIATE)) | ||
101 | return -EAGAIN; | ||
102 | /* else ok - we are setting up session */ | ||
103 | } | ||
104 | *mid = smb2_mid_entry_alloc(buf, ses->server); | ||
105 | if (*mid == NULL) | ||
106 | return -ENOMEM; | ||
107 | spin_lock(&GlobalMid_Lock); | ||
108 | list_add_tail(&(*mid)->qhead, &ses->server->pending_mid_q); | ||
109 | spin_unlock(&GlobalMid_Lock); | ||
110 | return 0; | ||
111 | } | ||
112 | |||
113 | int | ||
114 | smb2_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, | ||
115 | bool log_error) | ||
116 | { | ||
117 | unsigned int len = get_rfc1002_length(mid->resp_buf); | ||
118 | |||
119 | dump_smb(mid->resp_buf, min_t(u32, 80, len)); | ||
120 | /* convert the length into a more usable form */ | ||
121 | /* BB - uncomment with SMB2 signing implementation */ | ||
122 | /* if ((len > 24) && | ||
123 | (server->sec_mode & (SECMODE_SIGN_REQUIRED|SECMODE_SIGN_ENABLED))) { | ||
124 | if (smb2_verify_signature(mid->resp_buf, server)) | ||
125 | cERROR(1, "Unexpected SMB signature"); | ||
126 | } */ | ||
127 | |||
128 | return map_smb2_to_linux_error(mid->resp_buf, log_error); | ||
129 | } | ||
130 | |||
131 | int | ||
132 | smb2_setup_request(struct cifs_ses *ses, struct kvec *iov, | ||
133 | unsigned int nvec, struct mid_q_entry **ret_mid) | ||
134 | { | ||
135 | int rc; | ||
136 | struct smb2_hdr *hdr = (struct smb2_hdr *)iov[0].iov_base; | ||
137 | struct mid_q_entry *mid; | ||
138 | |||
139 | smb2_seq_num_into_buf(ses->server, hdr); | ||
140 | |||
141 | rc = smb2_get_mid_entry(ses, hdr, &mid); | ||
142 | if (rc) | ||
143 | return rc; | ||
144 | /* rc = smb2_sign_smb2(iov, nvec, ses->server); | ||
145 | if (rc) | ||
146 | delete_mid(mid); */ | ||
147 | *ret_mid = mid; | ||
148 | return rc; | ||
149 | } | ||
150 | |||
151 | /* BB add missing functions here */ | ||
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 904702db2526..bcc02b476f6e 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -35,10 +35,8 @@ | |||
35 | #include "cifsproto.h" | 35 | #include "cifsproto.h" |
36 | #include "cifs_debug.h" | 36 | #include "cifs_debug.h" |
37 | 37 | ||
38 | extern mempool_t *cifs_mid_poolp; | 38 | void |
39 | 39 | cifs_wake_up_task(struct mid_q_entry *mid) | |
40 | static void | ||
41 | wake_up_task(struct mid_q_entry *mid) | ||
42 | { | 40 | { |
43 | wake_up_process(mid->callback_data); | 41 | wake_up_process(mid->callback_data); |
44 | } | 42 | } |
@@ -65,12 +63,13 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) | |||
65 | /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ | 63 | /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ |
66 | /* when mid allocated can be before when sent */ | 64 | /* when mid allocated can be before when sent */ |
67 | temp->when_alloc = jiffies; | 65 | temp->when_alloc = jiffies; |
66 | temp->server = server; | ||
68 | 67 | ||
69 | /* | 68 | /* |
70 | * The default is for the mid to be synchronous, so the | 69 | * The default is for the mid to be synchronous, so the |
71 | * default callback just wakes up the current task. | 70 | * default callback just wakes up the current task. |
72 | */ | 71 | */ |
73 | temp->callback = wake_up_task; | 72 | temp->callback = cifs_wake_up_task; |
74 | temp->callback_data = current; | 73 | temp->callback_data = current; |
75 | } | 74 | } |
76 | 75 | ||
@@ -83,6 +82,7 @@ void | |||
83 | DeleteMidQEntry(struct mid_q_entry *midEntry) | 82 | DeleteMidQEntry(struct mid_q_entry *midEntry) |
84 | { | 83 | { |
85 | #ifdef CONFIG_CIFS_STATS2 | 84 | #ifdef CONFIG_CIFS_STATS2 |
85 | __le16 command = midEntry->server->vals->lock_cmd; | ||
86 | unsigned long now; | 86 | unsigned long now; |
87 | #endif | 87 | #endif |
88 | midEntry->mid_state = MID_FREE; | 88 | midEntry->mid_state = MID_FREE; |
@@ -96,8 +96,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry) | |||
96 | /* commands taking longer than one second are indications that | 96 | /* commands taking longer than one second are indications that |
97 | something is wrong, unless it is quite a slow link or server */ | 97 | something is wrong, unless it is quite a slow link or server */ |
98 | if ((now - midEntry->when_alloc) > HZ) { | 98 | if ((now - midEntry->when_alloc) > HZ) { |
99 | if ((cifsFYI & CIFS_TIMER) && | 99 | if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) { |
100 | (midEntry->command != cpu_to_le16(SMB_COM_LOCKING_ANDX))) { | ||
101 | printk(KERN_DEBUG " CIFS slow rsp: cmd %d mid %llu", | 100 | printk(KERN_DEBUG " CIFS slow rsp: cmd %d mid %llu", |
102 | midEntry->command, midEntry->mid); | 101 | midEntry->command, midEntry->mid); |
103 | printk(" A: 0x%lx S: 0x%lx R: 0x%lx\n", | 102 | printk(" A: 0x%lx S: 0x%lx R: 0x%lx\n", |