aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c483
1 files changed, 244 insertions, 239 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 1e7a4fe1f810..728b3176984a 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -139,8 +139,8 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
139 if (smb_command != SMB_COM_WRITE_ANDX && 139 if (smb_command != SMB_COM_WRITE_ANDX &&
140 smb_command != SMB_COM_OPEN_ANDX && 140 smb_command != SMB_COM_OPEN_ANDX &&
141 smb_command != SMB_COM_TREE_DISCONNECT) { 141 smb_command != SMB_COM_TREE_DISCONNECT) {
142 cFYI(1, "can not send cmd %d while umounting", 142 cifs_dbg(FYI, "can not send cmd %d while umounting\n",
143 smb_command); 143 smb_command);
144 return -ENODEV; 144 return -ENODEV;
145 } 145 }
146 } 146 }
@@ -163,7 +163,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
163 * back on-line 163 * back on-line
164 */ 164 */
165 if (!tcon->retry) { 165 if (!tcon->retry) {
166 cFYI(1, "gave up waiting on reconnect in smb_init"); 166 cifs_dbg(FYI, "gave up waiting on reconnect in smb_init\n");
167 return -EHOSTDOWN; 167 return -EHOSTDOWN;
168 } 168 }
169 } 169 }
@@ -191,7 +191,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
191 cifs_mark_open_files_invalid(tcon); 191 cifs_mark_open_files_invalid(tcon);
192 rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage); 192 rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage);
193 mutex_unlock(&ses->session_mutex); 193 mutex_unlock(&ses->session_mutex);
194 cFYI(1, "reconnect tcon rc = %d", rc); 194 cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
195 195
196 if (rc) 196 if (rc)
197 goto out; 197 goto out;
@@ -396,7 +396,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
396 else /* if override flags set only sign/seal OR them with global auth */ 396 else /* if override flags set only sign/seal OR them with global auth */
397 secFlags = global_secflags | ses->overrideSecFlg; 397 secFlags = global_secflags | ses->overrideSecFlg;
398 398
399 cFYI(1, "secFlags 0x%x", secFlags); 399 cifs_dbg(FYI, "secFlags 0x%x\n", secFlags);
400 400
401 pSMB->hdr.Mid = get_next_mid(server); 401 pSMB->hdr.Mid = get_next_mid(server);
402 pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS); 402 pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS);
@@ -404,12 +404,12 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
404 if ((secFlags & CIFSSEC_MUST_KRB5) == CIFSSEC_MUST_KRB5) 404 if ((secFlags & CIFSSEC_MUST_KRB5) == CIFSSEC_MUST_KRB5)
405 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; 405 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
406 else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_KRB5) { 406 else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_KRB5) {
407 cFYI(1, "Kerberos only mechanism, enable extended security"); 407 cifs_dbg(FYI, "Kerberos only mechanism, enable extended security\n");
408 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; 408 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
409 } else if ((secFlags & CIFSSEC_MUST_NTLMSSP) == CIFSSEC_MUST_NTLMSSP) 409 } else if ((secFlags & CIFSSEC_MUST_NTLMSSP) == CIFSSEC_MUST_NTLMSSP)
410 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; 410 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
411 else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_NTLMSSP) { 411 else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_NTLMSSP) {
412 cFYI(1, "NTLMSSP only mechanism, enable extended security"); 412 cifs_dbg(FYI, "NTLMSSP only mechanism, enable extended security\n");
413 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; 413 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
414 } 414 }
415 415
@@ -428,7 +428,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
428 goto neg_err_exit; 428 goto neg_err_exit;
429 429
430 server->dialect = le16_to_cpu(pSMBr->DialectIndex); 430 server->dialect = le16_to_cpu(pSMBr->DialectIndex);
431 cFYI(1, "Dialect: %d", server->dialect); 431 cifs_dbg(FYI, "Dialect: %d\n", server->dialect);
432 /* Check wct = 1 error case */ 432 /* Check wct = 1 error case */
433 if ((pSMBr->hdr.WordCount < 13) || (server->dialect == BAD_PROT)) { 433 if ((pSMBr->hdr.WordCount < 13) || (server->dialect == BAD_PROT)) {
434 /* core returns wct = 1, but we do not ask for core - otherwise 434 /* core returns wct = 1, but we do not ask for core - otherwise
@@ -447,8 +447,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
447 (secFlags & CIFSSEC_MAY_PLNTXT)) 447 (secFlags & CIFSSEC_MAY_PLNTXT))
448 server->secType = LANMAN; 448 server->secType = LANMAN;
449 else { 449 else {
450 cERROR(1, "mount failed weak security disabled" 450 cifs_dbg(VFS, "mount failed weak security disabled in /proc/fs/cifs/SecurityFlags\n");
451 " in /proc/fs/cifs/SecurityFlags");
452 rc = -EOPNOTSUPP; 451 rc = -EOPNOTSUPP;
453 goto neg_err_exit; 452 goto neg_err_exit;
454 } 453 }
@@ -482,9 +481,9 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
482 utc = CURRENT_TIME; 481 utc = CURRENT_TIME;
483 ts = cnvrtDosUnixTm(rsp->SrvTime.Date, 482 ts = cnvrtDosUnixTm(rsp->SrvTime.Date,
484 rsp->SrvTime.Time, 0); 483 rsp->SrvTime.Time, 0);
485 cFYI(1, "SrvTime %d sec since 1970 (utc: %d) diff: %d", 484 cifs_dbg(FYI, "SrvTime %d sec since 1970 (utc: %d) diff: %d\n",
486 (int)ts.tv_sec, (int)utc.tv_sec, 485 (int)ts.tv_sec, (int)utc.tv_sec,
487 (int)(utc.tv_sec - ts.tv_sec)); 486 (int)(utc.tv_sec - ts.tv_sec));
488 val = (int)(utc.tv_sec - ts.tv_sec); 487 val = (int)(utc.tv_sec - ts.tv_sec);
489 seconds = abs(val); 488 seconds = abs(val);
490 result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ; 489 result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ;
@@ -498,7 +497,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
498 server->timeAdj = (int)tmp; 497 server->timeAdj = (int)tmp;
499 server->timeAdj *= 60; /* also in seconds */ 498 server->timeAdj *= 60; /* also in seconds */
500 } 499 }
501 cFYI(1, "server->timeAdj: %d seconds", server->timeAdj); 500 cifs_dbg(FYI, "server->timeAdj: %d seconds\n", server->timeAdj);
502 501
503 502
504 /* BB get server time for time conversions and add 503 /* BB get server time for time conversions and add
@@ -513,14 +512,13 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
513 goto neg_err_exit; 512 goto neg_err_exit;
514 } 513 }
515 514
516 cFYI(1, "LANMAN negotiated"); 515 cifs_dbg(FYI, "LANMAN negotiated\n");
517 /* we will not end up setting signing flags - as no signing 516 /* we will not end up setting signing flags - as no signing
518 was in LANMAN and server did not return the flags on */ 517 was in LANMAN and server did not return the flags on */
519 goto signing_check; 518 goto signing_check;
520#else /* weak security disabled */ 519#else /* weak security disabled */
521 } else if (pSMBr->hdr.WordCount == 13) { 520 } else if (pSMBr->hdr.WordCount == 13) {
522 cERROR(1, "mount failed, cifs module not built " 521 cifs_dbg(VFS, "mount failed, cifs module not built with CIFS_WEAK_PW_HASH support\n");
523 "with CIFS_WEAK_PW_HASH support");
524 rc = -EOPNOTSUPP; 522 rc = -EOPNOTSUPP;
525#endif /* WEAK_PW_HASH */ 523#endif /* WEAK_PW_HASH */
526 goto neg_err_exit; 524 goto neg_err_exit;
@@ -532,14 +530,13 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
532 /* else wct == 17 NTLM */ 530 /* else wct == 17 NTLM */
533 server->sec_mode = pSMBr->SecurityMode; 531 server->sec_mode = pSMBr->SecurityMode;
534 if ((server->sec_mode & SECMODE_USER) == 0) 532 if ((server->sec_mode & SECMODE_USER) == 0)
535 cFYI(1, "share mode security"); 533 cifs_dbg(FYI, "share mode security\n");
536 534
537 if ((server->sec_mode & SECMODE_PW_ENCRYPT) == 0) 535 if ((server->sec_mode & SECMODE_PW_ENCRYPT) == 0)
538#ifdef CONFIG_CIFS_WEAK_PW_HASH 536#ifdef CONFIG_CIFS_WEAK_PW_HASH
539 if ((secFlags & CIFSSEC_MAY_PLNTXT) == 0) 537 if ((secFlags & CIFSSEC_MAY_PLNTXT) == 0)
540#endif /* CIFS_WEAK_PW_HASH */ 538#endif /* CIFS_WEAK_PW_HASH */
541 cERROR(1, "Server requests plain text password" 539 cifs_dbg(VFS, "Server requests plain text password but client support disabled\n");
542 " but client support disabled");
543 540
544 if ((secFlags & CIFSSEC_MUST_NTLMV2) == CIFSSEC_MUST_NTLMV2) 541 if ((secFlags & CIFSSEC_MUST_NTLMV2) == CIFSSEC_MUST_NTLMV2)
545 server->secType = NTLMv2; 542 server->secType = NTLMv2;
@@ -555,7 +552,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
555 server->secType = LANMAN; 552 server->secType = LANMAN;
556 else { 553 else {
557 rc = -EOPNOTSUPP; 554 rc = -EOPNOTSUPP;
558 cERROR(1, "Invalid security type"); 555 cifs_dbg(VFS, "Invalid security type\n");
559 goto neg_err_exit; 556 goto neg_err_exit;
560 } 557 }
561 /* else ... any others ...? */ 558 /* else ... any others ...? */
@@ -568,7 +565,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
568 /* probably no need to store and check maxvcs */ 565 /* probably no need to store and check maxvcs */
569 server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize); 566 server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize);
570 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize); 567 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
571 cFYI(DBG2, "Max buf = %d", ses->server->maxBuf); 568 cifs_dbg(NOISY, "Max buf = %d\n", ses->server->maxBuf);
572 server->capabilities = le32_to_cpu(pSMBr->Capabilities); 569 server->capabilities = le32_to_cpu(pSMBr->Capabilities);
573 server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone); 570 server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone);
574 server->timeAdj *= 60; 571 server->timeAdj *= 60;
@@ -590,7 +587,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
590 if (memcmp(server->server_GUID, 587 if (memcmp(server->server_GUID,
591 pSMBr->u.extended_response. 588 pSMBr->u.extended_response.
592 GUID, 16) != 0) { 589 GUID, 16) != 0) {
593 cFYI(1, "server UID changed"); 590 cifs_dbg(FYI, "server UID changed\n");
594 memcpy(server->server_GUID, 591 memcpy(server->server_GUID,
595 pSMBr->u.extended_response.GUID, 592 pSMBr->u.extended_response.GUID,
596 16); 593 16);
@@ -633,21 +630,19 @@ signing_check:
633 if ((secFlags & CIFSSEC_MAY_SIGN) == 0) { 630 if ((secFlags & CIFSSEC_MAY_SIGN) == 0) {
634 /* MUST_SIGN already includes the MAY_SIGN FLAG 631 /* MUST_SIGN already includes the MAY_SIGN FLAG
635 so if this is zero it means that signing is disabled */ 632 so if this is zero it means that signing is disabled */
636 cFYI(1, "Signing disabled"); 633 cifs_dbg(FYI, "Signing disabled\n");
637 if (server->sec_mode & SECMODE_SIGN_REQUIRED) { 634 if (server->sec_mode & SECMODE_SIGN_REQUIRED) {
638 cERROR(1, "Server requires " 635 cifs_dbg(VFS, "Server requires packet signing to be enabled in /proc/fs/cifs/SecurityFlags\n");
639 "packet signing to be enabled in "
640 "/proc/fs/cifs/SecurityFlags.");
641 rc = -EOPNOTSUPP; 636 rc = -EOPNOTSUPP;
642 } 637 }
643 server->sec_mode &= 638 server->sec_mode &=
644 ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); 639 ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED);
645 } else if ((secFlags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { 640 } else if ((secFlags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) {
646 /* signing required */ 641 /* signing required */
647 cFYI(1, "Must sign - secFlags 0x%x", secFlags); 642 cifs_dbg(FYI, "Must sign - secFlags 0x%x\n", secFlags);
648 if ((server->sec_mode & 643 if ((server->sec_mode &
649 (SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED)) == 0) { 644 (SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED)) == 0) {
650 cERROR(1, "signing required but server lacks support"); 645 cifs_dbg(VFS, "signing required but server lacks support\n");
651 rc = -EOPNOTSUPP; 646 rc = -EOPNOTSUPP;
652 } else 647 } else
653 server->sec_mode |= SECMODE_SIGN_REQUIRED; 648 server->sec_mode |= SECMODE_SIGN_REQUIRED;
@@ -661,7 +656,7 @@ signing_check:
661neg_err_exit: 656neg_err_exit:
662 cifs_buf_release(pSMB); 657 cifs_buf_release(pSMB);
663 658
664 cFYI(1, "negprot rc %d", rc); 659 cifs_dbg(FYI, "negprot rc %d\n", rc);
665 return rc; 660 return rc;
666} 661}
667 662
@@ -671,7 +666,7 @@ CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon)
671 struct smb_hdr *smb_buffer; 666 struct smb_hdr *smb_buffer;
672 int rc = 0; 667 int rc = 0;
673 668
674 cFYI(1, "In tree disconnect"); 669 cifs_dbg(FYI, "In tree disconnect\n");
675 670
676 /* BB: do we need to check this? These should never be NULL. */ 671 /* BB: do we need to check this? These should never be NULL. */
677 if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) 672 if ((tcon->ses == NULL) || (tcon->ses->server == NULL))
@@ -693,7 +688,7 @@ CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon)
693 688
694 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)smb_buffer, 0); 689 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)smb_buffer, 0);
695 if (rc) 690 if (rc)
696 cFYI(1, "Tree disconnect failed %d", rc); 691 cifs_dbg(FYI, "Tree disconnect failed %d\n", rc);
697 692
698 /* No need to return error on this operation if tid invalidated and 693 /* No need to return error on this operation if tid invalidated and
699 closed on server already e.g. due to tcp session crashing */ 694 closed on server already e.g. due to tcp session crashing */
@@ -728,7 +723,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
728 struct smb_rqst rqst = { .rq_iov = &iov, 723 struct smb_rqst rqst = { .rq_iov = &iov,
729 .rq_nvec = 1 }; 724 .rq_nvec = 1 };
730 725
731 cFYI(1, "In echo request"); 726 cifs_dbg(FYI, "In echo request\n");
732 727
733 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb); 728 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb);
734 if (rc) 729 if (rc)
@@ -747,7 +742,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
747 rc = cifs_call_async(server, &rqst, NULL, cifs_echo_callback, 742 rc = cifs_call_async(server, &rqst, NULL, cifs_echo_callback,
748 server, CIFS_ASYNC_OP | CIFS_ECHO_OP); 743 server, CIFS_ASYNC_OP | CIFS_ECHO_OP);
749 if (rc) 744 if (rc)
750 cFYI(1, "Echo request failed: %d", rc); 745 cifs_dbg(FYI, "Echo request failed: %d\n", rc);
751 746
752 cifs_small_buf_release(smb); 747 cifs_small_buf_release(smb);
753 748
@@ -760,7 +755,7 @@ CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses)
760 LOGOFF_ANDX_REQ *pSMB; 755 LOGOFF_ANDX_REQ *pSMB;
761 int rc = 0; 756 int rc = 0;
762 757
763 cFYI(1, "In SMBLogoff for session disconnect"); 758 cifs_dbg(FYI, "In SMBLogoff for session disconnect\n");
764 759
765 /* 760 /*
766 * BB: do we need to check validity of ses and server? They should 761 * BB: do we need to check validity of ses and server? They should
@@ -814,7 +809,7 @@ CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
814 int bytes_returned = 0; 809 int bytes_returned = 0;
815 __u16 params, param_offset, offset, byte_count; 810 __u16 params, param_offset, offset, byte_count;
816 811
817 cFYI(1, "In POSIX delete"); 812 cifs_dbg(FYI, "In POSIX delete\n");
818PsxDelete: 813PsxDelete:
819 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 814 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
820 (void **) &pSMBr); 815 (void **) &pSMBr);
@@ -866,7 +861,7 @@ PsxDelete:
866 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 861 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
867 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 862 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
868 if (rc) 863 if (rc)
869 cFYI(1, "Posix delete returned %d", rc); 864 cifs_dbg(FYI, "Posix delete returned %d\n", rc);
870 cifs_buf_release(pSMB); 865 cifs_buf_release(pSMB);
871 866
872 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes); 867 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes);
@@ -914,7 +909,7 @@ DelFileRetry:
914 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 909 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
915 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes); 910 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes);
916 if (rc) 911 if (rc)
917 cFYI(1, "Error in RMFile = %d", rc); 912 cifs_dbg(FYI, "Error in RMFile = %d\n", rc);
918 913
919 cifs_buf_release(pSMB); 914 cifs_buf_release(pSMB);
920 if (rc == -EAGAIN) 915 if (rc == -EAGAIN)
@@ -934,7 +929,7 @@ CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
934 int name_len; 929 int name_len;
935 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 930 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
936 931
937 cFYI(1, "In CIFSSMBRmDir"); 932 cifs_dbg(FYI, "In CIFSSMBRmDir\n");
938RmDirRetry: 933RmDirRetry:
939 rc = smb_init(SMB_COM_DELETE_DIRECTORY, 0, tcon, (void **) &pSMB, 934 rc = smb_init(SMB_COM_DELETE_DIRECTORY, 0, tcon, (void **) &pSMB,
940 (void **) &pSMBr); 935 (void **) &pSMBr);
@@ -960,7 +955,7 @@ RmDirRetry:
960 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 955 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
961 cifs_stats_inc(&tcon->stats.cifs_stats.num_rmdirs); 956 cifs_stats_inc(&tcon->stats.cifs_stats.num_rmdirs);
962 if (rc) 957 if (rc)
963 cFYI(1, "Error in RMDir = %d", rc); 958 cifs_dbg(FYI, "Error in RMDir = %d\n", rc);
964 959
965 cifs_buf_release(pSMB); 960 cifs_buf_release(pSMB);
966 if (rc == -EAGAIN) 961 if (rc == -EAGAIN)
@@ -979,7 +974,7 @@ CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
979 int name_len; 974 int name_len;
980 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 975 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
981 976
982 cFYI(1, "In CIFSSMBMkDir"); 977 cifs_dbg(FYI, "In CIFSSMBMkDir\n");
983MkDirRetry: 978MkDirRetry:
984 rc = smb_init(SMB_COM_CREATE_DIRECTORY, 0, tcon, (void **) &pSMB, 979 rc = smb_init(SMB_COM_CREATE_DIRECTORY, 0, tcon, (void **) &pSMB,
985 (void **) &pSMBr); 980 (void **) &pSMBr);
@@ -1005,7 +1000,7 @@ MkDirRetry:
1005 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 1000 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
1006 cifs_stats_inc(&tcon->stats.cifs_stats.num_mkdirs); 1001 cifs_stats_inc(&tcon->stats.cifs_stats.num_mkdirs);
1007 if (rc) 1002 if (rc)
1008 cFYI(1, "Error in Mkdir = %d", rc); 1003 cifs_dbg(FYI, "Error in Mkdir = %d\n", rc);
1009 1004
1010 cifs_buf_release(pSMB); 1005 cifs_buf_release(pSMB);
1011 if (rc == -EAGAIN) 1006 if (rc == -EAGAIN)
@@ -1029,7 +1024,7 @@ CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
1029 OPEN_PSX_REQ *pdata; 1024 OPEN_PSX_REQ *pdata;
1030 OPEN_PSX_RSP *psx_rsp; 1025 OPEN_PSX_RSP *psx_rsp;
1031 1026
1032 cFYI(1, "In POSIX Create"); 1027 cifs_dbg(FYI, "In POSIX Create\n");
1033PsxCreat: 1028PsxCreat:
1034 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 1029 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
1035 (void **) &pSMBr); 1030 (void **) &pSMBr);
@@ -1083,11 +1078,11 @@ PsxCreat:
1083 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1078 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1084 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 1079 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
1085 if (rc) { 1080 if (rc) {
1086 cFYI(1, "Posix create returned %d", rc); 1081 cifs_dbg(FYI, "Posix create returned %d\n", rc);
1087 goto psx_create_err; 1082 goto psx_create_err;
1088 } 1083 }
1089 1084
1090 cFYI(1, "copying inode info"); 1085 cifs_dbg(FYI, "copying inode info\n");
1091 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 1086 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
1092 1087
1093 if (rc || get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP)) { 1088 if (rc || get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP)) {
@@ -1109,11 +1104,11 @@ PsxCreat:
1109 /* check to make sure response data is there */ 1104 /* check to make sure response data is there */
1110 if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) { 1105 if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) {
1111 pRetData->Type = cpu_to_le32(-1); /* unknown */ 1106 pRetData->Type = cpu_to_le32(-1); /* unknown */
1112 cFYI(DBG2, "unknown type"); 1107 cifs_dbg(NOISY, "unknown type\n");
1113 } else { 1108 } else {
1114 if (get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP) 1109 if (get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP)
1115 + sizeof(FILE_UNIX_BASIC_INFO)) { 1110 + sizeof(FILE_UNIX_BASIC_INFO)) {
1116 cERROR(1, "Open response data too small"); 1111 cifs_dbg(VFS, "Open response data too small\n");
1117 pRetData->Type = cpu_to_le32(-1); 1112 pRetData->Type = cpu_to_le32(-1);
1118 goto psx_create_err; 1113 goto psx_create_err;
1119 } 1114 }
@@ -1160,7 +1155,7 @@ static __u16 convert_disposition(int disposition)
1160 ofun = SMBOPEN_OCREATE | SMBOPEN_OTRUNC; 1155 ofun = SMBOPEN_OCREATE | SMBOPEN_OTRUNC;
1161 break; 1156 break;
1162 default: 1157 default:
1163 cFYI(1, "unknown disposition %d", disposition); 1158 cifs_dbg(FYI, "unknown disposition %d\n", disposition);
1164 ofun = SMBOPEN_OAPPEND; /* regular open */ 1159 ofun = SMBOPEN_OAPPEND; /* regular open */
1165 } 1160 }
1166 return ofun; 1161 return ofun;
@@ -1251,7 +1246,7 @@ OldOpenRetry:
1251 (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1246 (struct smb_hdr *)pSMBr, &bytes_returned, 0);
1252 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens); 1247 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
1253 if (rc) { 1248 if (rc) {
1254 cFYI(1, "Error in Open = %d", rc); 1249 cifs_dbg(FYI, "Error in Open = %d\n", rc);
1255 } else { 1250 } else {
1256 /* BB verify if wct == 15 */ 1251 /* BB verify if wct == 15 */
1257 1252
@@ -1364,7 +1359,7 @@ openRetry:
1364 (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1359 (struct smb_hdr *)pSMBr, &bytes_returned, 0);
1365 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens); 1360 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
1366 if (rc) { 1361 if (rc) {
1367 cFYI(1, "Error in Open = %d", rc); 1362 cifs_dbg(FYI, "Error in Open = %d\n", rc);
1368 } else { 1363 } else {
1369 *pOplock = pSMBr->OplockLevel; /* 1 byte no need to le_to_cpu */ 1364 *pOplock = pSMBr->OplockLevel; /* 1 byte no need to le_to_cpu */
1370 *netfid = pSMBr->Fid; /* cifs fid stays in le */ 1365 *netfid = pSMBr->Fid; /* cifs fid stays in le */
@@ -1425,8 +1420,8 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1425 char *buf = server->smallbuf; 1420 char *buf = server->smallbuf;
1426 unsigned int buflen = get_rfc1002_length(buf) + 4; 1421 unsigned int buflen = get_rfc1002_length(buf) + 4;
1427 1422
1428 cFYI(1, "%s: mid=%llu offset=%llu bytes=%u", __func__, 1423 cifs_dbg(FYI, "%s: mid=%llu offset=%llu bytes=%u\n",
1429 mid->mid, rdata->offset, rdata->bytes); 1424 __func__, mid->mid, rdata->offset, rdata->bytes);
1430 1425
1431 /* 1426 /*
1432 * read the rest of READ_RSP header (sans Data array), or whatever we 1427 * read the rest of READ_RSP header (sans Data array), or whatever we
@@ -1447,16 +1442,16 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1447 /* Was the SMB read successful? */ 1442 /* Was the SMB read successful? */
1448 rdata->result = server->ops->map_error(buf, false); 1443 rdata->result = server->ops->map_error(buf, false);
1449 if (rdata->result != 0) { 1444 if (rdata->result != 0) {
1450 cFYI(1, "%s: server returned error %d", __func__, 1445 cifs_dbg(FYI, "%s: server returned error %d\n",
1451 rdata->result); 1446 __func__, rdata->result);
1452 return cifs_readv_discard(server, mid); 1447 return cifs_readv_discard(server, mid);
1453 } 1448 }
1454 1449
1455 /* Is there enough to get to the rest of the READ_RSP header? */ 1450 /* Is there enough to get to the rest of the READ_RSP header? */
1456 if (server->total_read < server->vals->read_rsp_size) { 1451 if (server->total_read < server->vals->read_rsp_size) {
1457 cFYI(1, "%s: server returned short header. got=%u expected=%zu", 1452 cifs_dbg(FYI, "%s: server returned short header. got=%u expected=%zu\n",
1458 __func__, server->total_read, 1453 __func__, server->total_read,
1459 server->vals->read_rsp_size); 1454 server->vals->read_rsp_size);
1460 rdata->result = -EIO; 1455 rdata->result = -EIO;
1461 return cifs_readv_discard(server, mid); 1456 return cifs_readv_discard(server, mid);
1462 } 1457 }
@@ -1468,19 +1463,19 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1468 * is beyond the EOF. Treat it as if the data starts just after 1463 * is beyond the EOF. Treat it as if the data starts just after
1469 * the header. 1464 * the header.
1470 */ 1465 */
1471 cFYI(1, "%s: data offset (%u) inside read response header", 1466 cifs_dbg(FYI, "%s: data offset (%u) inside read response header\n",
1472 __func__, data_offset); 1467 __func__, data_offset);
1473 data_offset = server->total_read; 1468 data_offset = server->total_read;
1474 } else if (data_offset > MAX_CIFS_SMALL_BUFFER_SIZE) { 1469 } else if (data_offset > MAX_CIFS_SMALL_BUFFER_SIZE) {
1475 /* data_offset is beyond the end of smallbuf */ 1470 /* data_offset is beyond the end of smallbuf */
1476 cFYI(1, "%s: data offset (%u) beyond end of smallbuf", 1471 cifs_dbg(FYI, "%s: data offset (%u) beyond end of smallbuf\n",
1477 __func__, data_offset); 1472 __func__, data_offset);
1478 rdata->result = -EIO; 1473 rdata->result = -EIO;
1479 return cifs_readv_discard(server, mid); 1474 return cifs_readv_discard(server, mid);
1480 } 1475 }
1481 1476
1482 cFYI(1, "%s: total_read=%u data_offset=%u", __func__, 1477 cifs_dbg(FYI, "%s: total_read=%u data_offset=%u\n",
1483 server->total_read, data_offset); 1478 __func__, server->total_read, data_offset);
1484 1479
1485 len = data_offset - server->total_read; 1480 len = data_offset - server->total_read;
1486 if (len > 0) { 1481 if (len > 0) {
@@ -1496,8 +1491,8 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1496 /* set up first iov for signature check */ 1491 /* set up first iov for signature check */
1497 rdata->iov.iov_base = buf; 1492 rdata->iov.iov_base = buf;
1498 rdata->iov.iov_len = server->total_read; 1493 rdata->iov.iov_len = server->total_read;
1499 cFYI(1, "0: iov_base=%p iov_len=%zu", 1494 cifs_dbg(FYI, "0: iov_base=%p iov_len=%zu\n",
1500 rdata->iov.iov_base, rdata->iov.iov_len); 1495 rdata->iov.iov_base, rdata->iov.iov_len);
1501 1496
1502 /* how much data is in the response? */ 1497 /* how much data is in the response? */
1503 data_len = server->ops->read_data_length(buf); 1498 data_len = server->ops->read_data_length(buf);
@@ -1514,8 +1509,8 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1514 server->total_read += length; 1509 server->total_read += length;
1515 rdata->bytes = length; 1510 rdata->bytes = length;
1516 1511
1517 cFYI(1, "total_read=%u buflen=%u remaining=%u", server->total_read, 1512 cifs_dbg(FYI, "total_read=%u buflen=%u remaining=%u\n",
1518 buflen, data_len); 1513 server->total_read, buflen, data_len);
1519 1514
1520 /* discard anything left over */ 1515 /* discard anything left over */
1521 if (server->total_read < buflen) 1516 if (server->total_read < buflen)
@@ -1538,8 +1533,9 @@ cifs_readv_callback(struct mid_q_entry *mid)
1538 .rq_pagesz = rdata->pagesz, 1533 .rq_pagesz = rdata->pagesz,
1539 .rq_tailsz = rdata->tailsz }; 1534 .rq_tailsz = rdata->tailsz };
1540 1535
1541 cFYI(1, "%s: mid=%llu state=%d result=%d bytes=%u", __func__, 1536 cifs_dbg(FYI, "%s: mid=%llu state=%d result=%d bytes=%u\n",
1542 mid->mid, mid->mid_state, rdata->result, rdata->bytes); 1537 __func__, mid->mid, mid->mid_state, rdata->result,
1538 rdata->bytes);
1543 1539
1544 switch (mid->mid_state) { 1540 switch (mid->mid_state) {
1545 case MID_RESPONSE_RECEIVED: 1541 case MID_RESPONSE_RECEIVED:
@@ -1551,8 +1547,8 @@ cifs_readv_callback(struct mid_q_entry *mid)
1551 rc = cifs_verify_signature(&rqst, server, 1547 rc = cifs_verify_signature(&rqst, server,
1552 mid->sequence_number + 1); 1548 mid->sequence_number + 1);
1553 if (rc) 1549 if (rc)
1554 cERROR(1, "SMB signature verification returned " 1550 cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
1555 "error = %d", rc); 1551 rc);
1556 } 1552 }
1557 /* FIXME: should this be counted toward the initiating task? */ 1553 /* FIXME: should this be counted toward the initiating task? */
1558 task_io_account_read(rdata->bytes); 1554 task_io_account_read(rdata->bytes);
@@ -1582,8 +1578,8 @@ cifs_async_readv(struct cifs_readdata *rdata)
1582 struct smb_rqst rqst = { .rq_iov = &rdata->iov, 1578 struct smb_rqst rqst = { .rq_iov = &rdata->iov,
1583 .rq_nvec = 1 }; 1579 .rq_nvec = 1 };
1584 1580
1585 cFYI(1, "%s: offset=%llu bytes=%u", __func__, 1581 cifs_dbg(FYI, "%s: offset=%llu bytes=%u\n",
1586 rdata->offset, rdata->bytes); 1582 __func__, rdata->offset, rdata->bytes);
1587 1583
1588 if (tcon->ses->capabilities & CAP_LARGE_FILES) 1584 if (tcon->ses->capabilities & CAP_LARGE_FILES)
1589 wct = 12; 1585 wct = 12;
@@ -1653,7 +1649,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1653 struct cifs_tcon *tcon = io_parms->tcon; 1649 struct cifs_tcon *tcon = io_parms->tcon;
1654 unsigned int count = io_parms->length; 1650 unsigned int count = io_parms->length;
1655 1651
1656 cFYI(1, "Reading %d bytes on fid %d", count, netfid); 1652 cifs_dbg(FYI, "Reading %d bytes on fid %d\n", count, netfid);
1657 if (tcon->ses->capabilities & CAP_LARGE_FILES) 1653 if (tcon->ses->capabilities & CAP_LARGE_FILES)
1658 wct = 12; 1654 wct = 12;
1659 else { 1655 else {
@@ -1701,7 +1697,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1701 cifs_stats_inc(&tcon->stats.cifs_stats.num_reads); 1697 cifs_stats_inc(&tcon->stats.cifs_stats.num_reads);
1702 pSMBr = (READ_RSP *)iov[0].iov_base; 1698 pSMBr = (READ_RSP *)iov[0].iov_base;
1703 if (rc) { 1699 if (rc) {
1704 cERROR(1, "Send error in read = %d", rc); 1700 cifs_dbg(VFS, "Send error in read = %d\n", rc);
1705 } else { 1701 } else {
1706 int data_length = le16_to_cpu(pSMBr->DataLengthHigh); 1702 int data_length = le16_to_cpu(pSMBr->DataLengthHigh);
1707 data_length = data_length << 16; 1703 data_length = data_length << 16;
@@ -1711,7 +1707,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1711 /*check that DataLength would not go beyond end of SMB */ 1707 /*check that DataLength would not go beyond end of SMB */
1712 if ((data_length > CIFSMaxBufSize) 1708 if ((data_length > CIFSMaxBufSize)
1713 || (data_length > count)) { 1709 || (data_length > count)) {
1714 cFYI(1, "bad length %d for count %d", 1710 cifs_dbg(FYI, "bad length %d for count %d\n",
1715 data_length, count); 1711 data_length, count);
1716 rc = -EIO; 1712 rc = -EIO;
1717 *nbytes = 0; 1713 *nbytes = 0;
@@ -1719,7 +1715,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1719 pReadData = (char *) (&pSMBr->hdr.Protocol) + 1715 pReadData = (char *) (&pSMBr->hdr.Protocol) +
1720 le16_to_cpu(pSMBr->DataOffset); 1716 le16_to_cpu(pSMBr->DataOffset);
1721/* if (rc = copy_to_user(buf, pReadData, data_length)) { 1717/* if (rc = copy_to_user(buf, pReadData, data_length)) {
1722 cERROR(1, "Faulting on read rc = %d",rc); 1718 cifs_dbg(VFS, "Faulting on read rc = %d\n",rc);
1723 rc = -EFAULT; 1719 rc = -EFAULT;
1724 }*/ /* can not use copy_to_user when using page cache*/ 1720 }*/ /* can not use copy_to_user when using page cache*/
1725 if (*buf) 1721 if (*buf)
@@ -1767,7 +1763,7 @@ CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
1767 1763
1768 *nbytes = 0; 1764 *nbytes = 0;
1769 1765
1770 /* cFYI(1, "write at %lld %d bytes", offset, count);*/ 1766 /* cifs_dbg(FYI, "write at %lld %d bytes\n", offset, count);*/
1771 if (tcon->ses == NULL) 1767 if (tcon->ses == NULL)
1772 return -ECONNABORTED; 1768 return -ECONNABORTED;
1773 1769
@@ -1852,7 +1848,7 @@ CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
1852 (struct smb_hdr *) pSMBr, &bytes_returned, long_op); 1848 (struct smb_hdr *) pSMBr, &bytes_returned, long_op);
1853 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes); 1849 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
1854 if (rc) { 1850 if (rc) {
1855 cFYI(1, "Send error in write = %d", rc); 1851 cifs_dbg(FYI, "Send error in write = %d\n", rc);
1856 } else { 1852 } else {
1857 *nbytes = le16_to_cpu(pSMBr->CountHigh); 1853 *nbytes = le16_to_cpu(pSMBr->CountHigh);
1858 *nbytes = (*nbytes) << 16; 1854 *nbytes = (*nbytes) << 16;
@@ -1959,7 +1955,7 @@ cifs_writedata_alloc(unsigned int nr_pages, work_func_t complete)
1959 1955
1960 /* this would overflow */ 1956 /* this would overflow */
1961 if (nr_pages == 0) { 1957 if (nr_pages == 0) {
1962 cERROR(1, "%s: called with nr_pages == 0!", __func__); 1958 cifs_dbg(VFS, "%s: called with nr_pages == 0!\n", __func__);
1963 return NULL; 1959 return NULL;
1964 } 1960 }
1965 1961
@@ -2075,7 +2071,8 @@ cifs_async_writev(struct cifs_writedata *wdata)
2075 rqst.rq_pagesz = wdata->pagesz; 2071 rqst.rq_pagesz = wdata->pagesz;
2076 rqst.rq_tailsz = wdata->tailsz; 2072 rqst.rq_tailsz = wdata->tailsz;
2077 2073
2078 cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); 2074 cifs_dbg(FYI, "async write at %llu %u bytes\n",
2075 wdata->offset, wdata->bytes);
2079 2076
2080 smb->DataLengthLow = cpu_to_le16(wdata->bytes & 0xFFFF); 2077 smb->DataLengthLow = cpu_to_le16(wdata->bytes & 0xFFFF);
2081 smb->DataLengthHigh = cpu_to_le16(wdata->bytes >> 16); 2078 smb->DataLengthHigh = cpu_to_le16(wdata->bytes >> 16);
@@ -2123,7 +2120,7 @@ CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
2123 2120
2124 *nbytes = 0; 2121 *nbytes = 0;
2125 2122
2126 cFYI(1, "write2 at %lld %d bytes", (long long)offset, count); 2123 cifs_dbg(FYI, "write2 at %lld %d bytes\n", (long long)offset, count);
2127 2124
2128 if (tcon->ses->capabilities & CAP_LARGE_FILES) { 2125 if (tcon->ses->capabilities & CAP_LARGE_FILES) {
2129 wct = 14; 2126 wct = 14;
@@ -2182,7 +2179,7 @@ CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
2182 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type, 0); 2179 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type, 0);
2183 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes); 2180 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
2184 if (rc) { 2181 if (rc) {
2185 cFYI(1, "Send error Write2 = %d", rc); 2182 cifs_dbg(FYI, "Send error Write2 = %d\n", rc);
2186 } else if (resp_buf_type == 0) { 2183 } else if (resp_buf_type == 0) {
2187 /* presumably this can not happen, but best to be safe */ 2184 /* presumably this can not happen, but best to be safe */
2188 rc = -EIO; 2185 rc = -EIO;
@@ -2223,7 +2220,8 @@ int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2223 int resp_buf_type; 2220 int resp_buf_type;
2224 __u16 count; 2221 __u16 count;
2225 2222
2226 cFYI(1, "cifs_lockv num lock %d num unlock %d", num_lock, num_unlock); 2223 cifs_dbg(FYI, "cifs_lockv num lock %d num unlock %d\n",
2224 num_lock, num_unlock);
2227 2225
2228 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); 2226 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB);
2229 if (rc) 2227 if (rc)
@@ -2249,7 +2247,7 @@ int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2249 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); 2247 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2250 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); 2248 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP);
2251 if (rc) 2249 if (rc)
2252 cFYI(1, "Send error in cifs_lockv = %d", rc); 2250 cifs_dbg(FYI, "Send error in cifs_lockv = %d\n", rc);
2253 2251
2254 return rc; 2252 return rc;
2255} 2253}
@@ -2268,7 +2266,8 @@ CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
2268 int flags = 0; 2266 int flags = 0;
2269 __u16 count; 2267 __u16 count;
2270 2268
2271 cFYI(1, "CIFSSMBLock timeout %d numLock %d", (int)waitFlag, numLock); 2269 cifs_dbg(FYI, "CIFSSMBLock timeout %d numLock %d\n",
2270 (int)waitFlag, numLock);
2272 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); 2271 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB);
2273 2272
2274 if (rc) 2273 if (rc)
@@ -2317,7 +2316,7 @@ CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
2317 } 2316 }
2318 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); 2317 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2319 if (rc) 2318 if (rc)
2320 cFYI(1, "Send error in Lock = %d", rc); 2319 cifs_dbg(FYI, "Send error in Lock = %d\n", rc);
2321 2320
2322 /* Note: On -EAGAIN error only caller can retry on handle based calls 2321 /* Note: On -EAGAIN error only caller can retry on handle based calls
2323 since file handle passed in no longer valid */ 2322 since file handle passed in no longer valid */
@@ -2341,7 +2340,7 @@ CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
2341 __u16 params, param_offset, offset, byte_count, count; 2340 __u16 params, param_offset, offset, byte_count, count;
2342 struct kvec iov[1]; 2341 struct kvec iov[1];
2343 2342
2344 cFYI(1, "Posix Lock"); 2343 cifs_dbg(FYI, "Posix Lock\n");
2345 2344
2346 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 2345 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
2347 2346
@@ -2408,7 +2407,7 @@ CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
2408 } 2407 }
2409 2408
2410 if (rc) { 2409 if (rc) {
2411 cFYI(1, "Send error in Posix Lock = %d", rc); 2410 cifs_dbg(FYI, "Send error in Posix Lock = %d\n", rc);
2412 } else if (pLockData) { 2411 } else if (pLockData) {
2413 /* lock structure can be returned on get */ 2412 /* lock structure can be returned on get */
2414 __u16 data_offset; 2413 __u16 data_offset;
@@ -2465,7 +2464,7 @@ CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2465{ 2464{
2466 int rc = 0; 2465 int rc = 0;
2467 CLOSE_REQ *pSMB = NULL; 2466 CLOSE_REQ *pSMB = NULL;
2468 cFYI(1, "In CIFSSMBClose"); 2467 cifs_dbg(FYI, "In CIFSSMBClose\n");
2469 2468
2470/* do not retry on dead session on close */ 2469/* do not retry on dead session on close */
2471 rc = small_smb_init(SMB_COM_CLOSE, 3, tcon, (void **) &pSMB); 2470 rc = small_smb_init(SMB_COM_CLOSE, 3, tcon, (void **) &pSMB);
@@ -2482,7 +2481,7 @@ CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2482 if (rc) { 2481 if (rc) {
2483 if (rc != -EINTR) { 2482 if (rc != -EINTR) {
2484 /* EINTR is expected when user ctl-c to kill app */ 2483 /* EINTR is expected when user ctl-c to kill app */
2485 cERROR(1, "Send error in Close = %d", rc); 2484 cifs_dbg(VFS, "Send error in Close = %d\n", rc);
2486 } 2485 }
2487 } 2486 }
2488 2487
@@ -2498,7 +2497,7 @@ CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2498{ 2497{
2499 int rc = 0; 2498 int rc = 0;
2500 FLUSH_REQ *pSMB = NULL; 2499 FLUSH_REQ *pSMB = NULL;
2501 cFYI(1, "In CIFSSMBFlush"); 2500 cifs_dbg(FYI, "In CIFSSMBFlush\n");
2502 2501
2503 rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB); 2502 rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB);
2504 if (rc) 2503 if (rc)
@@ -2509,7 +2508,7 @@ CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2509 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 2508 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
2510 cifs_stats_inc(&tcon->stats.cifs_stats.num_flushes); 2509 cifs_stats_inc(&tcon->stats.cifs_stats.num_flushes);
2511 if (rc) 2510 if (rc)
2512 cERROR(1, "Send error in Flush = %d", rc); 2511 cifs_dbg(VFS, "Send error in Flush = %d\n", rc);
2513 2512
2514 return rc; 2513 return rc;
2515} 2514}
@@ -2527,7 +2526,7 @@ CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
2527 __u16 count; 2526 __u16 count;
2528 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 2527 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
2529 2528
2530 cFYI(1, "In CIFSSMBRename"); 2529 cifs_dbg(FYI, "In CIFSSMBRename\n");
2531renameRetry: 2530renameRetry:
2532 rc = smb_init(SMB_COM_RENAME, 1, tcon, (void **) &pSMB, 2531 rc = smb_init(SMB_COM_RENAME, 1, tcon, (void **) &pSMB,
2533 (void **) &pSMBr); 2532 (void **) &pSMBr);
@@ -2574,7 +2573,7 @@ renameRetry:
2574 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2573 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2575 cifs_stats_inc(&tcon->stats.cifs_stats.num_renames); 2574 cifs_stats_inc(&tcon->stats.cifs_stats.num_renames);
2576 if (rc) 2575 if (rc)
2577 cFYI(1, "Send error in rename = %d", rc); 2576 cifs_dbg(FYI, "Send error in rename = %d\n", rc);
2578 2577
2579 cifs_buf_release(pSMB); 2578 cifs_buf_release(pSMB);
2580 2579
@@ -2598,7 +2597,7 @@ int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
2598 int len_of_str; 2597 int len_of_str;
2599 __u16 params, param_offset, offset, count, byte_count; 2598 __u16 params, param_offset, offset, count, byte_count;
2600 2599
2601 cFYI(1, "Rename to File by handle"); 2600 cifs_dbg(FYI, "Rename to File by handle\n");
2602 rc = smb_init(SMB_COM_TRANSACTION2, 15, pTcon, (void **) &pSMB, 2601 rc = smb_init(SMB_COM_TRANSACTION2, 15, pTcon, (void **) &pSMB,
2603 (void **) &pSMBr); 2602 (void **) &pSMBr);
2604 if (rc) 2603 if (rc)
@@ -2655,7 +2654,8 @@ int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
2655 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2654 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2656 cifs_stats_inc(&pTcon->stats.cifs_stats.num_t2renames); 2655 cifs_stats_inc(&pTcon->stats.cifs_stats.num_t2renames);
2657 if (rc) 2656 if (rc)
2658 cFYI(1, "Send error in Rename (by file handle) = %d", rc); 2657 cifs_dbg(FYI, "Send error in Rename (by file handle) = %d\n",
2658 rc);
2659 2659
2660 cifs_buf_release(pSMB); 2660 cifs_buf_release(pSMB);
2661 2661
@@ -2677,7 +2677,7 @@ CIFSSMBCopy(const unsigned int xid, struct cifs_tcon *tcon,
2677 int name_len, name_len2; 2677 int name_len, name_len2;
2678 __u16 count; 2678 __u16 count;
2679 2679
2680 cFYI(1, "In CIFSSMBCopy"); 2680 cifs_dbg(FYI, "In CIFSSMBCopy\n");
2681copyRetry: 2681copyRetry:
2682 rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB, 2682 rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB,
2683 (void **) &pSMBr); 2683 (void **) &pSMBr);
@@ -2722,8 +2722,8 @@ copyRetry:
2722 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2722 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2723 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2723 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2724 if (rc) { 2724 if (rc) {
2725 cFYI(1, "Send error in copy = %d with %d files copied", 2725 cifs_dbg(FYI, "Send error in copy = %d with %d files copied\n",
2726 rc, le16_to_cpu(pSMBr->CopyCount)); 2726 rc, le16_to_cpu(pSMBr->CopyCount));
2727 } 2727 }
2728 cifs_buf_release(pSMB); 2728 cifs_buf_release(pSMB);
2729 2729
@@ -2747,7 +2747,7 @@ CIFSUnixCreateSymLink(const unsigned int xid, struct cifs_tcon *tcon,
2747 int bytes_returned = 0; 2747 int bytes_returned = 0;
2748 __u16 params, param_offset, offset, byte_count; 2748 __u16 params, param_offset, offset, byte_count;
2749 2749
2750 cFYI(1, "In Symlink Unix style"); 2750 cifs_dbg(FYI, "In Symlink Unix style\n");
2751createSymLinkRetry: 2751createSymLinkRetry:
2752 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 2752 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
2753 (void **) &pSMBr); 2753 (void **) &pSMBr);
@@ -2812,7 +2812,8 @@ createSymLinkRetry:
2812 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2812 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2813 cifs_stats_inc(&tcon->stats.cifs_stats.num_symlinks); 2813 cifs_stats_inc(&tcon->stats.cifs_stats.num_symlinks);
2814 if (rc) 2814 if (rc)
2815 cFYI(1, "Send error in SetPathInfo create symlink = %d", rc); 2815 cifs_dbg(FYI, "Send error in SetPathInfo create symlink = %d\n",
2816 rc);
2816 2817
2817 cifs_buf_release(pSMB); 2818 cifs_buf_release(pSMB);
2818 2819
@@ -2836,7 +2837,7 @@ CIFSUnixCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2836 int bytes_returned = 0; 2837 int bytes_returned = 0;
2837 __u16 params, param_offset, offset, byte_count; 2838 __u16 params, param_offset, offset, byte_count;
2838 2839
2839 cFYI(1, "In Create Hard link Unix style"); 2840 cifs_dbg(FYI, "In Create Hard link Unix style\n");
2840createHardLinkRetry: 2841createHardLinkRetry:
2841 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 2842 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
2842 (void **) &pSMBr); 2843 (void **) &pSMBr);
@@ -2898,7 +2899,8 @@ createHardLinkRetry:
2898 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2899 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2899 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks); 2900 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks);
2900 if (rc) 2901 if (rc)
2901 cFYI(1, "Send error in SetPathInfo (hard link) = %d", rc); 2902 cifs_dbg(FYI, "Send error in SetPathInfo (hard link) = %d\n",
2903 rc);
2902 2904
2903 cifs_buf_release(pSMB); 2905 cifs_buf_release(pSMB);
2904 if (rc == -EAGAIN) 2906 if (rc == -EAGAIN)
@@ -2920,7 +2922,7 @@ CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2920 __u16 count; 2922 __u16 count;
2921 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 2923 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
2922 2924
2923 cFYI(1, "In CIFSCreateHardLink"); 2925 cifs_dbg(FYI, "In CIFSCreateHardLink\n");
2924winCreateHardLinkRetry: 2926winCreateHardLinkRetry:
2925 2927
2926 rc = smb_init(SMB_COM_NT_RENAME, 4, tcon, (void **) &pSMB, 2928 rc = smb_init(SMB_COM_NT_RENAME, 4, tcon, (void **) &pSMB,
@@ -2972,7 +2974,7 @@ winCreateHardLinkRetry:
2972 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2974 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2973 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks); 2975 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks);
2974 if (rc) 2976 if (rc)
2975 cFYI(1, "Send error in hard link (NT rename) = %d", rc); 2977 cifs_dbg(FYI, "Send error in hard link (NT rename) = %d\n", rc);
2976 2978
2977 cifs_buf_release(pSMB); 2979 cifs_buf_release(pSMB);
2978 if (rc == -EAGAIN) 2980 if (rc == -EAGAIN)
@@ -2995,7 +2997,7 @@ CIFSSMBUnixQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,
2995 __u16 params, byte_count; 2997 __u16 params, byte_count;
2996 char *data_start; 2998 char *data_start;
2997 2999
2998 cFYI(1, "In QPathSymLinkInfo (Unix) for path %s", searchName); 3000 cifs_dbg(FYI, "In QPathSymLinkInfo (Unix) for path %s\n", searchName);
2999 3001
3000querySymLinkRetry: 3002querySymLinkRetry:
3001 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3003 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -3042,7 +3044,7 @@ querySymLinkRetry:
3042 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3044 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3043 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3045 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3044 if (rc) { 3046 if (rc) {
3045 cFYI(1, "Send error in QuerySymLinkInfo = %d", rc); 3047 cifs_dbg(FYI, "Send error in QuerySymLinkInfo = %d\n", rc);
3046 } else { 3048 } else {
3047 /* decode response */ 3049 /* decode response */
3048 3050
@@ -3097,7 +3099,8 @@ CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3097 struct smb_com_transaction_ioctl_req *pSMB; 3099 struct smb_com_transaction_ioctl_req *pSMB;
3098 struct smb_com_transaction_ioctl_rsp *pSMBr; 3100 struct smb_com_transaction_ioctl_rsp *pSMBr;
3099 3101
3100 cFYI(1, "In Windows reparse style QueryLink for path %s", searchName); 3102 cifs_dbg(FYI, "In Windows reparse style QueryLink for path %s\n",
3103 searchName);
3101 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, 3104 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB,
3102 (void **) &pSMBr); 3105 (void **) &pSMBr);
3103 if (rc) 3106 if (rc)
@@ -3125,7 +3128,7 @@ CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3125 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3128 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3126 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3129 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3127 if (rc) { 3130 if (rc) {
3128 cFYI(1, "Send error in QueryReparseLinkInfo = %d", rc); 3131 cifs_dbg(FYI, "Send error in QueryReparseLinkInfo = %d\n", rc);
3129 } else { /* decode response */ 3132 } else { /* decode response */
3130 __u32 data_offset = le32_to_cpu(pSMBr->DataOffset); 3133 __u32 data_offset = le32_to_cpu(pSMBr->DataOffset);
3131 __u32 data_count = le32_to_cpu(pSMBr->DataCount); 3134 __u32 data_count = le32_to_cpu(pSMBr->DataCount);
@@ -3149,7 +3152,7 @@ CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3149 if ((reparse_buf->LinkNamesBuf + 3152 if ((reparse_buf->LinkNamesBuf +
3150 reparse_buf->TargetNameOffset + 3153 reparse_buf->TargetNameOffset +
3151 reparse_buf->TargetNameLen) > end_of_smb) { 3154 reparse_buf->TargetNameLen) > end_of_smb) {
3152 cFYI(1, "reparse buf beyond SMB"); 3155 cifs_dbg(FYI, "reparse buf beyond SMB\n");
3153 rc = -EIO; 3156 rc = -EIO;
3154 goto qreparse_out; 3157 goto qreparse_out;
3155 } 3158 }
@@ -3170,12 +3173,11 @@ CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3170 } 3173 }
3171 } else { 3174 } else {
3172 rc = -EIO; 3175 rc = -EIO;
3173 cFYI(1, "Invalid return data count on " 3176 cifs_dbg(FYI, "Invalid return data count on get reparse info ioctl\n");
3174 "get reparse info ioctl");
3175 } 3177 }
3176 symlinkinfo[buflen] = 0; /* just in case so the caller 3178 symlinkinfo[buflen] = 0; /* just in case so the caller
3177 does not go off the end of the buffer */ 3179 does not go off the end of the buffer */
3178 cFYI(1, "readlink result - %s", symlinkinfo); 3180 cifs_dbg(FYI, "readlink result - %s\n", symlinkinfo);
3179 } 3181 }
3180 3182
3181qreparse_out: 3183qreparse_out:
@@ -3198,7 +3200,10 @@ static void cifs_convert_ace(posix_acl_xattr_entry *ace,
3198 ace->e_perm = cpu_to_le16(cifs_ace->cifs_e_perm); 3200 ace->e_perm = cpu_to_le16(cifs_ace->cifs_e_perm);
3199 ace->e_tag = cpu_to_le16(cifs_ace->cifs_e_tag); 3201 ace->e_tag = cpu_to_le16(cifs_ace->cifs_e_tag);
3200 ace->e_id = cpu_to_le32(le64_to_cpu(cifs_ace->cifs_uid)); 3202 ace->e_id = cpu_to_le32(le64_to_cpu(cifs_ace->cifs_uid));
3201 /* cFYI(1, "perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id); */ 3203/*
3204 cifs_dbg(FYI, "perm %d tag %d id %d\n",
3205 ace->e_perm, ace->e_tag, ace->e_id);
3206*/
3202 3207
3203 return; 3208 return;
3204} 3209}
@@ -3224,8 +3229,8 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen,
3224 size += sizeof(struct cifs_posix_ace) * count; 3229 size += sizeof(struct cifs_posix_ace) * count;
3225 /* check if we would go beyond end of SMB */ 3230 /* check if we would go beyond end of SMB */
3226 if (size_of_data_area < size) { 3231 if (size_of_data_area < size) {
3227 cFYI(1, "bad CIFS POSIX ACL size %d vs. %d", 3232 cifs_dbg(FYI, "bad CIFS POSIX ACL size %d vs. %d\n",
3228 size_of_data_area, size); 3233 size_of_data_area, size);
3229 return -EINVAL; 3234 return -EINVAL;
3230 } 3235 }
3231 } else if (acl_type & ACL_TYPE_DEFAULT) { 3236 } else if (acl_type & ACL_TYPE_DEFAULT) {
@@ -3272,7 +3277,10 @@ static __u16 convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace,
3272 cifs_ace->cifs_uid = cpu_to_le64(-1); 3277 cifs_ace->cifs_uid = cpu_to_le64(-1);
3273 } else 3278 } else
3274 cifs_ace->cifs_uid = cpu_to_le64(le32_to_cpu(local_ace->e_id)); 3279 cifs_ace->cifs_uid = cpu_to_le64(le32_to_cpu(local_ace->e_id));
3275 /*cFYI(1, "perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id);*/ 3280/*
3281 cifs_dbg(FYI, "perm %d tag %d id %d\n",
3282 ace->e_perm, ace->e_tag, ace->e_id);
3283*/
3276 return rc; 3284 return rc;
3277} 3285}
3278 3286
@@ -3290,12 +3298,11 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
3290 return 0; 3298 return 0;
3291 3299
3292 count = posix_acl_xattr_count((size_t)buflen); 3300 count = posix_acl_xattr_count((size_t)buflen);
3293 cFYI(1, "setting acl with %d entries from buf of length %d and " 3301 cifs_dbg(FYI, "setting acl with %d entries from buf of length %d and version of %d\n",
3294 "version of %d", 3302 count, buflen, le32_to_cpu(local_acl->a_version));
3295 count, buflen, le32_to_cpu(local_acl->a_version));
3296 if (le32_to_cpu(local_acl->a_version) != 2) { 3303 if (le32_to_cpu(local_acl->a_version) != 2) {
3297 cFYI(1, "unknown POSIX ACL version %d", 3304 cifs_dbg(FYI, "unknown POSIX ACL version %d\n",
3298 le32_to_cpu(local_acl->a_version)); 3305 le32_to_cpu(local_acl->a_version));
3299 return 0; 3306 return 0;
3300 } 3307 }
3301 cifs_acl->version = cpu_to_le16(1); 3308 cifs_acl->version = cpu_to_le16(1);
@@ -3304,7 +3311,7 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
3304 else if (acl_type == ACL_TYPE_DEFAULT) 3311 else if (acl_type == ACL_TYPE_DEFAULT)
3305 cifs_acl->default_entry_count = cpu_to_le16(count); 3312 cifs_acl->default_entry_count = cpu_to_le16(count);
3306 else { 3313 else {
3307 cFYI(1, "unknown ACL type %d", acl_type); 3314 cifs_dbg(FYI, "unknown ACL type %d\n", acl_type);
3308 return 0; 3315 return 0;
3309 } 3316 }
3310 for (i = 0; i < count; i++) { 3317 for (i = 0; i < count; i++) {
@@ -3337,7 +3344,7 @@ CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
3337 int name_len; 3344 int name_len;
3338 __u16 params, byte_count; 3345 __u16 params, byte_count;
3339 3346
3340 cFYI(1, "In GetPosixACL (Unix) for path %s", searchName); 3347 cifs_dbg(FYI, "In GetPosixACL (Unix) for path %s\n", searchName);
3341 3348
3342queryAclRetry: 3349queryAclRetry:
3343 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3350 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -3390,7 +3397,7 @@ queryAclRetry:
3390 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3397 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3391 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get); 3398 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get);
3392 if (rc) { 3399 if (rc) {
3393 cFYI(1, "Send error in Query POSIX ACL = %d", rc); 3400 cifs_dbg(FYI, "Send error in Query POSIX ACL = %d\n", rc);
3394 } else { 3401 } else {
3395 /* decode response */ 3402 /* decode response */
3396 3403
@@ -3427,7 +3434,7 @@ CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
3427 int bytes_returned = 0; 3434 int bytes_returned = 0;
3428 __u16 params, byte_count, data_count, param_offset, offset; 3435 __u16 params, byte_count, data_count, param_offset, offset;
3429 3436
3430 cFYI(1, "In SetPosixACL (Unix) for path %s", fileName); 3437 cifs_dbg(FYI, "In SetPosixACL (Unix) for path %s\n", fileName);
3431setAclRetry: 3438setAclRetry:
3432 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3439 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3433 (void **) &pSMBr); 3440 (void **) &pSMBr);
@@ -3482,7 +3489,7 @@ setAclRetry:
3482 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3489 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3483 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3490 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3484 if (rc) 3491 if (rc)
3485 cFYI(1, "Set POSIX ACL returned %d", rc); 3492 cifs_dbg(FYI, "Set POSIX ACL returned %d\n", rc);
3486 3493
3487setACLerrorExit: 3494setACLerrorExit:
3488 cifs_buf_release(pSMB); 3495 cifs_buf_release(pSMB);
@@ -3502,7 +3509,7 @@ CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
3502 int bytes_returned; 3509 int bytes_returned;
3503 __u16 params, byte_count; 3510 __u16 params, byte_count;
3504 3511
3505 cFYI(1, "In GetExtAttr"); 3512 cifs_dbg(FYI, "In GetExtAttr\n");
3506 if (tcon == NULL) 3513 if (tcon == NULL)
3507 return -ENODEV; 3514 return -ENODEV;
3508 3515
@@ -3541,7 +3548,7 @@ GetExtAttrRetry:
3541 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3548 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3542 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3549 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3543 if (rc) { 3550 if (rc) {
3544 cFYI(1, "error %d in GetExtAttr", rc); 3551 cifs_dbg(FYI, "error %d in GetExtAttr\n", rc);
3545 } else { 3552 } else {
3546 /* decode response */ 3553 /* decode response */
3547 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 3554 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
@@ -3556,7 +3563,7 @@ GetExtAttrRetry:
3556 struct file_chattr_info *pfinfo; 3563 struct file_chattr_info *pfinfo;
3557 /* BB Do we need a cast or hash here ? */ 3564 /* BB Do we need a cast or hash here ? */
3558 if (count != 16) { 3565 if (count != 16) {
3559 cFYI(1, "Illegal size ret in GetExtAttr"); 3566 cifs_dbg(FYI, "Illegal size ret in GetExtAttr\n");
3560 rc = -EIO; 3567 rc = -EIO;
3561 goto GetExtAttrOut; 3568 goto GetExtAttrOut;
3562 } 3569 }
@@ -3644,21 +3651,21 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
3644 3651
3645 /* should we also check that parm and data areas do not overlap? */ 3652 /* should we also check that parm and data areas do not overlap? */
3646 if (*ppparm > end_of_smb) { 3653 if (*ppparm > end_of_smb) {
3647 cFYI(1, "parms start after end of smb"); 3654 cifs_dbg(FYI, "parms start after end of smb\n");
3648 return -EINVAL; 3655 return -EINVAL;
3649 } else if (parm_count + *ppparm > end_of_smb) { 3656 } else if (parm_count + *ppparm > end_of_smb) {
3650 cFYI(1, "parm end after end of smb"); 3657 cifs_dbg(FYI, "parm end after end of smb\n");
3651 return -EINVAL; 3658 return -EINVAL;
3652 } else if (*ppdata > end_of_smb) { 3659 } else if (*ppdata > end_of_smb) {
3653 cFYI(1, "data starts after end of smb"); 3660 cifs_dbg(FYI, "data starts after end of smb\n");
3654 return -EINVAL; 3661 return -EINVAL;
3655 } else if (data_count + *ppdata > end_of_smb) { 3662 } else if (data_count + *ppdata > end_of_smb) {
3656 cFYI(1, "data %p + count %d (%p) past smb end %p start %p", 3663 cifs_dbg(FYI, "data %p + count %d (%p) past smb end %p start %p\n",
3657 *ppdata, data_count, (data_count + *ppdata), 3664 *ppdata, data_count, (data_count + *ppdata),
3658 end_of_smb, pSMBr); 3665 end_of_smb, pSMBr);
3659 return -EINVAL; 3666 return -EINVAL;
3660 } else if (parm_count + data_count > bcc) { 3667 } else if (parm_count + data_count > bcc) {
3661 cFYI(1, "parm count and data count larger than SMB"); 3668 cifs_dbg(FYI, "parm count and data count larger than SMB\n");
3662 return -EINVAL; 3669 return -EINVAL;
3663 } 3670 }
3664 *pdatalen = data_count; 3671 *pdatalen = data_count;
@@ -3676,7 +3683,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3676 QUERY_SEC_DESC_REQ *pSMB; 3683 QUERY_SEC_DESC_REQ *pSMB;
3677 struct kvec iov[1]; 3684 struct kvec iov[1];
3678 3685
3679 cFYI(1, "GetCifsACL"); 3686 cifs_dbg(FYI, "GetCifsACL\n");
3680 3687
3681 *pbuflen = 0; 3688 *pbuflen = 0;
3682 *acl_inf = NULL; 3689 *acl_inf = NULL;
@@ -3701,7 +3708,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3701 0); 3708 0);
3702 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get); 3709 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get);
3703 if (rc) { 3710 if (rc) {
3704 cFYI(1, "Send error in QuerySecDesc = %d", rc); 3711 cifs_dbg(FYI, "Send error in QuerySecDesc = %d\n", rc);
3705 } else { /* decode response */ 3712 } else { /* decode response */
3706 __le32 *parm; 3713 __le32 *parm;
3707 __u32 parm_len; 3714 __u32 parm_len;
@@ -3716,7 +3723,8 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3716 goto qsec_out; 3723 goto qsec_out;
3717 pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base; 3724 pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base;
3718 3725
3719 cFYI(1, "smb %p parm %p data %p", pSMBr, parm, *acl_inf); 3726 cifs_dbg(FYI, "smb %p parm %p data %p\n",
3727 pSMBr, parm, *acl_inf);
3720 3728
3721 if (le32_to_cpu(pSMBr->ParameterCount) != 4) { 3729 if (le32_to_cpu(pSMBr->ParameterCount) != 4) {
3722 rc = -EIO; /* bad smb */ 3730 rc = -EIO; /* bad smb */
@@ -3728,8 +3736,8 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3728 3736
3729 acl_len = le32_to_cpu(*parm); 3737 acl_len = le32_to_cpu(*parm);
3730 if (acl_len != *pbuflen) { 3738 if (acl_len != *pbuflen) {
3731 cERROR(1, "acl length %d does not match %d", 3739 cifs_dbg(VFS, "acl length %d does not match %d\n",
3732 acl_len, *pbuflen); 3740 acl_len, *pbuflen);
3733 if (*pbuflen > acl_len) 3741 if (*pbuflen > acl_len)
3734 *pbuflen = acl_len; 3742 *pbuflen = acl_len;
3735 } 3743 }
@@ -3738,7 +3746,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3738 header followed by the smallest SID */ 3746 header followed by the smallest SID */
3739 if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) || 3747 if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) ||
3740 (*pbuflen >= 64 * 1024)) { 3748 (*pbuflen >= 64 * 1024)) {
3741 cERROR(1, "bad acl length %d", *pbuflen); 3749 cifs_dbg(VFS, "bad acl length %d\n", *pbuflen);
3742 rc = -EINVAL; 3750 rc = -EINVAL;
3743 *pbuflen = 0; 3751 *pbuflen = 0;
3744 } else { 3752 } else {
@@ -3808,9 +3816,10 @@ setCifsAclRetry:
3808 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3816 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3809 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3817 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3810 3818
3811 cFYI(1, "SetCIFSACL bytes_returned: %d, rc: %d", bytes_returned, rc); 3819 cifs_dbg(FYI, "SetCIFSACL bytes_returned: %d, rc: %d\n",
3820 bytes_returned, rc);
3812 if (rc) 3821 if (rc)
3813 cFYI(1, "Set CIFS ACL returned %d", rc); 3822 cifs_dbg(FYI, "Set CIFS ACL returned %d\n", rc);
3814 cifs_buf_release(pSMB); 3823 cifs_buf_release(pSMB);
3815 3824
3816 if (rc == -EAGAIN) 3825 if (rc == -EAGAIN)
@@ -3834,7 +3843,7 @@ SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
3834 int bytes_returned; 3843 int bytes_returned;
3835 int name_len; 3844 int name_len;
3836 3845
3837 cFYI(1, "In SMBQPath path %s", search_name); 3846 cifs_dbg(FYI, "In SMBQPath path %s\n", search_name);
3838QInfRetry: 3847QInfRetry:
3839 rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB, 3848 rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB,
3840 (void **) &pSMBr); 3849 (void **) &pSMBr);
@@ -3861,7 +3870,7 @@ QInfRetry:
3861 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3870 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3862 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3871 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3863 if (rc) { 3872 if (rc) {
3864 cFYI(1, "Send error in QueryInfo = %d", rc); 3873 cifs_dbg(FYI, "Send error in QueryInfo = %d\n", rc);
3865 } else if (data) { 3874 } else if (data) {
3866 struct timespec ts; 3875 struct timespec ts;
3867 __u32 time = le32_to_cpu(pSMBr->last_write_time); 3876 __u32 time = le32_to_cpu(pSMBr->last_write_time);
@@ -3935,7 +3944,7 @@ QFileInfoRetry:
3935 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3944 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3936 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3945 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3937 if (rc) { 3946 if (rc) {
3938 cFYI(1, "Send error in QPathInfo = %d", rc); 3947 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
3939 } else { /* decode response */ 3948 } else { /* decode response */
3940 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 3949 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3941 3950
@@ -3972,7 +3981,7 @@ CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
3972 int name_len; 3981 int name_len;
3973 __u16 params, byte_count; 3982 __u16 params, byte_count;
3974 3983
3975 /* cFYI(1, "In QPathInfo path %s", search_name); */ 3984 /* cifs_dbg(FYI, "In QPathInfo path %s\n", search_name); */
3976QPathInfoRetry: 3985QPathInfoRetry:
3977 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3986 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3978 (void **) &pSMBr); 3987 (void **) &pSMBr);
@@ -4022,7 +4031,7 @@ QPathInfoRetry:
4022 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4031 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4023 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4032 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4024 if (rc) { 4033 if (rc) {
4025 cFYI(1, "Send error in QPathInfo = %d", rc); 4034 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
4026 } else { /* decode response */ 4035 } else { /* decode response */
4027 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4036 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4028 4037
@@ -4103,14 +4112,12 @@ UnixQFileInfoRetry:
4103 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4112 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4104 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4113 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4105 if (rc) { 4114 if (rc) {
4106 cFYI(1, "Send error in QPathInfo = %d", rc); 4115 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
4107 } else { /* decode response */ 4116 } else { /* decode response */
4108 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4117 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4109 4118
4110 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) { 4119 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) {
4111 cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response. " 4120 cifs_dbg(VFS, "Malformed FILE_UNIX_BASIC_INFO response. Unix Extensions can be disabled on mount by specifying the nosfu mount option.\n");
4112 "Unix Extensions can be disabled on mount "
4113 "by specifying the nosfu mount option.");
4114 rc = -EIO; /* bad smb */ 4121 rc = -EIO; /* bad smb */
4115 } else { 4122 } else {
4116 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); 4123 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
@@ -4142,7 +4149,7 @@ CIFSSMBUnixQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
4142 int name_len; 4149 int name_len;
4143 __u16 params, byte_count; 4150 __u16 params, byte_count;
4144 4151
4145 cFYI(1, "In QPathInfo (Unix) the path %s", searchName); 4152 cifs_dbg(FYI, "In QPathInfo (Unix) the path %s\n", searchName);
4146UnixQPathInfoRetry: 4153UnixQPathInfoRetry:
4147 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4154 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4148 (void **) &pSMBr); 4155 (void **) &pSMBr);
@@ -4189,14 +4196,12 @@ UnixQPathInfoRetry:
4189 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4196 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4190 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4197 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4191 if (rc) { 4198 if (rc) {
4192 cFYI(1, "Send error in QPathInfo = %d", rc); 4199 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
4193 } else { /* decode response */ 4200 } else { /* decode response */
4194 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4201 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4195 4202
4196 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) { 4203 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) {
4197 cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response. " 4204 cifs_dbg(VFS, "Malformed FILE_UNIX_BASIC_INFO response. Unix Extensions can be disabled on mount by specifying the nosfu mount option.\n");
4198 "Unix Extensions can be disabled on mount "
4199 "by specifying the nosfu mount option.");
4200 rc = -EIO; /* bad smb */ 4205 rc = -EIO; /* bad smb */
4201 } else { 4206 } else {
4202 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); 4207 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
@@ -4230,7 +4235,7 @@ CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
4230 __u16 params, byte_count; 4235 __u16 params, byte_count;
4231 struct nls_table *nls_codepage; 4236 struct nls_table *nls_codepage;
4232 4237
4233 cFYI(1, "In FindFirst for %s", searchName); 4238 cifs_dbg(FYI, "In FindFirst for %s\n", searchName);
4234 4239
4235findFirstRetry: 4240findFirstRetry:
4236 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4241 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -4313,7 +4318,7 @@ findFirstRetry:
4313 if (rc) {/* BB add logic to retry regular search if Unix search 4318 if (rc) {/* BB add logic to retry regular search if Unix search
4314 rejected unexpectedly by server */ 4319 rejected unexpectedly by server */
4315 /* BB Add code to handle unsupported level rc */ 4320 /* BB Add code to handle unsupported level rc */
4316 cFYI(1, "Error in FindFirst = %d", rc); 4321 cifs_dbg(FYI, "Error in FindFirst = %d\n", rc);
4317 4322
4318 cifs_buf_release(pSMB); 4323 cifs_buf_release(pSMB);
4319 4324
@@ -4351,7 +4356,7 @@ findFirstRetry:
4351 psrch_inf->entries_in_buffer; 4356 psrch_inf->entries_in_buffer;
4352 lnoff = le16_to_cpu(parms->LastNameOffset); 4357 lnoff = le16_to_cpu(parms->LastNameOffset);
4353 if (CIFSMaxBufSize < lnoff) { 4358 if (CIFSMaxBufSize < lnoff) {
4354 cERROR(1, "ignoring corrupt resume name"); 4359 cifs_dbg(VFS, "ignoring corrupt resume name\n");
4355 psrch_inf->last_entry = NULL; 4360 psrch_inf->last_entry = NULL;
4356 return rc; 4361 return rc;
4357 } 4362 }
@@ -4382,7 +4387,7 @@ int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4382 unsigned int name_len; 4387 unsigned int name_len;
4383 __u16 params, byte_count; 4388 __u16 params, byte_count;
4384 4389
4385 cFYI(1, "In FindNext"); 4390 cifs_dbg(FYI, "In FindNext\n");
4386 4391
4387 if (psrch_inf->endOfSearch) 4392 if (psrch_inf->endOfSearch)
4388 return -ENOENT; 4393 return -ENOENT;
@@ -4443,7 +4448,7 @@ int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4443 cifs_buf_release(pSMB); 4448 cifs_buf_release(pSMB);
4444 rc = 0; /* search probably was closed at end of search*/ 4449 rc = 0; /* search probably was closed at end of search*/
4445 } else 4450 } else
4446 cFYI(1, "FindNext returned = %d", rc); 4451 cifs_dbg(FYI, "FindNext returned = %d\n", rc);
4447 } else { /* decode response */ 4452 } else { /* decode response */
4448 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4453 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4449 4454
@@ -4478,15 +4483,15 @@ int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4478 psrch_inf->entries_in_buffer; 4483 psrch_inf->entries_in_buffer;
4479 lnoff = le16_to_cpu(parms->LastNameOffset); 4484 lnoff = le16_to_cpu(parms->LastNameOffset);
4480 if (CIFSMaxBufSize < lnoff) { 4485 if (CIFSMaxBufSize < lnoff) {
4481 cERROR(1, "ignoring corrupt resume name"); 4486 cifs_dbg(VFS, "ignoring corrupt resume name\n");
4482 psrch_inf->last_entry = NULL; 4487 psrch_inf->last_entry = NULL;
4483 return rc; 4488 return rc;
4484 } else 4489 } else
4485 psrch_inf->last_entry = 4490 psrch_inf->last_entry =
4486 psrch_inf->srch_entries_start + lnoff; 4491 psrch_inf->srch_entries_start + lnoff;
4487 4492
4488/* cFYI(1, "fnxt2 entries in buf %d index_of_last %d", 4493/* cifs_dbg(FYI, "fnxt2 entries in buf %d index_of_last %d\n",
4489 psrch_inf->entries_in_buffer, psrch_inf->index_of_last_entry); */ 4494 psrch_inf->entries_in_buffer, psrch_inf->index_of_last_entry); */
4490 4495
4491 /* BB fixme add unlock here */ 4496 /* BB fixme add unlock here */
4492 } 4497 }
@@ -4511,7 +4516,7 @@ CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
4511 int rc = 0; 4516 int rc = 0;
4512 FINDCLOSE_REQ *pSMB = NULL; 4517 FINDCLOSE_REQ *pSMB = NULL;
4513 4518
4514 cFYI(1, "In CIFSSMBFindClose"); 4519 cifs_dbg(FYI, "In CIFSSMBFindClose\n");
4515 rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB); 4520 rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB);
4516 4521
4517 /* no sense returning error if session restarted 4522 /* no sense returning error if session restarted
@@ -4525,7 +4530,7 @@ CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
4525 pSMB->ByteCount = 0; 4530 pSMB->ByteCount = 0;
4526 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 4531 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
4527 if (rc) 4532 if (rc)
4528 cERROR(1, "Send error in FindClose = %d", rc); 4533 cifs_dbg(VFS, "Send error in FindClose = %d\n", rc);
4529 4534
4530 cifs_stats_inc(&tcon->stats.cifs_stats.num_fclose); 4535 cifs_stats_inc(&tcon->stats.cifs_stats.num_fclose);
4531 4536
@@ -4547,7 +4552,7 @@ CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
4547 int name_len, bytes_returned; 4552 int name_len, bytes_returned;
4548 __u16 params, byte_count; 4553 __u16 params, byte_count;
4549 4554
4550 cFYI(1, "In GetSrvInodeNum for %s", search_name); 4555 cifs_dbg(FYI, "In GetSrvInodeNum for %s\n", search_name);
4551 if (tcon == NULL) 4556 if (tcon == NULL)
4552 return -ENODEV; 4557 return -ENODEV;
4553 4558
@@ -4598,7 +4603,7 @@ GetInodeNumberRetry:
4598 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4603 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4599 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4604 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4600 if (rc) { 4605 if (rc) {
4601 cFYI(1, "error %d in QueryInternalInfo", rc); 4606 cifs_dbg(FYI, "error %d in QueryInternalInfo\n", rc);
4602 } else { 4607 } else {
4603 /* decode response */ 4608 /* decode response */
4604 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4609 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
@@ -4613,7 +4618,7 @@ GetInodeNumberRetry:
4613 struct file_internal_info *pfinfo; 4618 struct file_internal_info *pfinfo;
4614 /* BB Do we need a cast or hash here ? */ 4619 /* BB Do we need a cast or hash here ? */
4615 if (count < 8) { 4620 if (count < 8) {
4616 cFYI(1, "Illegal size ret in QryIntrnlInf"); 4621 cifs_dbg(FYI, "Illegal size ret in QryIntrnlInf\n");
4617 rc = -EIO; 4622 rc = -EIO;
4618 goto GetInodeNumOut; 4623 goto GetInodeNumOut;
4619 } 4624 }
@@ -4654,16 +4659,16 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
4654 *num_of_nodes = le16_to_cpu(pSMBr->NumberOfReferrals); 4659 *num_of_nodes = le16_to_cpu(pSMBr->NumberOfReferrals);
4655 4660
4656 if (*num_of_nodes < 1) { 4661 if (*num_of_nodes < 1) {
4657 cERROR(1, "num_referrals: must be at least > 0," 4662 cifs_dbg(VFS, "num_referrals: must be at least > 0, but we get num_referrals = %d\n",
4658 "but we get num_referrals = %d", *num_of_nodes); 4663 *num_of_nodes);
4659 rc = -EINVAL; 4664 rc = -EINVAL;
4660 goto parse_DFS_referrals_exit; 4665 goto parse_DFS_referrals_exit;
4661 } 4666 }
4662 4667
4663 ref = (struct dfs_referral_level_3 *) &(pSMBr->referrals); 4668 ref = (struct dfs_referral_level_3 *) &(pSMBr->referrals);
4664 if (ref->VersionNumber != cpu_to_le16(3)) { 4669 if (ref->VersionNumber != cpu_to_le16(3)) {
4665 cERROR(1, "Referrals of V%d version are not supported," 4670 cifs_dbg(VFS, "Referrals of V%d version are not supported, should be V3\n",
4666 "should be V3", le16_to_cpu(ref->VersionNumber)); 4671 le16_to_cpu(ref->VersionNumber));
4667 rc = -EINVAL; 4672 rc = -EINVAL;
4668 goto parse_DFS_referrals_exit; 4673 goto parse_DFS_referrals_exit;
4669 } 4674 }
@@ -4672,14 +4677,12 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
4672 data_end = (char *)(&(pSMBr->PathConsumed)) + 4677 data_end = (char *)(&(pSMBr->PathConsumed)) +
4673 le16_to_cpu(pSMBr->t2.DataCount); 4678 le16_to_cpu(pSMBr->t2.DataCount);
4674 4679
4675 cFYI(1, "num_referrals: %d dfs flags: 0x%x ...", 4680 cifs_dbg(FYI, "num_referrals: %d dfs flags: 0x%x ...\n",
4676 *num_of_nodes, 4681 *num_of_nodes, le32_to_cpu(pSMBr->DFSFlags));
4677 le32_to_cpu(pSMBr->DFSFlags));
4678 4682
4679 *target_nodes = kzalloc(sizeof(struct dfs_info3_param) * 4683 *target_nodes = kcalloc(*num_of_nodes, sizeof(struct dfs_info3_param),
4680 *num_of_nodes, GFP_KERNEL); 4684 GFP_KERNEL);
4681 if (*target_nodes == NULL) { 4685 if (*target_nodes == NULL) {
4682 cERROR(1, "Failed to allocate buffer for target_nodes");
4683 rc = -ENOMEM; 4686 rc = -ENOMEM;
4684 goto parse_DFS_referrals_exit; 4687 goto parse_DFS_referrals_exit;
4685 } 4688 }
@@ -4758,7 +4761,7 @@ CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
4758 *num_of_nodes = 0; 4761 *num_of_nodes = 0;
4759 *target_nodes = NULL; 4762 *target_nodes = NULL;
4760 4763
4761 cFYI(1, "In GetDFSRefer the path %s", search_name); 4764 cifs_dbg(FYI, "In GetDFSRefer the path %s\n", search_name);
4762 if (ses == NULL) 4765 if (ses == NULL)
4763 return -ENODEV; 4766 return -ENODEV;
4764getDFSRetry: 4767getDFSRetry:
@@ -4826,7 +4829,7 @@ getDFSRetry:
4826 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB, 4829 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB,
4827 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4830 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4828 if (rc) { 4831 if (rc) {
4829 cFYI(1, "Send error in GetDFSRefer = %d", rc); 4832 cifs_dbg(FYI, "Send error in GetDFSRefer = %d\n", rc);
4830 goto GetDFSRefExit; 4833 goto GetDFSRefExit;
4831 } 4834 }
4832 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4835 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
@@ -4837,9 +4840,8 @@ getDFSRetry:
4837 goto GetDFSRefExit; 4840 goto GetDFSRefExit;
4838 } 4841 }
4839 4842
4840 cFYI(1, "Decoding GetDFSRefer response BCC: %d Offset %d", 4843 cifs_dbg(FYI, "Decoding GetDFSRefer response BCC: %d Offset %d\n",
4841 get_bcc(&pSMBr->hdr), 4844 get_bcc(&pSMBr->hdr), le16_to_cpu(pSMBr->t2.DataOffset));
4842 le16_to_cpu(pSMBr->t2.DataOffset));
4843 4845
4844 /* parse returned result into more usable form */ 4846 /* parse returned result into more usable form */
4845 rc = parse_DFS_referrals(pSMBr, num_of_nodes, 4847 rc = parse_DFS_referrals(pSMBr, num_of_nodes,
@@ -4868,7 +4870,7 @@ SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
4868 int bytes_returned = 0; 4870 int bytes_returned = 0;
4869 __u16 params, byte_count; 4871 __u16 params, byte_count;
4870 4872
4871 cFYI(1, "OldQFSInfo"); 4873 cifs_dbg(FYI, "OldQFSInfo\n");
4872oldQFSInfoRetry: 4874oldQFSInfoRetry:
4873 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4875 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4874 (void **) &pSMBr); 4876 (void **) &pSMBr);
@@ -4901,7 +4903,7 @@ oldQFSInfoRetry:
4901 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4903 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4902 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4904 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4903 if (rc) { 4905 if (rc) {
4904 cFYI(1, "Send error in QFSInfo = %d", rc); 4906 cifs_dbg(FYI, "Send error in QFSInfo = %d\n", rc);
4905 } else { /* decode response */ 4907 } else { /* decode response */
4906 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4908 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4907 4909
@@ -4909,7 +4911,7 @@ oldQFSInfoRetry:
4909 rc = -EIO; /* bad smb */ 4911 rc = -EIO; /* bad smb */
4910 else { 4912 else {
4911 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); 4913 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
4912 cFYI(1, "qfsinf resp BCC: %d Offset %d", 4914 cifs_dbg(FYI, "qfsinf resp BCC: %d Offset %d\n",
4913 get_bcc(&pSMBr->hdr), data_offset); 4915 get_bcc(&pSMBr->hdr), data_offset);
4914 4916
4915 response_data = (FILE_SYSTEM_ALLOC_INFO *) 4917 response_data = (FILE_SYSTEM_ALLOC_INFO *)
@@ -4922,10 +4924,10 @@ oldQFSInfoRetry:
4922 le32_to_cpu(response_data->TotalAllocationUnits); 4924 le32_to_cpu(response_data->TotalAllocationUnits);
4923 FSData->f_bfree = FSData->f_bavail = 4925 FSData->f_bfree = FSData->f_bavail =
4924 le32_to_cpu(response_data->FreeAllocationUnits); 4926 le32_to_cpu(response_data->FreeAllocationUnits);
4925 cFYI(1, "Blocks: %lld Free: %lld Block size %ld", 4927 cifs_dbg(FYI, "Blocks: %lld Free: %lld Block size %ld\n",
4926 (unsigned long long)FSData->f_blocks, 4928 (unsigned long long)FSData->f_blocks,
4927 (unsigned long long)FSData->f_bfree, 4929 (unsigned long long)FSData->f_bfree,
4928 FSData->f_bsize); 4930 FSData->f_bsize);
4929 } 4931 }
4930 } 4932 }
4931 cifs_buf_release(pSMB); 4933 cifs_buf_release(pSMB);
@@ -4948,7 +4950,7 @@ CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
4948 int bytes_returned = 0; 4950 int bytes_returned = 0;
4949 __u16 params, byte_count; 4951 __u16 params, byte_count;
4950 4952
4951 cFYI(1, "In QFSInfo"); 4953 cifs_dbg(FYI, "In QFSInfo\n");
4952QFSInfoRetry: 4954QFSInfoRetry:
4953 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4955 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4954 (void **) &pSMBr); 4956 (void **) &pSMBr);
@@ -4981,7 +4983,7 @@ QFSInfoRetry:
4981 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4983 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4982 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4984 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4983 if (rc) { 4985 if (rc) {
4984 cFYI(1, "Send error in QFSInfo = %d", rc); 4986 cifs_dbg(FYI, "Send error in QFSInfo = %d\n", rc);
4985 } else { /* decode response */ 4987 } else { /* decode response */
4986 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4988 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4987 4989
@@ -5002,10 +5004,10 @@ QFSInfoRetry:
5002 le64_to_cpu(response_data->TotalAllocationUnits); 5004 le64_to_cpu(response_data->TotalAllocationUnits);
5003 FSData->f_bfree = FSData->f_bavail = 5005 FSData->f_bfree = FSData->f_bavail =
5004 le64_to_cpu(response_data->FreeAllocationUnits); 5006 le64_to_cpu(response_data->FreeAllocationUnits);
5005 cFYI(1, "Blocks: %lld Free: %lld Block size %ld", 5007 cifs_dbg(FYI, "Blocks: %lld Free: %lld Block size %ld\n",
5006 (unsigned long long)FSData->f_blocks, 5008 (unsigned long long)FSData->f_blocks,
5007 (unsigned long long)FSData->f_bfree, 5009 (unsigned long long)FSData->f_bfree,
5008 FSData->f_bsize); 5010 FSData->f_bsize);
5009 } 5011 }
5010 } 5012 }
5011 cifs_buf_release(pSMB); 5013 cifs_buf_release(pSMB);
@@ -5027,7 +5029,7 @@ CIFSSMBQFSAttributeInfo(const unsigned int xid, struct cifs_tcon *tcon)
5027 int bytes_returned = 0; 5029 int bytes_returned = 0;
5028 __u16 params, byte_count; 5030 __u16 params, byte_count;
5029 5031
5030 cFYI(1, "In QFSAttributeInfo"); 5032 cifs_dbg(FYI, "In QFSAttributeInfo\n");
5031QFSAttributeRetry: 5033QFSAttributeRetry:
5032 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5034 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5033 (void **) &pSMBr); 5035 (void **) &pSMBr);
@@ -5061,7 +5063,7 @@ QFSAttributeRetry:
5061 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5063 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5062 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5064 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5063 if (rc) { 5065 if (rc) {
5064 cERROR(1, "Send error in QFSAttributeInfo = %d", rc); 5066 cifs_dbg(VFS, "Send error in QFSAttributeInfo = %d\n", rc);
5065 } else { /* decode response */ 5067 } else { /* decode response */
5066 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5068 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5067 5069
@@ -5097,7 +5099,7 @@ CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon)
5097 int bytes_returned = 0; 5099 int bytes_returned = 0;
5098 __u16 params, byte_count; 5100 __u16 params, byte_count;
5099 5101
5100 cFYI(1, "In QFSDeviceInfo"); 5102 cifs_dbg(FYI, "In QFSDeviceInfo\n");
5101QFSDeviceRetry: 5103QFSDeviceRetry:
5102 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5104 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5103 (void **) &pSMBr); 5105 (void **) &pSMBr);
@@ -5132,7 +5134,7 @@ QFSDeviceRetry:
5132 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5134 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5133 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5135 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5134 if (rc) { 5136 if (rc) {
5135 cFYI(1, "Send error in QFSDeviceInfo = %d", rc); 5137 cifs_dbg(FYI, "Send error in QFSDeviceInfo = %d\n", rc);
5136 } else { /* decode response */ 5138 } else { /* decode response */
5137 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5139 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5138 5140
@@ -5168,7 +5170,7 @@ CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon)
5168 int bytes_returned = 0; 5170 int bytes_returned = 0;
5169 __u16 params, byte_count; 5171 __u16 params, byte_count;
5170 5172
5171 cFYI(1, "In QFSUnixInfo"); 5173 cifs_dbg(FYI, "In QFSUnixInfo\n");
5172QFSUnixRetry: 5174QFSUnixRetry:
5173 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, 5175 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,
5174 (void **) &pSMB, (void **) &pSMBr); 5176 (void **) &pSMB, (void **) &pSMBr);
@@ -5202,7 +5204,7 @@ QFSUnixRetry:
5202 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5204 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5203 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5205 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5204 if (rc) { 5206 if (rc) {
5205 cERROR(1, "Send error in QFSUnixInfo = %d", rc); 5207 cifs_dbg(VFS, "Send error in QFSUnixInfo = %d\n", rc);
5206 } else { /* decode response */ 5208 } else { /* decode response */
5207 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5209 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5208 5210
@@ -5237,7 +5239,7 @@ CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon, __u64 cap)
5237 int bytes_returned = 0; 5239 int bytes_returned = 0;
5238 __u16 params, param_offset, offset, byte_count; 5240 __u16 params, param_offset, offset, byte_count;
5239 5241
5240 cFYI(1, "In SETFSUnixInfo"); 5242 cifs_dbg(FYI, "In SETFSUnixInfo\n");
5241SETFSUnixRetry: 5243SETFSUnixRetry:
5242 /* BB switch to small buf init to save memory */ 5244 /* BB switch to small buf init to save memory */
5243 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, 5245 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,
@@ -5285,7 +5287,7 @@ SETFSUnixRetry:
5285 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5287 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5286 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5288 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5287 if (rc) { 5289 if (rc) {
5288 cERROR(1, "Send error in SETFSUnixInfo = %d", rc); 5290 cifs_dbg(VFS, "Send error in SETFSUnixInfo = %d\n", rc);
5289 } else { /* decode response */ 5291 } else { /* decode response */
5290 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5292 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5291 if (rc) 5293 if (rc)
@@ -5313,7 +5315,7 @@ CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
5313 int bytes_returned = 0; 5315 int bytes_returned = 0;
5314 __u16 params, byte_count; 5316 __u16 params, byte_count;
5315 5317
5316 cFYI(1, "In QFSPosixInfo"); 5318 cifs_dbg(FYI, "In QFSPosixInfo\n");
5317QFSPosixRetry: 5319QFSPosixRetry:
5318 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5320 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5319 (void **) &pSMBr); 5321 (void **) &pSMBr);
@@ -5347,7 +5349,7 @@ QFSPosixRetry:
5347 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5349 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5348 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5350 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5349 if (rc) { 5351 if (rc) {
5350 cFYI(1, "Send error in QFSUnixInfo = %d", rc); 5352 cifs_dbg(FYI, "Send error in QFSUnixInfo = %d\n", rc);
5351 } else { /* decode response */ 5353 } else { /* decode response */
5352 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5354 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5353 5355
@@ -5409,7 +5411,7 @@ CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
5409 5411
5410 __u16 params, byte_count, data_count, param_offset, offset; 5412 __u16 params, byte_count, data_count, param_offset, offset;
5411 5413
5412 cFYI(1, "In SetEOF"); 5414 cifs_dbg(FYI, "In SetEOF\n");
5413SetEOFRetry: 5415SetEOFRetry:
5414 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5416 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5415 (void **) &pSMBr); 5417 (void **) &pSMBr);
@@ -5475,7 +5477,7 @@ SetEOFRetry:
5475 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5477 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5476 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5478 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5477 if (rc) 5479 if (rc)
5478 cFYI(1, "SetPathInfo (file size) returned %d", rc); 5480 cifs_dbg(FYI, "SetPathInfo (file size) returned %d\n", rc);
5479 5481
5480 cifs_buf_release(pSMB); 5482 cifs_buf_release(pSMB);
5481 5483
@@ -5494,8 +5496,8 @@ CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
5494 int rc = 0; 5496 int rc = 0;
5495 __u16 params, param_offset, offset, byte_count, count; 5497 __u16 params, param_offset, offset, byte_count, count;
5496 5498
5497 cFYI(1, "SetFileSize (via SetFileInfo) %lld", 5499 cifs_dbg(FYI, "SetFileSize (via SetFileInfo) %lld\n",
5498 (long long)size); 5500 (long long)size);
5499 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 5501 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5500 5502
5501 if (rc) 5503 if (rc)
@@ -5552,7 +5554,8 @@ CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
5552 pSMB->ByteCount = cpu_to_le16(byte_count); 5554 pSMB->ByteCount = cpu_to_le16(byte_count);
5553 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 5555 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5554 if (rc) { 5556 if (rc) {
5555 cFYI(1, "Send error in SetFileInfo (SetFileSize) = %d", rc); 5557 cifs_dbg(FYI, "Send error in SetFileInfo (SetFileSize) = %d\n",
5558 rc);
5556 } 5559 }
5557 5560
5558 /* Note: On -EAGAIN error only caller can retry on handle based calls 5561 /* Note: On -EAGAIN error only caller can retry on handle based calls
@@ -5576,7 +5579,7 @@ CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5576 int rc = 0; 5579 int rc = 0;
5577 __u16 params, param_offset, offset, byte_count, count; 5580 __u16 params, param_offset, offset, byte_count, count;
5578 5581
5579 cFYI(1, "Set Times (via SetFileInfo)"); 5582 cifs_dbg(FYI, "Set Times (via SetFileInfo)\n");
5580 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 5583 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5581 5584
5582 if (rc) 5585 if (rc)
@@ -5622,7 +5625,8 @@ CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5622 memcpy(data_offset, data, sizeof(FILE_BASIC_INFO)); 5625 memcpy(data_offset, data, sizeof(FILE_BASIC_INFO));
5623 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 5626 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5624 if (rc) 5627 if (rc)
5625 cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); 5628 cifs_dbg(FYI, "Send error in Set Time (SetFileInfo) = %d\n",
5629 rc);
5626 5630
5627 /* Note: On -EAGAIN error only caller can retry on handle based calls 5631 /* Note: On -EAGAIN error only caller can retry on handle based calls
5628 since file handle passed in no longer valid */ 5632 since file handle passed in no longer valid */
@@ -5639,7 +5643,7 @@ CIFSSMBSetFileDisposition(const unsigned int xid, struct cifs_tcon *tcon,
5639 int rc = 0; 5643 int rc = 0;
5640 __u16 params, param_offset, offset, byte_count, count; 5644 __u16 params, param_offset, offset, byte_count, count;
5641 5645
5642 cFYI(1, "Set File Disposition (via SetFileInfo)"); 5646 cifs_dbg(FYI, "Set File Disposition (via SetFileInfo)\n");
5643 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 5647 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5644 5648
5645 if (rc) 5649 if (rc)
@@ -5681,7 +5685,7 @@ CIFSSMBSetFileDisposition(const unsigned int xid, struct cifs_tcon *tcon,
5681 *data_offset = delete_file ? 1 : 0; 5685 *data_offset = delete_file ? 1 : 0;
5682 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 5686 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5683 if (rc) 5687 if (rc)
5684 cFYI(1, "Send error in SetFileDisposition = %d", rc); 5688 cifs_dbg(FYI, "Send error in SetFileDisposition = %d\n", rc);
5685 5689
5686 return rc; 5690 return rc;
5687} 5691}
@@ -5699,7 +5703,7 @@ CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5699 char *data_offset; 5703 char *data_offset;
5700 __u16 params, param_offset, offset, byte_count, count; 5704 __u16 params, param_offset, offset, byte_count, count;
5701 5705
5702 cFYI(1, "In SetTimes"); 5706 cifs_dbg(FYI, "In SetTimes\n");
5703 5707
5704SetTimesRetry: 5708SetTimesRetry:
5705 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5709 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -5755,7 +5759,7 @@ SetTimesRetry:
5755 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5759 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5756 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5760 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5757 if (rc) 5761 if (rc)
5758 cFYI(1, "SetPathInfo (times) returned %d", rc); 5762 cifs_dbg(FYI, "SetPathInfo (times) returned %d\n", rc);
5759 5763
5760 cifs_buf_release(pSMB); 5764 cifs_buf_release(pSMB);
5761 5765
@@ -5780,7 +5784,7 @@ CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon, char *fileName,
5780 int bytes_returned; 5784 int bytes_returned;
5781 int name_len; 5785 int name_len;
5782 5786
5783 cFYI(1, "In SetAttrLegacy"); 5787 cifs_dbg(FYI, "In SetAttrLegacy\n");
5784 5788
5785SetAttrLgcyRetry: 5789SetAttrLgcyRetry:
5786 rc = smb_init(SMB_COM_SETATTR, 8, tcon, (void **) &pSMB, 5790 rc = smb_init(SMB_COM_SETATTR, 8, tcon, (void **) &pSMB,
@@ -5806,7 +5810,7 @@ SetAttrLgcyRetry:
5806 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5810 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5807 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5811 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5808 if (rc) 5812 if (rc)
5809 cFYI(1, "Error in LegacySetAttr = %d", rc); 5813 cifs_dbg(FYI, "Error in LegacySetAttr = %d\n", rc);
5810 5814
5811 cifs_buf_release(pSMB); 5815 cifs_buf_release(pSMB);
5812 5816
@@ -5874,7 +5878,7 @@ CIFSSMBUnixSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5874 int rc = 0; 5878 int rc = 0;
5875 u16 params, param_offset, offset, byte_count, count; 5879 u16 params, param_offset, offset, byte_count, count;
5876 5880
5877 cFYI(1, "Set Unix Info (via SetFileInfo)"); 5881 cifs_dbg(FYI, "Set Unix Info (via SetFileInfo)\n");
5878 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 5882 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5879 5883
5880 if (rc) 5884 if (rc)
@@ -5920,7 +5924,8 @@ CIFSSMBUnixSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5920 5924
5921 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 5925 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5922 if (rc) 5926 if (rc)
5923 cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); 5927 cifs_dbg(FYI, "Send error in Set Time (SetFileInfo) = %d\n",
5928 rc);
5924 5929
5925 /* Note: On -EAGAIN error only caller can retry on handle based calls 5930 /* Note: On -EAGAIN error only caller can retry on handle based calls
5926 since file handle passed in no longer valid */ 5931 since file handle passed in no longer valid */
@@ -5942,7 +5947,7 @@ CIFSSMBUnixSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5942 FILE_UNIX_BASIC_INFO *data_offset; 5947 FILE_UNIX_BASIC_INFO *data_offset;
5943 __u16 params, param_offset, offset, count, byte_count; 5948 __u16 params, param_offset, offset, count, byte_count;
5944 5949
5945 cFYI(1, "In SetUID/GID/Mode"); 5950 cifs_dbg(FYI, "In SetUID/GID/Mode\n");
5946setPermsRetry: 5951setPermsRetry:
5947 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5952 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5948 (void **) &pSMBr); 5953 (void **) &pSMBr);
@@ -5998,7 +6003,7 @@ setPermsRetry:
5998 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 6003 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5999 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 6004 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
6000 if (rc) 6005 if (rc)
6001 cFYI(1, "SetPathInfo (perms) returned %d", rc); 6006 cifs_dbg(FYI, "SetPathInfo (perms) returned %d\n", rc);
6002 6007
6003 cifs_buf_release(pSMB); 6008 cifs_buf_release(pSMB);
6004 if (rc == -EAGAIN) 6009 if (rc == -EAGAIN)
@@ -6035,7 +6040,7 @@ CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
6035 __u16 params, byte_count, data_offset; 6040 __u16 params, byte_count, data_offset;
6036 unsigned int ea_name_len = ea_name ? strlen(ea_name) : 0; 6041 unsigned int ea_name_len = ea_name ? strlen(ea_name) : 0;
6037 6042
6038 cFYI(1, "In Query All EAs path %s", searchName); 6043 cifs_dbg(FYI, "In Query All EAs path %s\n", searchName);
6039QAllEAsRetry: 6044QAllEAsRetry:
6040 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 6045 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
6041 (void **) &pSMBr); 6046 (void **) &pSMBr);
@@ -6082,7 +6087,7 @@ QAllEAsRetry:
6082 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 6087 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
6083 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 6088 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
6084 if (rc) { 6089 if (rc) {
6085 cFYI(1, "Send error in QueryAllEAs = %d", rc); 6090 cifs_dbg(FYI, "Send error in QueryAllEAs = %d\n", rc);
6086 goto QAllEAsOut; 6091 goto QAllEAsOut;
6087 } 6092 }
6088 6093
@@ -6110,16 +6115,16 @@ QAllEAsRetry:
6110 (((char *) &pSMBr->hdr.Protocol) + data_offset); 6115 (((char *) &pSMBr->hdr.Protocol) + data_offset);
6111 6116
6112 list_len = le32_to_cpu(ea_response_data->list_len); 6117 list_len = le32_to_cpu(ea_response_data->list_len);
6113 cFYI(1, "ea length %d", list_len); 6118 cifs_dbg(FYI, "ea length %d\n", list_len);
6114 if (list_len <= 8) { 6119 if (list_len <= 8) {
6115 cFYI(1, "empty EA list returned from server"); 6120 cifs_dbg(FYI, "empty EA list returned from server\n");
6116 goto QAllEAsOut; 6121 goto QAllEAsOut;
6117 } 6122 }
6118 6123
6119 /* make sure list_len doesn't go past end of SMB */ 6124 /* make sure list_len doesn't go past end of SMB */
6120 end_of_smb = (char *)pByteArea(&pSMBr->hdr) + get_bcc(&pSMBr->hdr); 6125 end_of_smb = (char *)pByteArea(&pSMBr->hdr) + get_bcc(&pSMBr->hdr);
6121 if ((char *)ea_response_data + list_len > end_of_smb) { 6126 if ((char *)ea_response_data + list_len > end_of_smb) {
6122 cFYI(1, "EA list appears to go beyond SMB"); 6127 cifs_dbg(FYI, "EA list appears to go beyond SMB\n");
6123 rc = -EIO; 6128 rc = -EIO;
6124 goto QAllEAsOut; 6129 goto QAllEAsOut;
6125 } 6130 }
@@ -6136,7 +6141,7 @@ QAllEAsRetry:
6136 temp_ptr += 4; 6141 temp_ptr += 4;
6137 /* make sure we can read name_len and value_len */ 6142 /* make sure we can read name_len and value_len */
6138 if (list_len < 0) { 6143 if (list_len < 0) {
6139 cFYI(1, "EA entry goes beyond length of list"); 6144 cifs_dbg(FYI, "EA entry goes beyond length of list\n");
6140 rc = -EIO; 6145 rc = -EIO;
6141 goto QAllEAsOut; 6146 goto QAllEAsOut;
6142 } 6147 }
@@ -6145,7 +6150,7 @@ QAllEAsRetry:
6145 value_len = le16_to_cpu(temp_fea->value_len); 6150 value_len = le16_to_cpu(temp_fea->value_len);
6146 list_len -= name_len + 1 + value_len; 6151 list_len -= name_len + 1 + value_len;
6147 if (list_len < 0) { 6152 if (list_len < 0) {
6148 cFYI(1, "EA entry goes beyond length of list"); 6153 cifs_dbg(FYI, "EA entry goes beyond length of list\n");
6149 rc = -EIO; 6154 rc = -EIO;
6150 goto QAllEAsOut; 6155 goto QAllEAsOut;
6151 } 6156 }
@@ -6213,7 +6218,7 @@ CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
6213 int bytes_returned = 0; 6218 int bytes_returned = 0;
6214 __u16 params, param_offset, byte_count, offset, count; 6219 __u16 params, param_offset, byte_count, offset, count;
6215 6220
6216 cFYI(1, "In SetEA"); 6221 cifs_dbg(FYI, "In SetEA\n");
6217SetEARetry: 6222SetEARetry:
6218 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 6223 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
6219 (void **) &pSMBr); 6224 (void **) &pSMBr);
@@ -6295,7 +6300,7 @@ SetEARetry:
6295 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 6300 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
6296 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 6301 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
6297 if (rc) 6302 if (rc)
6298 cFYI(1, "SetPathInfo (EA) returned %d", rc); 6303 cifs_dbg(FYI, "SetPathInfo (EA) returned %d\n", rc);
6299 6304
6300 cifs_buf_release(pSMB); 6305 cifs_buf_release(pSMB);
6301 6306
@@ -6338,7 +6343,7 @@ int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
6338 struct dir_notify_req *dnotify_req; 6343 struct dir_notify_req *dnotify_req;
6339 int bytes_returned; 6344 int bytes_returned;
6340 6345
6341 cFYI(1, "In CIFSSMBNotify for file handle %d", (int)netfid); 6346 cifs_dbg(FYI, "In CIFSSMBNotify for file handle %d\n", (int)netfid);
6342 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, 6347 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB,
6343 (void **) &pSMBr); 6348 (void **) &pSMBr);
6344 if (rc) 6349 if (rc)
@@ -6367,7 +6372,7 @@ int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
6367 (struct smb_hdr *)pSMBr, &bytes_returned, 6372 (struct smb_hdr *)pSMBr, &bytes_returned,
6368 CIFS_ASYNC_OP); 6373 CIFS_ASYNC_OP);
6369 if (rc) { 6374 if (rc) {
6370 cFYI(1, "Error in Notify = %d", rc); 6375 cifs_dbg(FYI, "Error in Notify = %d\n", rc);
6371 } else { 6376 } else {
6372 /* Add file to outstanding requests */ 6377 /* Add file to outstanding requests */
6373 /* BB change to kmem cache alloc */ 6378 /* BB change to kmem cache alloc */