22 #include <linux/slab.h>
23 #include <linux/ctype.h>
32 #ifdef CONFIG_CIFS_SMB2
57 cFYI(1,
"warning: more than 65000 requests active");
93 if (buf_to_free ==
NULL) {
94 cFYI(1,
"Null buffer passed to sesInfoFree");
122 #ifdef CONFIG_CIFS_STATS
132 if (buf_to_free ==
NULL) {
133 cFYI(1,
"Null buffer passed to tconInfoFree");
151 #ifdef CONFIG_CIFS_SMB2
169 memset(ret_buf, 0, buf_size + 3);
171 #ifdef CONFIG_CIFS_STATS2
182 if (buf_to_free ==
NULL) {
206 #ifdef CONFIG_CIFS_STATS2
218 if (buf_to_free ==
NULL) {
219 cFYI(1,
"Null buffer passed to cifs_small_buf_release");
232 const struct cifs_tcon *treeCon,
int word_count
235 char *
temp = (
char *) buffer;
240 (2 * word_count) +
sizeof(
struct smb_hdr) -
249 buffer->
Flags = 0x00;
254 buffer->
Tid = treeCon->
tid;
262 buffer->
Uid = treeCon->
ses->Suid;
263 buffer->
Mid = get_next_mid(treeCon->
ses->server);
269 if ((treeCon->
ses) && (treeCon->
ses->server))
270 if (treeCon->
ses->server->sec_mode &
285 cERROR(1,
"Bad protocol string signature header 0x%x",
291 if (mid != smb->
Mid) {
292 cERROR(1,
"Mids do not match. received=%u expected=%u",
305 cERROR(1,
"Server sent request, not response. mid=%u", smb->
Mid);
316 cFYI(0,
"checkSMB Length: 0x%x, smb_buf_length: 0x%x",
320 if (total_read < 2 +
sizeof(
struct smb_hdr)) {
321 if ((total_read >=
sizeof(
struct smb_hdr) - 1)
327 }
else if ((total_read ==
sizeof(
struct smb_hdr) + 1) &&
329 char *
tmp = (
char *)smb;
332 if (tmp[
sizeof(
struct smb_hdr)] == 0) {
340 tmp[
sizeof(
struct smb_hdr)+1] = 0;
343 cERROR(1,
"rcvd invalid byte count (bcc)");
345 cERROR(1,
"Length less than smb header size");
351 if (check_smb_hdr(smb, mid))
355 if (4 + rfclen != total_read) {
356 cERROR(1,
"Length read does not match RFC1001 length %d",
361 if (4 + rfclen != clc_len) {
363 if ((rfclen > 64 * 1024) && (rfclen > clc_len)) {
365 if (((4 + rfclen) & 0xFFFF) == (clc_len & 0xFFFF))
368 cFYI(1,
"Calculated size %u vs length %u mismatch for mid=%u",
369 clc_len, 4 + rfclen, smb->
Mid);
371 if (4 + rfclen < clc_len) {
372 cERROR(1,
"RFC1001 size %u smaller than SMB for mid=%u",
375 }
else if (rfclen > clc_len + 512) {
385 cERROR(1,
"RFC1001 size %u more than 512 bytes larger "
386 "than SMB for mid=%u", rfclen, smb->
Mid);
404 cFYI(1,
"Checking for oplock break or dnotify response");
416 cFYI(1,
"dnotify on %s Action: 0x%x",
422 if (pSMBr->
hdr.Status.CifsError) {
423 cFYI(1,
"notify err 0x%d",
424 pSMBr->
hdr.Status.CifsError);
438 cFYI(1,
"invalid handle on oplock break");
447 if (pSMB->
hdr.WordCount != 8)
450 cFYI(1,
"oplock type 0x%d level 0x%d",
461 if (tcon->
tid != buf->
Tid)
469 if (pSMB->
Fid != netfile->
fid.netfid)
472 cFYI(1,
"file id match, oplock break");
473 pCifsInode = CIFS_I(netfile->
dentry->d_inode);
487 cFYI(1,
"No matching file for oplock break");
492 cFYI(1,
"Can not process oplock break for non-existent connection");
512 printk(
"%0#4x ", buffer[i]);
513 debug_line[2 *
j] =
' ';
515 debug_line[1 + (2 *
j)] = buffer[i];
517 debug_line[1 + (2 *
j)] =
'_';
522 printk(
" | %s\n", debug_line);
527 debug_line[2 *
j] =
' ';
528 debug_line[1 + (2 *
j)] =
' ';
530 printk(
" | %s\n", debug_line);
539 cERROR(1,
"Autodisabling the use of server inode numbers on "
540 "%s. This server doesn't seem to support them "
541 "properly. Hardlinks will not be recognized on this "
542 "mount. Consider mounting with the \"noserverino\" "
543 "option to silence this message.",
555 cFYI(1,
"Exclusive Oplock granted on inode %p",
560 cFYI(1,
"Level II Oplock granted on inode %p",
595 #ifdef CONFIG_CIFS_SMB2