diff options
author | Joe Perches <joe@perches.com> | 2013-05-04 23:12:25 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-05-04 23:17:23 -0400 |
commit | f96637be081141d6f8813429499f164260b49d70 (patch) | |
tree | c91f5a9b5a2b7a67bbeda15d7c9805655547a098 /fs/cifs/smb2pdu.c | |
parent | f7f7c1850eb98da758731ea7edfa830ebefe24cd (diff) |
[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg
It's not obvious from reading the macro names that these macros
are for debugging. Convert the names to a single more typical
kernel style cifs_dbg macro.
cERROR(1, ...) -> cifs_dbg(VFS, ...)
cFYI(1, ...) -> cifs_dbg(FYI, ...)
cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...)
Move the terminating format newline from the macro to the call site.
Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the
"CIFS VFS: " prefix for VFS messages.
Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y)
$ size fs/cifs/cifs.ko*
text data bss dec hex filename
265245 2525 132 267902 4167e fs/cifs/cifs.ko.new
268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old
Other miscellaneous changes around these conversions:
o Miscellaneous typo fixes
o Add terminating \n's to almost all formats and remove them
from the macros to be more kernel style like. A few formats
previously had defective \n's
o Remove unnecessary OOM messages as kmalloc() calls dump_stack
o Coalesce formats to make grep easier,
added missing spaces when coalescing formats
o Use %s, __func__ instead of embedded function name
o Removed unnecessary "cifs: " prefixes
o Convert kzalloc with multiply to kcalloc
o Remove unused cifswarn macro
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r-- | fs/cifs/smb2pdu.c | 157 |
1 files changed, 79 insertions, 78 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 83ef66ed4c84..2b95ce2b54e8 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
@@ -155,8 +155,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) | |||
155 | if ((smb2_command != SMB2_WRITE) && | 155 | if ((smb2_command != SMB2_WRITE) && |
156 | (smb2_command != SMB2_CREATE) && | 156 | (smb2_command != SMB2_CREATE) && |
157 | (smb2_command != SMB2_TREE_DISCONNECT)) { | 157 | (smb2_command != SMB2_TREE_DISCONNECT)) { |
158 | cFYI(1, "can not send cmd %d while umounting", | 158 | cifs_dbg(FYI, "can not send cmd %d while umounting\n", |
159 | smb2_command); | 159 | smb2_command); |
160 | return -ENODEV; | 160 | return -ENODEV; |
161 | } | 161 | } |
162 | } | 162 | } |
@@ -200,7 +200,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) | |||
200 | * back on-line | 200 | * back on-line |
201 | */ | 201 | */ |
202 | if (!tcon->retry) { | 202 | if (!tcon->retry) { |
203 | cFYI(1, "gave up waiting on reconnect in smb_init"); | 203 | cifs_dbg(FYI, "gave up waiting on reconnect in smb_init\n"); |
204 | return -EHOSTDOWN; | 204 | return -EHOSTDOWN; |
205 | } | 205 | } |
206 | } | 206 | } |
@@ -227,7 +227,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) | |||
227 | cifs_mark_open_files_invalid(tcon); | 227 | cifs_mark_open_files_invalid(tcon); |
228 | rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage); | 228 | rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage); |
229 | mutex_unlock(&tcon->ses->session_mutex); | 229 | mutex_unlock(&tcon->ses->session_mutex); |
230 | cFYI(1, "reconnect tcon rc = %d", rc); | 230 | cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc); |
231 | if (rc) | 231 | if (rc) |
232 | goto out; | 232 | goto out; |
233 | atomic_inc(&tconInfoReconnectCount); | 233 | atomic_inc(&tconInfoReconnectCount); |
@@ -335,7 +335,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
335 | char *security_blob; | 335 | char *security_blob; |
336 | int flags = CIFS_NEG_OP; | 336 | int flags = CIFS_NEG_OP; |
337 | 337 | ||
338 | cFYI(1, "Negotiate protocol"); | 338 | cifs_dbg(FYI, "Negotiate protocol\n"); |
339 | 339 | ||
340 | if (ses->server) | 340 | if (ses->server) |
341 | server = ses->server; | 341 | server = ses->server; |
@@ -354,7 +354,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
354 | else /* if override flags set only sign/seal OR them with global auth */ | 354 | else /* if override flags set only sign/seal OR them with global auth */ |
355 | sec_flags = global_secflags | ses->overrideSecFlg; | 355 | sec_flags = global_secflags | ses->overrideSecFlg; |
356 | 356 | ||
357 | cFYI(1, "sec_flags 0x%x", sec_flags); | 357 | cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags); |
358 | 358 | ||
359 | req->hdr.SessionId = 0; | 359 | req->hdr.SessionId = 0; |
360 | 360 | ||
@@ -389,19 +389,19 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
389 | if (rc != 0) | 389 | if (rc != 0) |
390 | goto neg_exit; | 390 | goto neg_exit; |
391 | 391 | ||
392 | cFYI(1, "mode 0x%x", rsp->SecurityMode); | 392 | cifs_dbg(FYI, "mode 0x%x\n", rsp->SecurityMode); |
393 | 393 | ||
394 | /* BB we may eventually want to match the negotiated vs. requested | 394 | /* BB we may eventually want to match the negotiated vs. requested |
395 | dialect, even though we are only requesting one at a time */ | 395 | dialect, even though we are only requesting one at a time */ |
396 | if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) | 396 | if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) |
397 | cFYI(1, "negotiated smb2.0 dialect"); | 397 | cifs_dbg(FYI, "negotiated smb2.0 dialect\n"); |
398 | else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) | 398 | else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) |
399 | cFYI(1, "negotiated smb2.1 dialect"); | 399 | cifs_dbg(FYI, "negotiated smb2.1 dialect\n"); |
400 | else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID)) | 400 | else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID)) |
401 | cFYI(1, "negotiated smb3.0 dialect"); | 401 | cifs_dbg(FYI, "negotiated smb3.0 dialect\n"); |
402 | else { | 402 | else { |
403 | cERROR(1, "Illegal dialect returned by server %d", | 403 | cifs_dbg(VFS, "Illegal dialect returned by server %d\n", |
404 | le16_to_cpu(rsp->DialectRevision)); | 404 | le16_to_cpu(rsp->DialectRevision)); |
405 | rc = -EIO; | 405 | rc = -EIO; |
406 | goto neg_exit; | 406 | goto neg_exit; |
407 | } | 407 | } |
@@ -419,35 +419,34 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
419 | security_blob = smb2_get_data_area_len(&blob_offset, &blob_length, | 419 | security_blob = smb2_get_data_area_len(&blob_offset, &blob_length, |
420 | &rsp->hdr); | 420 | &rsp->hdr); |
421 | if (blob_length == 0) { | 421 | if (blob_length == 0) { |
422 | cERROR(1, "missing security blob on negprot"); | 422 | cifs_dbg(VFS, "missing security blob on negprot\n"); |
423 | rc = -EIO; | 423 | rc = -EIO; |
424 | goto neg_exit; | 424 | goto neg_exit; |
425 | } | 425 | } |
426 | 426 | ||
427 | cFYI(1, "sec_flags 0x%x", sec_flags); | 427 | cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags); |
428 | if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { | 428 | if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { |
429 | cFYI(1, "Signing required"); | 429 | cifs_dbg(FYI, "Signing required\n"); |
430 | if (!(server->sec_mode & (SMB2_NEGOTIATE_SIGNING_REQUIRED | | 430 | if (!(server->sec_mode & (SMB2_NEGOTIATE_SIGNING_REQUIRED | |
431 | SMB2_NEGOTIATE_SIGNING_ENABLED))) { | 431 | SMB2_NEGOTIATE_SIGNING_ENABLED))) { |
432 | cERROR(1, "signing required but server lacks support"); | 432 | cifs_dbg(VFS, "signing required but server lacks support\n"); |
433 | rc = -EOPNOTSUPP; | 433 | rc = -EOPNOTSUPP; |
434 | goto neg_exit; | 434 | goto neg_exit; |
435 | } | 435 | } |
436 | server->sec_mode |= SECMODE_SIGN_REQUIRED; | 436 | server->sec_mode |= SECMODE_SIGN_REQUIRED; |
437 | } else if (sec_flags & CIFSSEC_MAY_SIGN) { | 437 | } else if (sec_flags & CIFSSEC_MAY_SIGN) { |
438 | cFYI(1, "Signing optional"); | 438 | cifs_dbg(FYI, "Signing optional\n"); |
439 | if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) { | 439 | if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) { |
440 | cFYI(1, "Server requires signing"); | 440 | cifs_dbg(FYI, "Server requires signing\n"); |
441 | server->sec_mode |= SECMODE_SIGN_REQUIRED; | 441 | server->sec_mode |= SECMODE_SIGN_REQUIRED; |
442 | } else { | 442 | } else { |
443 | server->sec_mode &= | 443 | server->sec_mode &= |
444 | ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); | 444 | ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); |
445 | } | 445 | } |
446 | } else { | 446 | } else { |
447 | cFYI(1, "Signing disabled"); | 447 | cifs_dbg(FYI, "Signing disabled\n"); |
448 | if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) { | 448 | if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) { |
449 | cERROR(1, "Server requires packet signing to be enabled" | 449 | cifs_dbg(VFS, "Server requires packet signing to be enabled in /proc/fs/cifs/SecurityFlags\n"); |
450 | " in /proc/fs/cifs/SecurityFlags."); | ||
451 | rc = -EOPNOTSUPP; | 450 | rc = -EOPNOTSUPP; |
452 | goto neg_exit; | 451 | goto neg_exit; |
453 | } | 452 | } |
@@ -489,7 +488,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, | |||
489 | char *ntlmssp_blob = NULL; | 488 | char *ntlmssp_blob = NULL; |
490 | bool use_spnego = false; /* else use raw ntlmssp */ | 489 | bool use_spnego = false; /* else use raw ntlmssp */ |
491 | 490 | ||
492 | cFYI(1, "Session Setup"); | 491 | cifs_dbg(FYI, "Session Setup\n"); |
493 | 492 | ||
494 | if (ses->server) | 493 | if (ses->server) |
495 | server = ses->server; | 494 | server = ses->server; |
@@ -522,7 +521,7 @@ ssetup_ntlmssp_authenticate: | |||
522 | else /* if override flags set only sign/seal OR them with global auth */ | 521 | else /* if override flags set only sign/seal OR them with global auth */ |
523 | sec_flags = global_secflags | ses->overrideSecFlg; | 522 | sec_flags = global_secflags | ses->overrideSecFlg; |
524 | 523 | ||
525 | cFYI(1, "sec_flags 0x%x", sec_flags); | 524 | cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags); |
526 | 525 | ||
527 | req->hdr.SessionId = 0; /* First session, not a reauthenticate */ | 526 | req->hdr.SessionId = 0; /* First session, not a reauthenticate */ |
528 | req->VcNumber = 0; /* MBZ */ | 527 | req->VcNumber = 0; /* MBZ */ |
@@ -558,7 +557,7 @@ ssetup_ntlmssp_authenticate: | |||
558 | sizeof(struct _NEGOTIATE_MESSAGE), | 557 | sizeof(struct _NEGOTIATE_MESSAGE), |
559 | ntlmssp_blob); */ | 558 | ntlmssp_blob); */ |
560 | /* BB eventually need to add this */ | 559 | /* BB eventually need to add this */ |
561 | cERROR(1, "spnego not supported for SMB2 yet"); | 560 | cifs_dbg(VFS, "spnego not supported for SMB2 yet\n"); |
562 | rc = -EOPNOTSUPP; | 561 | rc = -EOPNOTSUPP; |
563 | kfree(ntlmssp_blob); | 562 | kfree(ntlmssp_blob); |
564 | goto ssetup_exit; | 563 | goto ssetup_exit; |
@@ -572,14 +571,14 @@ ssetup_ntlmssp_authenticate: | |||
572 | ntlmssp_blob = kzalloc(sizeof(struct _NEGOTIATE_MESSAGE) + 500, | 571 | ntlmssp_blob = kzalloc(sizeof(struct _NEGOTIATE_MESSAGE) + 500, |
573 | GFP_KERNEL); | 572 | GFP_KERNEL); |
574 | if (ntlmssp_blob == NULL) { | 573 | if (ntlmssp_blob == NULL) { |
575 | cERROR(1, "failed to malloc ntlmssp blob"); | ||
576 | rc = -ENOMEM; | 574 | rc = -ENOMEM; |
577 | goto ssetup_exit; | 575 | goto ssetup_exit; |
578 | } | 576 | } |
579 | rc = build_ntlmssp_auth_blob(ntlmssp_blob, &blob_length, ses, | 577 | rc = build_ntlmssp_auth_blob(ntlmssp_blob, &blob_length, ses, |
580 | nls_cp); | 578 | nls_cp); |
581 | if (rc) { | 579 | if (rc) { |
582 | cFYI(1, "build_ntlmssp_auth_blob failed %d", rc); | 580 | cifs_dbg(FYI, "build_ntlmssp_auth_blob failed %d\n", |
581 | rc); | ||
583 | goto ssetup_exit; /* BB double check error handling */ | 582 | goto ssetup_exit; /* BB double check error handling */ |
584 | } | 583 | } |
585 | if (use_spnego) { | 584 | if (use_spnego) { |
@@ -587,7 +586,7 @@ ssetup_ntlmssp_authenticate: | |||
587 | &security_blob, | 586 | &security_blob, |
588 | blob_length, | 587 | blob_length, |
589 | ntlmssp_blob); */ | 588 | ntlmssp_blob); */ |
590 | cERROR(1, "spnego not supported for SMB2 yet"); | 589 | cifs_dbg(VFS, "spnego not supported for SMB2 yet\n"); |
591 | rc = -EOPNOTSUPP; | 590 | rc = -EOPNOTSUPP; |
592 | kfree(ntlmssp_blob); | 591 | kfree(ntlmssp_blob); |
593 | goto ssetup_exit; | 592 | goto ssetup_exit; |
@@ -595,7 +594,7 @@ ssetup_ntlmssp_authenticate: | |||
595 | security_blob = ntlmssp_blob; | 594 | security_blob = ntlmssp_blob; |
596 | } | 595 | } |
597 | } else { | 596 | } else { |
598 | cERROR(1, "illegal ntlmssp phase"); | 597 | cifs_dbg(VFS, "illegal ntlmssp phase\n"); |
599 | rc = -EIO; | 598 | rc = -EIO; |
600 | goto ssetup_exit; | 599 | goto ssetup_exit; |
601 | } | 600 | } |
@@ -620,13 +619,13 @@ ssetup_ntlmssp_authenticate: | |||
620 | if (resp_buftype != CIFS_NO_BUFFER && | 619 | if (resp_buftype != CIFS_NO_BUFFER && |
621 | rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) { | 620 | rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) { |
622 | if (phase != NtLmNegotiate) { | 621 | if (phase != NtLmNegotiate) { |
623 | cERROR(1, "Unexpected more processing error"); | 622 | cifs_dbg(VFS, "Unexpected more processing error\n"); |
624 | goto ssetup_exit; | 623 | goto ssetup_exit; |
625 | } | 624 | } |
626 | if (offsetof(struct smb2_sess_setup_rsp, Buffer) - 4 != | 625 | if (offsetof(struct smb2_sess_setup_rsp, Buffer) - 4 != |
627 | le16_to_cpu(rsp->SecurityBufferOffset)) { | 626 | le16_to_cpu(rsp->SecurityBufferOffset)) { |
628 | cERROR(1, "Invalid security buffer offset %d", | 627 | cifs_dbg(VFS, "Invalid security buffer offset %d\n", |
629 | le16_to_cpu(rsp->SecurityBufferOffset)); | 628 | le16_to_cpu(rsp->SecurityBufferOffset)); |
630 | rc = -EIO; | 629 | rc = -EIO; |
631 | goto ssetup_exit; | 630 | goto ssetup_exit; |
632 | } | 631 | } |
@@ -667,7 +666,7 @@ SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) | |||
667 | int rc = 0; | 666 | int rc = 0; |
668 | struct TCP_Server_Info *server; | 667 | struct TCP_Server_Info *server; |
669 | 668 | ||
670 | cFYI(1, "disconnect session %p", ses); | 669 | cifs_dbg(FYI, "disconnect session %p\n", ses); |
671 | 670 | ||
672 | if (ses && (ses->server)) | 671 | if (ses && (ses->server)) |
673 | server = ses->server; | 672 | server = ses->server; |
@@ -711,7 +710,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, | |||
711 | struct TCP_Server_Info *server; | 710 | struct TCP_Server_Info *server; |
712 | __le16 *unc_path = NULL; | 711 | __le16 *unc_path = NULL; |
713 | 712 | ||
714 | cFYI(1, "TCON"); | 713 | cifs_dbg(FYI, "TCON\n"); |
715 | 714 | ||
716 | if ((ses->server) && tree) | 715 | if ((ses->server) && tree) |
717 | server = ses->server; | 716 | server = ses->server; |
@@ -775,15 +774,15 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, | |||
775 | } | 774 | } |
776 | 775 | ||
777 | if (rsp->ShareType & SMB2_SHARE_TYPE_DISK) | 776 | if (rsp->ShareType & SMB2_SHARE_TYPE_DISK) |
778 | cFYI(1, "connection to disk share"); | 777 | cifs_dbg(FYI, "connection to disk share\n"); |
779 | else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) { | 778 | else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) { |
780 | tcon->ipc = true; | 779 | tcon->ipc = true; |
781 | cFYI(1, "connection to pipe share"); | 780 | cifs_dbg(FYI, "connection to pipe share\n"); |
782 | } else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) { | 781 | } else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) { |
783 | tcon->print = true; | 782 | tcon->print = true; |
784 | cFYI(1, "connection to printer"); | 783 | cifs_dbg(FYI, "connection to printer\n"); |
785 | } else { | 784 | } else { |
786 | cERROR(1, "unknown share type %d", rsp->ShareType); | 785 | cifs_dbg(VFS, "unknown share type %d\n", rsp->ShareType); |
787 | rc = -EOPNOTSUPP; | 786 | rc = -EOPNOTSUPP; |
788 | goto tcon_error_exit; | 787 | goto tcon_error_exit; |
789 | } | 788 | } |
@@ -797,7 +796,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, | |||
797 | 796 | ||
798 | if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && | 797 | if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && |
799 | ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) | 798 | ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) |
800 | cERROR(1, "DFS capability contradicts DFS flag"); | 799 | cifs_dbg(VFS, "DFS capability contradicts DFS flag\n"); |
801 | 800 | ||
802 | tcon_exit: | 801 | tcon_exit: |
803 | free_rsp_buf(resp_buftype, rsp); | 802 | free_rsp_buf(resp_buftype, rsp); |
@@ -806,7 +805,7 @@ tcon_exit: | |||
806 | 805 | ||
807 | tcon_error_exit: | 806 | tcon_error_exit: |
808 | if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) { | 807 | if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) { |
809 | cERROR(1, "BAD_NETWORK_NAME: %s", tree); | 808 | cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree); |
810 | tcon->bad_network_name = true; | 809 | tcon->bad_network_name = true; |
811 | } | 810 | } |
812 | goto tcon_exit; | 811 | goto tcon_exit; |
@@ -820,7 +819,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) | |||
820 | struct TCP_Server_Info *server; | 819 | struct TCP_Server_Info *server; |
821 | struct cifs_ses *ses = tcon->ses; | 820 | struct cifs_ses *ses = tcon->ses; |
822 | 821 | ||
823 | cFYI(1, "Tree Disconnect"); | 822 | cifs_dbg(FYI, "Tree Disconnect\n"); |
824 | 823 | ||
825 | if (ses && (ses->server)) | 824 | if (ses && (ses->server)) |
826 | server = ses->server; | 825 | server = ses->server; |
@@ -923,7 +922,7 @@ SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path, | |||
923 | int rc = 0; | 922 | int rc = 0; |
924 | int num_iovecs = 2; | 923 | int num_iovecs = 2; |
925 | 924 | ||
926 | cFYI(1, "create/open"); | 925 | cifs_dbg(FYI, "create/open\n"); |
927 | 926 | ||
928 | if (ses && (ses->server)) | 927 | if (ses && (ses->server)) |
929 | server = ses->server; | 928 | server = ses->server; |
@@ -1049,7 +1048,7 @@ SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
1049 | int resp_buftype; | 1048 | int resp_buftype; |
1050 | int rc = 0; | 1049 | int rc = 0; |
1051 | 1050 | ||
1052 | cFYI(1, "Close"); | 1051 | cifs_dbg(FYI, "Close\n"); |
1053 | 1052 | ||
1054 | if (ses && (ses->server)) | 1053 | if (ses && (ses->server)) |
1055 | server = ses->server; | 1054 | server = ses->server; |
@@ -1095,20 +1094,20 @@ validate_buf(unsigned int offset, unsigned int buffer_length, | |||
1095 | 1094 | ||
1096 | 1095 | ||
1097 | if (buffer_length < min_buf_size) { | 1096 | if (buffer_length < min_buf_size) { |
1098 | cERROR(1, "buffer length %d smaller than minimum size %d", | 1097 | cifs_dbg(VFS, "buffer length %d smaller than minimum size %d\n", |
1099 | buffer_length, min_buf_size); | 1098 | buffer_length, min_buf_size); |
1100 | return -EINVAL; | 1099 | return -EINVAL; |
1101 | } | 1100 | } |
1102 | 1101 | ||
1103 | /* check if beyond RFC1001 maximum length */ | 1102 | /* check if beyond RFC1001 maximum length */ |
1104 | if ((smb_len > 0x7FFFFF) || (buffer_length > 0x7FFFFF)) { | 1103 | if ((smb_len > 0x7FFFFF) || (buffer_length > 0x7FFFFF)) { |
1105 | cERROR(1, "buffer length %d or smb length %d too large", | 1104 | cifs_dbg(VFS, "buffer length %d or smb length %d too large\n", |
1106 | buffer_length, smb_len); | 1105 | buffer_length, smb_len); |
1107 | return -EINVAL; | 1106 | return -EINVAL; |
1108 | } | 1107 | } |
1109 | 1108 | ||
1110 | if ((begin_of_buf > end_of_smb) || (end_of_buf > end_of_smb)) { | 1109 | if ((begin_of_buf > end_of_smb) || (end_of_buf > end_of_smb)) { |
1111 | cERROR(1, "illegal server response, bad offset to data"); | 1110 | cifs_dbg(VFS, "illegal server response, bad offset to data\n"); |
1112 | return -EINVAL; | 1111 | return -EINVAL; |
1113 | } | 1112 | } |
1114 | 1113 | ||
@@ -1153,7 +1152,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
1153 | struct TCP_Server_Info *server; | 1152 | struct TCP_Server_Info *server; |
1154 | struct cifs_ses *ses = tcon->ses; | 1153 | struct cifs_ses *ses = tcon->ses; |
1155 | 1154 | ||
1156 | cFYI(1, "Query Info"); | 1155 | cifs_dbg(FYI, "Query Info\n"); |
1157 | 1156 | ||
1158 | if (ses && (ses->server)) | 1157 | if (ses && (ses->server)) |
1159 | server = ses->server; | 1158 | server = ses->server; |
@@ -1245,7 +1244,7 @@ SMB2_echo(struct TCP_Server_Info *server) | |||
1245 | struct smb_rqst rqst = { .rq_iov = &iov, | 1244 | struct smb_rqst rqst = { .rq_iov = &iov, |
1246 | .rq_nvec = 1 }; | 1245 | .rq_nvec = 1 }; |
1247 | 1246 | ||
1248 | cFYI(1, "In echo request"); | 1247 | cifs_dbg(FYI, "In echo request\n"); |
1249 | 1248 | ||
1250 | rc = small_smb2_init(SMB2_ECHO, NULL, (void **)&req); | 1249 | rc = small_smb2_init(SMB2_ECHO, NULL, (void **)&req); |
1251 | if (rc) | 1250 | if (rc) |
@@ -1260,7 +1259,7 @@ SMB2_echo(struct TCP_Server_Info *server) | |||
1260 | rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, server, | 1259 | rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, server, |
1261 | CIFS_ECHO_OP); | 1260 | CIFS_ECHO_OP); |
1262 | if (rc) | 1261 | if (rc) |
1263 | cFYI(1, "Echo request failed: %d", rc); | 1262 | cifs_dbg(FYI, "Echo request failed: %d\n", rc); |
1264 | 1263 | ||
1265 | cifs_small_buf_release(req); | 1264 | cifs_small_buf_release(req); |
1266 | return rc; | 1265 | return rc; |
@@ -1277,7 +1276,7 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, | |||
1277 | int resp_buftype; | 1276 | int resp_buftype; |
1278 | int rc = 0; | 1277 | int rc = 0; |
1279 | 1278 | ||
1280 | cFYI(1, "Flush"); | 1279 | cifs_dbg(FYI, "Flush\n"); |
1281 | 1280 | ||
1282 | if (ses && (ses->server)) | 1281 | if (ses && (ses->server)) |
1283 | server = ses->server; | 1282 | server = ses->server; |
@@ -1377,8 +1376,9 @@ smb2_readv_callback(struct mid_q_entry *mid) | |||
1377 | .rq_pagesz = rdata->pagesz, | 1376 | .rq_pagesz = rdata->pagesz, |
1378 | .rq_tailsz = rdata->tailsz }; | 1377 | .rq_tailsz = rdata->tailsz }; |
1379 | 1378 | ||
1380 | cFYI(1, "%s: mid=%llu state=%d result=%d bytes=%u", __func__, | 1379 | cifs_dbg(FYI, "%s: mid=%llu state=%d result=%d bytes=%u\n", |
1381 | mid->mid, mid->mid_state, rdata->result, rdata->bytes); | 1380 | __func__, mid->mid, mid->mid_state, rdata->result, |
1381 | rdata->bytes); | ||
1382 | 1382 | ||
1383 | switch (mid->mid_state) { | 1383 | switch (mid->mid_state) { |
1384 | case MID_RESPONSE_RECEIVED: | 1384 | case MID_RESPONSE_RECEIVED: |
@@ -1390,8 +1390,8 @@ smb2_readv_callback(struct mid_q_entry *mid) | |||
1390 | 1390 | ||
1391 | rc = smb2_verify_signature(&rqst, server); | 1391 | rc = smb2_verify_signature(&rqst, server); |
1392 | if (rc) | 1392 | if (rc) |
1393 | cERROR(1, "SMB signature verification returned " | 1393 | cifs_dbg(VFS, "SMB signature verification returned error = %d\n", |
1394 | "error = %d", rc); | 1394 | rc); |
1395 | } | 1395 | } |
1396 | /* FIXME: should this be counted toward the initiating task? */ | 1396 | /* FIXME: should this be counted toward the initiating task? */ |
1397 | task_io_account_read(rdata->bytes); | 1397 | task_io_account_read(rdata->bytes); |
@@ -1424,8 +1424,8 @@ smb2_async_readv(struct cifs_readdata *rdata) | |||
1424 | struct smb_rqst rqst = { .rq_iov = &rdata->iov, | 1424 | struct smb_rqst rqst = { .rq_iov = &rdata->iov, |
1425 | .rq_nvec = 1 }; | 1425 | .rq_nvec = 1 }; |
1426 | 1426 | ||
1427 | cFYI(1, "%s: offset=%llu bytes=%u", __func__, | 1427 | cifs_dbg(FYI, "%s: offset=%llu bytes=%u\n", |
1428 | rdata->offset, rdata->bytes); | 1428 | __func__, rdata->offset, rdata->bytes); |
1429 | 1429 | ||
1430 | io_parms.tcon = tlink_tcon(rdata->cfile->tlink); | 1430 | io_parms.tcon = tlink_tcon(rdata->cfile->tlink); |
1431 | io_parms.offset = rdata->offset; | 1431 | io_parms.offset = rdata->offset; |
@@ -1479,13 +1479,13 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, | |||
1479 | 1479 | ||
1480 | if (rc) { | 1480 | if (rc) { |
1481 | cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE); | 1481 | cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE); |
1482 | cERROR(1, "Send error in read = %d", rc); | 1482 | cifs_dbg(VFS, "Send error in read = %d\n", rc); |
1483 | } else { | 1483 | } else { |
1484 | *nbytes = le32_to_cpu(rsp->DataLength); | 1484 | *nbytes = le32_to_cpu(rsp->DataLength); |
1485 | if ((*nbytes > CIFS_MAX_MSGSIZE) || | 1485 | if ((*nbytes > CIFS_MAX_MSGSIZE) || |
1486 | (*nbytes > io_parms->length)) { | 1486 | (*nbytes > io_parms->length)) { |
1487 | cFYI(1, "bad length %d for count %d", *nbytes, | 1487 | cifs_dbg(FYI, "bad length %d for count %d\n", |
1488 | io_parms->length); | 1488 | *nbytes, io_parms->length); |
1489 | rc = -EIO; | 1489 | rc = -EIO; |
1490 | *nbytes = 0; | 1490 | *nbytes = 0; |
1491 | } | 1491 | } |
@@ -1595,7 +1595,8 @@ smb2_async_writev(struct cifs_writedata *wdata) | |||
1595 | rqst.rq_pagesz = wdata->pagesz; | 1595 | rqst.rq_pagesz = wdata->pagesz; |
1596 | rqst.rq_tailsz = wdata->tailsz; | 1596 | rqst.rq_tailsz = wdata->tailsz; |
1597 | 1597 | ||
1598 | cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); | 1598 | cifs_dbg(FYI, "async write at %llu %u bytes\n", |
1599 | wdata->offset, wdata->bytes); | ||
1599 | 1600 | ||
1600 | req->Length = cpu_to_le32(wdata->bytes); | 1601 | req->Length = cpu_to_le32(wdata->bytes); |
1601 | 1602 | ||
@@ -1668,7 +1669,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, | |||
1668 | 1669 | ||
1669 | if (rc) { | 1670 | if (rc) { |
1670 | cifs_stats_fail_inc(io_parms->tcon, SMB2_WRITE_HE); | 1671 | cifs_stats_fail_inc(io_parms->tcon, SMB2_WRITE_HE); |
1671 | cERROR(1, "Send error in write = %d", rc); | 1672 | cifs_dbg(VFS, "Send error in write = %d\n", rc); |
1672 | } else | 1673 | } else |
1673 | *nbytes = le32_to_cpu(rsp->DataLength); | 1674 | *nbytes = le32_to_cpu(rsp->DataLength); |
1674 | 1675 | ||
@@ -1694,14 +1695,14 @@ num_entries(char *bufstart, char *end_of_buf, char **lastentry, size_t size) | |||
1694 | ((char *)entryptr + next_offset); | 1695 | ((char *)entryptr + next_offset); |
1695 | 1696 | ||
1696 | if ((char *)entryptr + size > end_of_buf) { | 1697 | if ((char *)entryptr + size > end_of_buf) { |
1697 | cERROR(1, "malformed search entry would overflow"); | 1698 | cifs_dbg(VFS, "malformed search entry would overflow\n"); |
1698 | break; | 1699 | break; |
1699 | } | 1700 | } |
1700 | 1701 | ||
1701 | len = le32_to_cpu(entryptr->FileNameLength); | 1702 | len = le32_to_cpu(entryptr->FileNameLength); |
1702 | if ((char *)entryptr + len + size > end_of_buf) { | 1703 | if ((char *)entryptr + len + size > end_of_buf) { |
1703 | cERROR(1, "directory entry name would overflow frame " | 1704 | cifs_dbg(VFS, "directory entry name would overflow frame end of buf %p\n", |
1704 | "end of buf %p", end_of_buf); | 1705 | end_of_buf); |
1705 | break; | 1706 | break; |
1706 | } | 1707 | } |
1707 | 1708 | ||
@@ -1757,8 +1758,8 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, | |||
1757 | info_buf_size = sizeof(SEARCH_ID_FULL_DIR_INFO) - 1; | 1758 | info_buf_size = sizeof(SEARCH_ID_FULL_DIR_INFO) - 1; |
1758 | break; | 1759 | break; |
1759 | default: | 1760 | default: |
1760 | cERROR(1, "info level %u isn't supported", | 1761 | cifs_dbg(VFS, "info level %u isn't supported\n", |
1761 | srch_inf->info_level); | 1762 | srch_inf->info_level); |
1762 | rc = -EINVAL; | 1763 | rc = -EINVAL; |
1763 | goto qdir_exit; | 1764 | goto qdir_exit; |
1764 | } | 1765 | } |
@@ -1822,15 +1823,15 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, | |||
1822 | num_entries(srch_inf->srch_entries_start, end_of_smb, | 1823 | num_entries(srch_inf->srch_entries_start, end_of_smb, |
1823 | &srch_inf->last_entry, info_buf_size); | 1824 | &srch_inf->last_entry, info_buf_size); |
1824 | srch_inf->index_of_last_entry += srch_inf->entries_in_buffer; | 1825 | srch_inf->index_of_last_entry += srch_inf->entries_in_buffer; |
1825 | cFYI(1, "num entries %d last_index %lld srch start %p srch end %p", | 1826 | cifs_dbg(FYI, "num entries %d last_index %lld srch start %p srch end %p\n", |
1826 | srch_inf->entries_in_buffer, srch_inf->index_of_last_entry, | 1827 | srch_inf->entries_in_buffer, srch_inf->index_of_last_entry, |
1827 | srch_inf->srch_entries_start, srch_inf->last_entry); | 1828 | srch_inf->srch_entries_start, srch_inf->last_entry); |
1828 | if (resp_buftype == CIFS_LARGE_BUFFER) | 1829 | if (resp_buftype == CIFS_LARGE_BUFFER) |
1829 | srch_inf->smallBuf = false; | 1830 | srch_inf->smallBuf = false; |
1830 | else if (resp_buftype == CIFS_SMALL_BUFFER) | 1831 | else if (resp_buftype == CIFS_SMALL_BUFFER) |
1831 | srch_inf->smallBuf = true; | 1832 | srch_inf->smallBuf = true; |
1832 | else | 1833 | else |
1833 | cERROR(1, "illegal search buffer type"); | 1834 | cifs_dbg(VFS, "illegal search buffer type\n"); |
1834 | 1835 | ||
1835 | if (rsp->hdr.Status == STATUS_NO_MORE_FILES) | 1836 | if (rsp->hdr.Status == STATUS_NO_MORE_FILES) |
1836 | srch_inf->endOfSearch = 1; | 1837 | srch_inf->endOfSearch = 1; |
@@ -2015,7 +2016,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon, | |||
2015 | int rc; | 2016 | int rc; |
2016 | struct smb2_oplock_break *req = NULL; | 2017 | struct smb2_oplock_break *req = NULL; |
2017 | 2018 | ||
2018 | cFYI(1, "SMB2_oplock_break"); | 2019 | cifs_dbg(FYI, "SMB2_oplock_break\n"); |
2019 | rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req); | 2020 | rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req); |
2020 | 2021 | ||
2021 | if (rc) | 2022 | if (rc) |
@@ -2031,7 +2032,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon, | |||
2031 | 2032 | ||
2032 | if (rc) { | 2033 | if (rc) { |
2033 | cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); | 2034 | cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); |
2034 | cFYI(1, "Send error in Oplock Break = %d", rc); | 2035 | cifs_dbg(FYI, "Send error in Oplock Break = %d\n", rc); |
2035 | } | 2036 | } |
2036 | 2037 | ||
2037 | return rc; | 2038 | return rc; |
@@ -2056,7 +2057,7 @@ build_qfs_info_req(struct kvec *iov, struct cifs_tcon *tcon, int level, | |||
2056 | int rc; | 2057 | int rc; |
2057 | struct smb2_query_info_req *req; | 2058 | struct smb2_query_info_req *req; |
2058 | 2059 | ||
2059 | cFYI(1, "Query FSInfo level %d", level); | 2060 | cifs_dbg(FYI, "Query FSInfo level %d\n", level); |
2060 | 2061 | ||
2061 | if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) | 2062 | if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) |
2062 | return -EIO; | 2063 | return -EIO; |
@@ -2129,7 +2130,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, | |||
2129 | int resp_buf_type; | 2130 | int resp_buf_type; |
2130 | unsigned int count; | 2131 | unsigned int count; |
2131 | 2132 | ||
2132 | cFYI(1, "smb2_lockv num lock %d", num_lock); | 2133 | cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock); |
2133 | 2134 | ||
2134 | rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); | 2135 | rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); |
2135 | if (rc) | 2136 | if (rc) |
@@ -2153,7 +2154,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, | |||
2153 | cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); | 2154 | cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); |
2154 | rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); | 2155 | rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); |
2155 | if (rc) { | 2156 | if (rc) { |
2156 | cFYI(1, "Send error in smb2_lockv = %d", rc); | 2157 | cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc); |
2157 | cifs_stats_fail_inc(tcon, SMB2_LOCK_HE); | 2158 | cifs_stats_fail_inc(tcon, SMB2_LOCK_HE); |
2158 | } | 2159 | } |
2159 | 2160 | ||
@@ -2184,7 +2185,7 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, | |||
2184 | int rc; | 2185 | int rc; |
2185 | struct smb2_lease_ack *req = NULL; | 2186 | struct smb2_lease_ack *req = NULL; |
2186 | 2187 | ||
2187 | cFYI(1, "SMB2_lease_break"); | 2188 | cifs_dbg(FYI, "SMB2_lease_break\n"); |
2188 | rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req); | 2189 | rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req); |
2189 | 2190 | ||
2190 | if (rc) | 2191 | if (rc) |
@@ -2202,7 +2203,7 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, | |||
2202 | 2203 | ||
2203 | if (rc) { | 2204 | if (rc) { |
2204 | cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); | 2205 | cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); |
2205 | cFYI(1, "Send error in Lease Break = %d", rc); | 2206 | cifs_dbg(FYI, "Send error in Lease Break = %d\n", rc); |
2206 | } | 2207 | } |
2207 | 2208 | ||
2208 | return rc; | 2209 | return rc; |