diff options
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 437 |
1 files changed, 219 insertions, 218 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 5d3f29fef532..c65c3419dd37 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fs/cifs/cifssmb.c | 2 | * fs/cifs/cifssmb.c |
3 | * | 3 | * |
4 | * Copyright (C) International Business Machines Corp., 2002,2009 | 4 | * Copyright (C) International Business Machines Corp., 2002,2010 |
5 | * Author(s): Steve French (sfrench@us.ibm.com) | 5 | * Author(s): Steve French (sfrench@us.ibm.com) |
6 | * | 6 | * |
7 | * Contains the routines for constructing the SMB PDUs themselves | 7 | * Contains the routines for constructing the SMB PDUs themselves |
@@ -130,8 +130,8 @@ cifs_reconnect_tcon(struct cifsTconInfo *tcon, int smb_command) | |||
130 | if (smb_command != SMB_COM_WRITE_ANDX && | 130 | if (smb_command != SMB_COM_WRITE_ANDX && |
131 | smb_command != SMB_COM_OPEN_ANDX && | 131 | smb_command != SMB_COM_OPEN_ANDX && |
132 | smb_command != SMB_COM_TREE_DISCONNECT) { | 132 | smb_command != SMB_COM_TREE_DISCONNECT) { |
133 | cFYI(1, ("can not send cmd %d while umounting", | 133 | cFYI(1, "can not send cmd %d while umounting", |
134 | smb_command)); | 134 | smb_command); |
135 | return -ENODEV; | 135 | return -ENODEV; |
136 | } | 136 | } |
137 | } | 137 | } |
@@ -157,7 +157,7 @@ cifs_reconnect_tcon(struct cifsTconInfo *tcon, int smb_command) | |||
157 | * back on-line | 157 | * back on-line |
158 | */ | 158 | */ |
159 | if (!tcon->retry || ses->status == CifsExiting) { | 159 | if (!tcon->retry || ses->status == CifsExiting) { |
160 | cFYI(1, ("gave up waiting on reconnect in smb_init")); | 160 | cFYI(1, "gave up waiting on reconnect in smb_init"); |
161 | return -EHOSTDOWN; | 161 | return -EHOSTDOWN; |
162 | } | 162 | } |
163 | } | 163 | } |
@@ -172,7 +172,8 @@ cifs_reconnect_tcon(struct cifsTconInfo *tcon, int smb_command) | |||
172 | * reconnect the same SMB session | 172 | * reconnect the same SMB session |
173 | */ | 173 | */ |
174 | mutex_lock(&ses->session_mutex); | 174 | mutex_lock(&ses->session_mutex); |
175 | if (ses->need_reconnect) | 175 | rc = cifs_negotiate_protocol(0, ses); |
176 | if (rc == 0 && ses->need_reconnect) | ||
176 | rc = cifs_setup_session(0, ses, nls_codepage); | 177 | rc = cifs_setup_session(0, ses, nls_codepage); |
177 | 178 | ||
178 | /* do we need to reconnect tcon? */ | 179 | /* do we need to reconnect tcon? */ |
@@ -184,7 +185,7 @@ cifs_reconnect_tcon(struct cifsTconInfo *tcon, int smb_command) | |||
184 | mark_open_files_invalid(tcon); | 185 | mark_open_files_invalid(tcon); |
185 | rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage); | 186 | rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage); |
186 | mutex_unlock(&ses->session_mutex); | 187 | mutex_unlock(&ses->session_mutex); |
187 | cFYI(1, ("reconnect tcon rc = %d", rc)); | 188 | cFYI(1, "reconnect tcon rc = %d", rc); |
188 | 189 | ||
189 | if (rc) | 190 | if (rc) |
190 | goto out; | 191 | goto out; |
@@ -355,7 +356,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
355 | struct TCP_Server_Info *server; | 356 | struct TCP_Server_Info *server; |
356 | u16 count; | 357 | u16 count; |
357 | unsigned int secFlags; | 358 | unsigned int secFlags; |
358 | u16 dialect; | ||
359 | 359 | ||
360 | if (ses->server) | 360 | if (ses->server) |
361 | server = ses->server; | 361 | server = ses->server; |
@@ -372,9 +372,9 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
372 | if (ses->overrideSecFlg & (~(CIFSSEC_MUST_SIGN | CIFSSEC_MUST_SEAL))) | 372 | if (ses->overrideSecFlg & (~(CIFSSEC_MUST_SIGN | CIFSSEC_MUST_SEAL))) |
373 | secFlags = ses->overrideSecFlg; /* BB FIXME fix sign flags? */ | 373 | secFlags = ses->overrideSecFlg; /* BB FIXME fix sign flags? */ |
374 | else /* if override flags set only sign/seal OR them with global auth */ | 374 | else /* if override flags set only sign/seal OR them with global auth */ |
375 | secFlags = extended_security | ses->overrideSecFlg; | 375 | secFlags = global_secflags | ses->overrideSecFlg; |
376 | 376 | ||
377 | cFYI(1, ("secFlags 0x%x", secFlags)); | 377 | cFYI(1, "secFlags 0x%x", secFlags); |
378 | 378 | ||
379 | pSMB->hdr.Mid = GetNextMid(server); | 379 | pSMB->hdr.Mid = GetNextMid(server); |
380 | pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS); | 380 | pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS); |
@@ -382,14 +382,14 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
382 | if ((secFlags & CIFSSEC_MUST_KRB5) == CIFSSEC_MUST_KRB5) | 382 | if ((secFlags & CIFSSEC_MUST_KRB5) == CIFSSEC_MUST_KRB5) |
383 | pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; | 383 | pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; |
384 | else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_KRB5) { | 384 | else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_KRB5) { |
385 | cFYI(1, ("Kerberos only mechanism, enable extended security")); | 385 | cFYI(1, "Kerberos only mechanism, enable extended security"); |
386 | pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; | 386 | pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; |
387 | } | 387 | } |
388 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 388 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
389 | else if ((secFlags & CIFSSEC_MUST_NTLMSSP) == CIFSSEC_MUST_NTLMSSP) | 389 | else if ((secFlags & CIFSSEC_MUST_NTLMSSP) == CIFSSEC_MUST_NTLMSSP) |
390 | pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; | 390 | pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; |
391 | else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_NTLMSSP) { | 391 | else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_NTLMSSP) { |
392 | cFYI(1, ("NTLMSSP only mechanism, enable extended security")); | 392 | cFYI(1, "NTLMSSP only mechanism, enable extended security"); |
393 | pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; | 393 | pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; |
394 | } | 394 | } |
395 | #endif | 395 | #endif |
@@ -408,10 +408,10 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
408 | if (rc != 0) | 408 | if (rc != 0) |
409 | goto neg_err_exit; | 409 | goto neg_err_exit; |
410 | 410 | ||
411 | dialect = le16_to_cpu(pSMBr->DialectIndex); | 411 | server->dialect = le16_to_cpu(pSMBr->DialectIndex); |
412 | cFYI(1, ("Dialect: %d", dialect)); | 412 | cFYI(1, "Dialect: %d", server->dialect); |
413 | /* Check wct = 1 error case */ | 413 | /* Check wct = 1 error case */ |
414 | if ((pSMBr->hdr.WordCount < 13) || (dialect == BAD_PROT)) { | 414 | if ((pSMBr->hdr.WordCount < 13) || (server->dialect == BAD_PROT)) { |
415 | /* core returns wct = 1, but we do not ask for core - otherwise | 415 | /* core returns wct = 1, but we do not ask for core - otherwise |
416 | small wct just comes when dialect index is -1 indicating we | 416 | small wct just comes when dialect index is -1 indicating we |
417 | could not negotiate a common dialect */ | 417 | could not negotiate a common dialect */ |
@@ -419,8 +419,8 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
419 | goto neg_err_exit; | 419 | goto neg_err_exit; |
420 | #ifdef CONFIG_CIFS_WEAK_PW_HASH | 420 | #ifdef CONFIG_CIFS_WEAK_PW_HASH |
421 | } else if ((pSMBr->hdr.WordCount == 13) | 421 | } else if ((pSMBr->hdr.WordCount == 13) |
422 | && ((dialect == LANMAN_PROT) | 422 | && ((server->dialect == LANMAN_PROT) |
423 | || (dialect == LANMAN2_PROT))) { | 423 | || (server->dialect == LANMAN2_PROT))) { |
424 | __s16 tmp; | 424 | __s16 tmp; |
425 | struct lanman_neg_rsp *rsp = (struct lanman_neg_rsp *)pSMBr; | 425 | struct lanman_neg_rsp *rsp = (struct lanman_neg_rsp *)pSMBr; |
426 | 426 | ||
@@ -428,8 +428,8 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
428 | (secFlags & CIFSSEC_MAY_PLNTXT)) | 428 | (secFlags & CIFSSEC_MAY_PLNTXT)) |
429 | server->secType = LANMAN; | 429 | server->secType = LANMAN; |
430 | else { | 430 | else { |
431 | cERROR(1, ("mount failed weak security disabled" | 431 | cERROR(1, "mount failed weak security disabled" |
432 | " in /proc/fs/cifs/SecurityFlags")); | 432 | " in /proc/fs/cifs/SecurityFlags"); |
433 | rc = -EOPNOTSUPP; | 433 | rc = -EOPNOTSUPP; |
434 | goto neg_err_exit; | 434 | goto neg_err_exit; |
435 | } | 435 | } |
@@ -462,9 +462,9 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
462 | utc = CURRENT_TIME; | 462 | utc = CURRENT_TIME; |
463 | ts = cnvrtDosUnixTm(rsp->SrvTime.Date, | 463 | ts = cnvrtDosUnixTm(rsp->SrvTime.Date, |
464 | rsp->SrvTime.Time, 0); | 464 | rsp->SrvTime.Time, 0); |
465 | cFYI(1, ("SrvTime %d sec since 1970 (utc: %d) diff: %d", | 465 | cFYI(1, "SrvTime %d sec since 1970 (utc: %d) diff: %d", |
466 | (int)ts.tv_sec, (int)utc.tv_sec, | 466 | (int)ts.tv_sec, (int)utc.tv_sec, |
467 | (int)(utc.tv_sec - ts.tv_sec))); | 467 | (int)(utc.tv_sec - ts.tv_sec)); |
468 | val = (int)(utc.tv_sec - ts.tv_sec); | 468 | val = (int)(utc.tv_sec - ts.tv_sec); |
469 | seconds = abs(val); | 469 | seconds = abs(val); |
470 | result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ; | 470 | result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ; |
@@ -478,7 +478,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
478 | server->timeAdj = (int)tmp; | 478 | server->timeAdj = (int)tmp; |
479 | server->timeAdj *= 60; /* also in seconds */ | 479 | server->timeAdj *= 60; /* also in seconds */ |
480 | } | 480 | } |
481 | cFYI(1, ("server->timeAdj: %d seconds", server->timeAdj)); | 481 | cFYI(1, "server->timeAdj: %d seconds", server->timeAdj); |
482 | 482 | ||
483 | 483 | ||
484 | /* BB get server time for time conversions and add | 484 | /* BB get server time for time conversions and add |
@@ -493,14 +493,14 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
493 | goto neg_err_exit; | 493 | goto neg_err_exit; |
494 | } | 494 | } |
495 | 495 | ||
496 | cFYI(1, ("LANMAN negotiated")); | 496 | cFYI(1, "LANMAN negotiated"); |
497 | /* we will not end up setting signing flags - as no signing | 497 | /* we will not end up setting signing flags - as no signing |
498 | was in LANMAN and server did not return the flags on */ | 498 | was in LANMAN and server did not return the flags on */ |
499 | goto signing_check; | 499 | goto signing_check; |
500 | #else /* weak security disabled */ | 500 | #else /* weak security disabled */ |
501 | } else if (pSMBr->hdr.WordCount == 13) { | 501 | } else if (pSMBr->hdr.WordCount == 13) { |
502 | cERROR(1, ("mount failed, cifs module not built " | 502 | cERROR(1, "mount failed, cifs module not built " |
503 | "with CIFS_WEAK_PW_HASH support")); | 503 | "with CIFS_WEAK_PW_HASH support"); |
504 | rc = -EOPNOTSUPP; | 504 | rc = -EOPNOTSUPP; |
505 | #endif /* WEAK_PW_HASH */ | 505 | #endif /* WEAK_PW_HASH */ |
506 | goto neg_err_exit; | 506 | goto neg_err_exit; |
@@ -512,14 +512,14 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
512 | /* else wct == 17 NTLM */ | 512 | /* else wct == 17 NTLM */ |
513 | server->secMode = pSMBr->SecurityMode; | 513 | server->secMode = pSMBr->SecurityMode; |
514 | if ((server->secMode & SECMODE_USER) == 0) | 514 | if ((server->secMode & SECMODE_USER) == 0) |
515 | cFYI(1, ("share mode security")); | 515 | cFYI(1, "share mode security"); |
516 | 516 | ||
517 | if ((server->secMode & SECMODE_PW_ENCRYPT) == 0) | 517 | if ((server->secMode & SECMODE_PW_ENCRYPT) == 0) |
518 | #ifdef CONFIG_CIFS_WEAK_PW_HASH | 518 | #ifdef CONFIG_CIFS_WEAK_PW_HASH |
519 | if ((secFlags & CIFSSEC_MAY_PLNTXT) == 0) | 519 | if ((secFlags & CIFSSEC_MAY_PLNTXT) == 0) |
520 | #endif /* CIFS_WEAK_PW_HASH */ | 520 | #endif /* CIFS_WEAK_PW_HASH */ |
521 | cERROR(1, ("Server requests plain text password" | 521 | cERROR(1, "Server requests plain text password" |
522 | " but client support disabled")); | 522 | " but client support disabled"); |
523 | 523 | ||
524 | if ((secFlags & CIFSSEC_MUST_NTLMV2) == CIFSSEC_MUST_NTLMV2) | 524 | if ((secFlags & CIFSSEC_MUST_NTLMV2) == CIFSSEC_MUST_NTLMV2) |
525 | server->secType = NTLMv2; | 525 | server->secType = NTLMv2; |
@@ -539,7 +539,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
539 | #endif */ | 539 | #endif */ |
540 | else { | 540 | else { |
541 | rc = -EOPNOTSUPP; | 541 | rc = -EOPNOTSUPP; |
542 | cERROR(1, ("Invalid security type")); | 542 | cERROR(1, "Invalid security type"); |
543 | goto neg_err_exit; | 543 | goto neg_err_exit; |
544 | } | 544 | } |
545 | /* else ... any others ...? */ | 545 | /* else ... any others ...? */ |
@@ -551,7 +551,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
551 | server->maxBuf = min(le32_to_cpu(pSMBr->MaxBufferSize), | 551 | server->maxBuf = min(le32_to_cpu(pSMBr->MaxBufferSize), |
552 | (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE); | 552 | (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE); |
553 | server->max_rw = le32_to_cpu(pSMBr->MaxRawSize); | 553 | server->max_rw = le32_to_cpu(pSMBr->MaxRawSize); |
554 | cFYI(DBG2, ("Max buf = %d", ses->server->maxBuf)); | 554 | cFYI(DBG2, "Max buf = %d", ses->server->maxBuf); |
555 | GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey); | 555 | GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey); |
556 | server->capabilities = le32_to_cpu(pSMBr->Capabilities); | 556 | server->capabilities = le32_to_cpu(pSMBr->Capabilities); |
557 | server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone); | 557 | server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone); |
@@ -582,7 +582,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
582 | if (memcmp(server->server_GUID, | 582 | if (memcmp(server->server_GUID, |
583 | pSMBr->u.extended_response. | 583 | pSMBr->u.extended_response. |
584 | GUID, 16) != 0) { | 584 | GUID, 16) != 0) { |
585 | cFYI(1, ("server UID changed")); | 585 | cFYI(1, "server UID changed"); |
586 | memcpy(server->server_GUID, | 586 | memcpy(server->server_GUID, |
587 | pSMBr->u.extended_response.GUID, | 587 | pSMBr->u.extended_response.GUID, |
588 | 16); | 588 | 16); |
@@ -597,13 +597,19 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
597 | server->secType = RawNTLMSSP; | 597 | server->secType = RawNTLMSSP; |
598 | } else { | 598 | } else { |
599 | rc = decode_negTokenInit(pSMBr->u.extended_response. | 599 | rc = decode_negTokenInit(pSMBr->u.extended_response. |
600 | SecurityBlob, | 600 | SecurityBlob, count - 16, |
601 | count - 16, | 601 | server); |
602 | &server->secType); | ||
603 | if (rc == 1) | 602 | if (rc == 1) |
604 | rc = 0; | 603 | rc = 0; |
605 | else | 604 | else |
606 | rc = -EINVAL; | 605 | rc = -EINVAL; |
606 | |||
607 | if (server->sec_kerberos || server->sec_mskerberos) | ||
608 | server->secType = Kerberos; | ||
609 | else if (server->sec_ntlmssp) | ||
610 | server->secType = RawNTLMSSP; | ||
611 | else | ||
612 | rc = -EOPNOTSUPP; | ||
607 | } | 613 | } |
608 | } else | 614 | } else |
609 | server->capabilities &= ~CAP_EXTENDED_SECURITY; | 615 | server->capabilities &= ~CAP_EXTENDED_SECURITY; |
@@ -614,22 +620,21 @@ signing_check: | |||
614 | if ((secFlags & CIFSSEC_MAY_SIGN) == 0) { | 620 | if ((secFlags & CIFSSEC_MAY_SIGN) == 0) { |
615 | /* MUST_SIGN already includes the MAY_SIGN FLAG | 621 | /* MUST_SIGN already includes the MAY_SIGN FLAG |
616 | so if this is zero it means that signing is disabled */ | 622 | so if this is zero it means that signing is disabled */ |
617 | cFYI(1, ("Signing disabled")); | 623 | cFYI(1, "Signing disabled"); |
618 | if (server->secMode & SECMODE_SIGN_REQUIRED) { | 624 | if (server->secMode & SECMODE_SIGN_REQUIRED) { |
619 | cERROR(1, ("Server requires " | 625 | cERROR(1, "Server requires " |
620 | "packet signing to be enabled in " | 626 | "packet signing to be enabled in " |
621 | "/proc/fs/cifs/SecurityFlags.")); | 627 | "/proc/fs/cifs/SecurityFlags."); |
622 | rc = -EOPNOTSUPP; | 628 | rc = -EOPNOTSUPP; |
623 | } | 629 | } |
624 | server->secMode &= | 630 | server->secMode &= |
625 | ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); | 631 | ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); |
626 | } else if ((secFlags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { | 632 | } else if ((secFlags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { |
627 | /* signing required */ | 633 | /* signing required */ |
628 | cFYI(1, ("Must sign - secFlags 0x%x", secFlags)); | 634 | cFYI(1, "Must sign - secFlags 0x%x", secFlags); |
629 | if ((server->secMode & | 635 | if ((server->secMode & |
630 | (SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED)) == 0) { | 636 | (SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED)) == 0) { |
631 | cERROR(1, | 637 | cERROR(1, "signing required but server lacks support"); |
632 | ("signing required but server lacks support")); | ||
633 | rc = -EOPNOTSUPP; | 638 | rc = -EOPNOTSUPP; |
634 | } else | 639 | } else |
635 | server->secMode |= SECMODE_SIGN_REQUIRED; | 640 | server->secMode |= SECMODE_SIGN_REQUIRED; |
@@ -643,7 +648,7 @@ signing_check: | |||
643 | neg_err_exit: | 648 | neg_err_exit: |
644 | cifs_buf_release(pSMB); | 649 | cifs_buf_release(pSMB); |
645 | 650 | ||
646 | cFYI(1, ("negprot rc %d", rc)); | 651 | cFYI(1, "negprot rc %d", rc); |
647 | return rc; | 652 | return rc; |
648 | } | 653 | } |
649 | 654 | ||
@@ -653,7 +658,7 @@ CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon) | |||
653 | struct smb_hdr *smb_buffer; | 658 | struct smb_hdr *smb_buffer; |
654 | int rc = 0; | 659 | int rc = 0; |
655 | 660 | ||
656 | cFYI(1, ("In tree disconnect")); | 661 | cFYI(1, "In tree disconnect"); |
657 | 662 | ||
658 | /* BB: do we need to check this? These should never be NULL. */ | 663 | /* BB: do we need to check this? These should never be NULL. */ |
659 | if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) | 664 | if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) |
@@ -675,7 +680,7 @@ CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon) | |||
675 | 680 | ||
676 | rc = SendReceiveNoRsp(xid, tcon->ses, smb_buffer, 0); | 681 | rc = SendReceiveNoRsp(xid, tcon->ses, smb_buffer, 0); |
677 | if (rc) | 682 | if (rc) |
678 | cFYI(1, ("Tree disconnect failed %d", rc)); | 683 | cFYI(1, "Tree disconnect failed %d", rc); |
679 | 684 | ||
680 | /* No need to return error on this operation if tid invalidated and | 685 | /* No need to return error on this operation if tid invalidated and |
681 | closed on server already e.g. due to tcp session crashing */ | 686 | closed on server already e.g. due to tcp session crashing */ |
@@ -691,7 +696,7 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses) | |||
691 | LOGOFF_ANDX_REQ *pSMB; | 696 | LOGOFF_ANDX_REQ *pSMB; |
692 | int rc = 0; | 697 | int rc = 0; |
693 | 698 | ||
694 | cFYI(1, ("In SMBLogoff for session disconnect")); | 699 | cFYI(1, "In SMBLogoff for session disconnect"); |
695 | 700 | ||
696 | /* | 701 | /* |
697 | * BB: do we need to check validity of ses and server? They should | 702 | * BB: do we need to check validity of ses and server? They should |
@@ -744,7 +749,7 @@ CIFSPOSIXDelFile(const int xid, struct cifsTconInfo *tcon, const char *fileName, | |||
744 | int bytes_returned = 0; | 749 | int bytes_returned = 0; |
745 | __u16 params, param_offset, offset, byte_count; | 750 | __u16 params, param_offset, offset, byte_count; |
746 | 751 | ||
747 | cFYI(1, ("In POSIX delete")); | 752 | cFYI(1, "In POSIX delete"); |
748 | PsxDelete: | 753 | PsxDelete: |
749 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 754 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
750 | (void **) &pSMBr); | 755 | (void **) &pSMBr); |
@@ -796,7 +801,7 @@ PsxDelete: | |||
796 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 801 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
797 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 802 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
798 | if (rc) | 803 | if (rc) |
799 | cFYI(1, ("Posix delete returned %d", rc)); | 804 | cFYI(1, "Posix delete returned %d", rc); |
800 | cifs_buf_release(pSMB); | 805 | cifs_buf_release(pSMB); |
801 | 806 | ||
802 | cifs_stats_inc(&tcon->num_deletes); | 807 | cifs_stats_inc(&tcon->num_deletes); |
@@ -843,7 +848,7 @@ DelFileRetry: | |||
843 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 848 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
844 | cifs_stats_inc(&tcon->num_deletes); | 849 | cifs_stats_inc(&tcon->num_deletes); |
845 | if (rc) | 850 | if (rc) |
846 | cFYI(1, ("Error in RMFile = %d", rc)); | 851 | cFYI(1, "Error in RMFile = %d", rc); |
847 | 852 | ||
848 | cifs_buf_release(pSMB); | 853 | cifs_buf_release(pSMB); |
849 | if (rc == -EAGAIN) | 854 | if (rc == -EAGAIN) |
@@ -862,7 +867,7 @@ CIFSSMBRmDir(const int xid, struct cifsTconInfo *tcon, const char *dirName, | |||
862 | int bytes_returned; | 867 | int bytes_returned; |
863 | int name_len; | 868 | int name_len; |
864 | 869 | ||
865 | cFYI(1, ("In CIFSSMBRmDir")); | 870 | cFYI(1, "In CIFSSMBRmDir"); |
866 | RmDirRetry: | 871 | RmDirRetry: |
867 | rc = smb_init(SMB_COM_DELETE_DIRECTORY, 0, tcon, (void **) &pSMB, | 872 | rc = smb_init(SMB_COM_DELETE_DIRECTORY, 0, tcon, (void **) &pSMB, |
868 | (void **) &pSMBr); | 873 | (void **) &pSMBr); |
@@ -887,7 +892,7 @@ RmDirRetry: | |||
887 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 892 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
888 | cifs_stats_inc(&tcon->num_rmdirs); | 893 | cifs_stats_inc(&tcon->num_rmdirs); |
889 | if (rc) | 894 | if (rc) |
890 | cFYI(1, ("Error in RMDir = %d", rc)); | 895 | cFYI(1, "Error in RMDir = %d", rc); |
891 | 896 | ||
892 | cifs_buf_release(pSMB); | 897 | cifs_buf_release(pSMB); |
893 | if (rc == -EAGAIN) | 898 | if (rc == -EAGAIN) |
@@ -905,7 +910,7 @@ CIFSSMBMkDir(const int xid, struct cifsTconInfo *tcon, | |||
905 | int bytes_returned; | 910 | int bytes_returned; |
906 | int name_len; | 911 | int name_len; |
907 | 912 | ||
908 | cFYI(1, ("In CIFSSMBMkDir")); | 913 | cFYI(1, "In CIFSSMBMkDir"); |
909 | MkDirRetry: | 914 | MkDirRetry: |
910 | rc = smb_init(SMB_COM_CREATE_DIRECTORY, 0, tcon, (void **) &pSMB, | 915 | rc = smb_init(SMB_COM_CREATE_DIRECTORY, 0, tcon, (void **) &pSMB, |
911 | (void **) &pSMBr); | 916 | (void **) &pSMBr); |
@@ -930,7 +935,7 @@ MkDirRetry: | |||
930 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 935 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
931 | cifs_stats_inc(&tcon->num_mkdirs); | 936 | cifs_stats_inc(&tcon->num_mkdirs); |
932 | if (rc) | 937 | if (rc) |
933 | cFYI(1, ("Error in Mkdir = %d", rc)); | 938 | cFYI(1, "Error in Mkdir = %d", rc); |
934 | 939 | ||
935 | cifs_buf_release(pSMB); | 940 | cifs_buf_release(pSMB); |
936 | if (rc == -EAGAIN) | 941 | if (rc == -EAGAIN) |
@@ -953,7 +958,7 @@ CIFSPOSIXCreate(const int xid, struct cifsTconInfo *tcon, __u32 posix_flags, | |||
953 | OPEN_PSX_REQ *pdata; | 958 | OPEN_PSX_REQ *pdata; |
954 | OPEN_PSX_RSP *psx_rsp; | 959 | OPEN_PSX_RSP *psx_rsp; |
955 | 960 | ||
956 | cFYI(1, ("In POSIX Create")); | 961 | cFYI(1, "In POSIX Create"); |
957 | PsxCreat: | 962 | PsxCreat: |
958 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 963 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
959 | (void **) &pSMBr); | 964 | (void **) &pSMBr); |
@@ -1007,11 +1012,11 @@ PsxCreat: | |||
1007 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 1012 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
1008 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1013 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1009 | if (rc) { | 1014 | if (rc) { |
1010 | cFYI(1, ("Posix create returned %d", rc)); | 1015 | cFYI(1, "Posix create returned %d", rc); |
1011 | goto psx_create_err; | 1016 | goto psx_create_err; |
1012 | } | 1017 | } |
1013 | 1018 | ||
1014 | cFYI(1, ("copying inode info")); | 1019 | cFYI(1, "copying inode info"); |
1015 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 1020 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
1016 | 1021 | ||
1017 | if (rc || (pSMBr->ByteCount < sizeof(OPEN_PSX_RSP))) { | 1022 | if (rc || (pSMBr->ByteCount < sizeof(OPEN_PSX_RSP))) { |
@@ -1033,11 +1038,11 @@ PsxCreat: | |||
1033 | /* check to make sure response data is there */ | 1038 | /* check to make sure response data is there */ |
1034 | if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) { | 1039 | if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) { |
1035 | pRetData->Type = cpu_to_le32(-1); /* unknown */ | 1040 | pRetData->Type = cpu_to_le32(-1); /* unknown */ |
1036 | cFYI(DBG2, ("unknown type")); | 1041 | cFYI(DBG2, "unknown type"); |
1037 | } else { | 1042 | } else { |
1038 | if (pSMBr->ByteCount < sizeof(OPEN_PSX_RSP) | 1043 | if (pSMBr->ByteCount < sizeof(OPEN_PSX_RSP) |
1039 | + sizeof(FILE_UNIX_BASIC_INFO)) { | 1044 | + sizeof(FILE_UNIX_BASIC_INFO)) { |
1040 | cERROR(1, ("Open response data too small")); | 1045 | cERROR(1, "Open response data too small"); |
1041 | pRetData->Type = cpu_to_le32(-1); | 1046 | pRetData->Type = cpu_to_le32(-1); |
1042 | goto psx_create_err; | 1047 | goto psx_create_err; |
1043 | } | 1048 | } |
@@ -1084,7 +1089,7 @@ static __u16 convert_disposition(int disposition) | |||
1084 | ofun = SMBOPEN_OCREATE | SMBOPEN_OTRUNC; | 1089 | ofun = SMBOPEN_OCREATE | SMBOPEN_OTRUNC; |
1085 | break; | 1090 | break; |
1086 | default: | 1091 | default: |
1087 | cFYI(1, ("unknown disposition %d", disposition)); | 1092 | cFYI(1, "unknown disposition %d", disposition); |
1088 | ofun = SMBOPEN_OAPPEND; /* regular open */ | 1093 | ofun = SMBOPEN_OAPPEND; /* regular open */ |
1089 | } | 1094 | } |
1090 | return ofun; | 1095 | return ofun; |
@@ -1175,7 +1180,7 @@ OldOpenRetry: | |||
1175 | (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP); | 1180 | (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP); |
1176 | cifs_stats_inc(&tcon->num_opens); | 1181 | cifs_stats_inc(&tcon->num_opens); |
1177 | if (rc) { | 1182 | if (rc) { |
1178 | cFYI(1, ("Error in Open = %d", rc)); | 1183 | cFYI(1, "Error in Open = %d", rc); |
1179 | } else { | 1184 | } else { |
1180 | /* BB verify if wct == 15 */ | 1185 | /* BB verify if wct == 15 */ |
1181 | 1186 | ||
@@ -1288,7 +1293,7 @@ openRetry: | |||
1288 | (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP); | 1293 | (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP); |
1289 | cifs_stats_inc(&tcon->num_opens); | 1294 | cifs_stats_inc(&tcon->num_opens); |
1290 | if (rc) { | 1295 | if (rc) { |
1291 | cFYI(1, ("Error in Open = %d", rc)); | 1296 | cFYI(1, "Error in Open = %d", rc); |
1292 | } else { | 1297 | } else { |
1293 | *pOplock = pSMBr->OplockLevel; /* 1 byte no need to le_to_cpu */ | 1298 | *pOplock = pSMBr->OplockLevel; /* 1 byte no need to le_to_cpu */ |
1294 | *netfid = pSMBr->Fid; /* cifs fid stays in le */ | 1299 | *netfid = pSMBr->Fid; /* cifs fid stays in le */ |
@@ -1326,7 +1331,7 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon, const int netfid, | |||
1326 | int resp_buf_type = 0; | 1331 | int resp_buf_type = 0; |
1327 | struct kvec iov[1]; | 1332 | struct kvec iov[1]; |
1328 | 1333 | ||
1329 | cFYI(1, ("Reading %d bytes on fid %d", count, netfid)); | 1334 | cFYI(1, "Reading %d bytes on fid %d", count, netfid); |
1330 | if (tcon->ses->capabilities & CAP_LARGE_FILES) | 1335 | if (tcon->ses->capabilities & CAP_LARGE_FILES) |
1331 | wct = 12; | 1336 | wct = 12; |
1332 | else { | 1337 | else { |
@@ -1371,7 +1376,7 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon, const int netfid, | |||
1371 | cifs_stats_inc(&tcon->num_reads); | 1376 | cifs_stats_inc(&tcon->num_reads); |
1372 | pSMBr = (READ_RSP *)iov[0].iov_base; | 1377 | pSMBr = (READ_RSP *)iov[0].iov_base; |
1373 | if (rc) { | 1378 | if (rc) { |
1374 | cERROR(1, ("Send error in read = %d", rc)); | 1379 | cERROR(1, "Send error in read = %d", rc); |
1375 | } else { | 1380 | } else { |
1376 | int data_length = le16_to_cpu(pSMBr->DataLengthHigh); | 1381 | int data_length = le16_to_cpu(pSMBr->DataLengthHigh); |
1377 | data_length = data_length << 16; | 1382 | data_length = data_length << 16; |
@@ -1381,15 +1386,15 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon, const int netfid, | |||
1381 | /*check that DataLength would not go beyond end of SMB */ | 1386 | /*check that DataLength would not go beyond end of SMB */ |
1382 | if ((data_length > CIFSMaxBufSize) | 1387 | if ((data_length > CIFSMaxBufSize) |
1383 | || (data_length > count)) { | 1388 | || (data_length > count)) { |
1384 | cFYI(1, ("bad length %d for count %d", | 1389 | cFYI(1, "bad length %d for count %d", |
1385 | data_length, count)); | 1390 | data_length, count); |
1386 | rc = -EIO; | 1391 | rc = -EIO; |
1387 | *nbytes = 0; | 1392 | *nbytes = 0; |
1388 | } else { | 1393 | } else { |
1389 | pReadData = (char *) (&pSMBr->hdr.Protocol) + | 1394 | pReadData = (char *) (&pSMBr->hdr.Protocol) + |
1390 | le16_to_cpu(pSMBr->DataOffset); | 1395 | le16_to_cpu(pSMBr->DataOffset); |
1391 | /* if (rc = copy_to_user(buf, pReadData, data_length)) { | 1396 | /* if (rc = copy_to_user(buf, pReadData, data_length)) { |
1392 | cERROR(1,("Faulting on read rc = %d",rc)); | 1397 | cERROR(1, "Faulting on read rc = %d",rc); |
1393 | rc = -EFAULT; | 1398 | rc = -EFAULT; |
1394 | }*/ /* can not use copy_to_user when using page cache*/ | 1399 | }*/ /* can not use copy_to_user when using page cache*/ |
1395 | if (*buf) | 1400 | if (*buf) |
@@ -1433,7 +1438,7 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, | |||
1433 | 1438 | ||
1434 | *nbytes = 0; | 1439 | *nbytes = 0; |
1435 | 1440 | ||
1436 | /* cFYI(1, ("write at %lld %d bytes", offset, count));*/ | 1441 | /* cFYI(1, "write at %lld %d bytes", offset, count);*/ |
1437 | if (tcon->ses == NULL) | 1442 | if (tcon->ses == NULL) |
1438 | return -ECONNABORTED; | 1443 | return -ECONNABORTED; |
1439 | 1444 | ||
@@ -1514,7 +1519,7 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, | |||
1514 | (struct smb_hdr *) pSMBr, &bytes_returned, long_op); | 1519 | (struct smb_hdr *) pSMBr, &bytes_returned, long_op); |
1515 | cifs_stats_inc(&tcon->num_writes); | 1520 | cifs_stats_inc(&tcon->num_writes); |
1516 | if (rc) { | 1521 | if (rc) { |
1517 | cFYI(1, ("Send error in write = %d", rc)); | 1522 | cFYI(1, "Send error in write = %d", rc); |
1518 | } else { | 1523 | } else { |
1519 | *nbytes = le16_to_cpu(pSMBr->CountHigh); | 1524 | *nbytes = le16_to_cpu(pSMBr->CountHigh); |
1520 | *nbytes = (*nbytes) << 16; | 1525 | *nbytes = (*nbytes) << 16; |
@@ -1551,7 +1556,7 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, | |||
1551 | 1556 | ||
1552 | *nbytes = 0; | 1557 | *nbytes = 0; |
1553 | 1558 | ||
1554 | cFYI(1, ("write2 at %lld %d bytes", (long long)offset, count)); | 1559 | cFYI(1, "write2 at %lld %d bytes", (long long)offset, count); |
1555 | 1560 | ||
1556 | if (tcon->ses->capabilities & CAP_LARGE_FILES) { | 1561 | if (tcon->ses->capabilities & CAP_LARGE_FILES) { |
1557 | wct = 14; | 1562 | wct = 14; |
@@ -1606,7 +1611,7 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, | |||
1606 | long_op); | 1611 | long_op); |
1607 | cifs_stats_inc(&tcon->num_writes); | 1612 | cifs_stats_inc(&tcon->num_writes); |
1608 | if (rc) { | 1613 | if (rc) { |
1609 | cFYI(1, ("Send error Write2 = %d", rc)); | 1614 | cFYI(1, "Send error Write2 = %d", rc); |
1610 | } else if (resp_buf_type == 0) { | 1615 | } else if (resp_buf_type == 0) { |
1611 | /* presumably this can not happen, but best to be safe */ | 1616 | /* presumably this can not happen, but best to be safe */ |
1612 | rc = -EIO; | 1617 | rc = -EIO; |
@@ -1651,7 +1656,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, | |||
1651 | int timeout = 0; | 1656 | int timeout = 0; |
1652 | __u16 count; | 1657 | __u16 count; |
1653 | 1658 | ||
1654 | cFYI(1, ("CIFSSMBLock timeout %d numLock %d", (int)waitFlag, numLock)); | 1659 | cFYI(1, "CIFSSMBLock timeout %d numLock %d", (int)waitFlag, numLock); |
1655 | rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); | 1660 | rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); |
1656 | 1661 | ||
1657 | if (rc) | 1662 | if (rc) |
@@ -1699,7 +1704,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, | |||
1699 | } | 1704 | } |
1700 | cifs_stats_inc(&tcon->num_locks); | 1705 | cifs_stats_inc(&tcon->num_locks); |
1701 | if (rc) | 1706 | if (rc) |
1702 | cFYI(1, ("Send error in Lock = %d", rc)); | 1707 | cFYI(1, "Send error in Lock = %d", rc); |
1703 | 1708 | ||
1704 | /* Note: On -EAGAIN error only caller can retry on handle based calls | 1709 | /* Note: On -EAGAIN error only caller can retry on handle based calls |
1705 | since file handle passed in no longer valid */ | 1710 | since file handle passed in no longer valid */ |
@@ -1722,7 +1727,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1722 | __u16 params, param_offset, offset, byte_count, count; | 1727 | __u16 params, param_offset, offset, byte_count, count; |
1723 | struct kvec iov[1]; | 1728 | struct kvec iov[1]; |
1724 | 1729 | ||
1725 | cFYI(1, ("Posix Lock")); | 1730 | cFYI(1, "Posix Lock"); |
1726 | 1731 | ||
1727 | if (pLockData == NULL) | 1732 | if (pLockData == NULL) |
1728 | return -EINVAL; | 1733 | return -EINVAL; |
@@ -1792,7 +1797,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, | |||
1792 | } | 1797 | } |
1793 | 1798 | ||
1794 | if (rc) { | 1799 | if (rc) { |
1795 | cFYI(1, ("Send error in Posix Lock = %d", rc)); | 1800 | cFYI(1, "Send error in Posix Lock = %d", rc); |
1796 | } else if (get_flag) { | 1801 | } else if (get_flag) { |
1797 | /* lock structure can be returned on get */ | 1802 | /* lock structure can be returned on get */ |
1798 | __u16 data_offset; | 1803 | __u16 data_offset; |
@@ -1849,7 +1854,7 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id) | |||
1849 | { | 1854 | { |
1850 | int rc = 0; | 1855 | int rc = 0; |
1851 | CLOSE_REQ *pSMB = NULL; | 1856 | CLOSE_REQ *pSMB = NULL; |
1852 | cFYI(1, ("In CIFSSMBClose")); | 1857 | cFYI(1, "In CIFSSMBClose"); |
1853 | 1858 | ||
1854 | /* do not retry on dead session on close */ | 1859 | /* do not retry on dead session on close */ |
1855 | rc = small_smb_init(SMB_COM_CLOSE, 3, tcon, (void **) &pSMB); | 1860 | rc = small_smb_init(SMB_COM_CLOSE, 3, tcon, (void **) &pSMB); |
@@ -1866,7 +1871,7 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id) | |||
1866 | if (rc) { | 1871 | if (rc) { |
1867 | if (rc != -EINTR) { | 1872 | if (rc != -EINTR) { |
1868 | /* EINTR is expected when user ctl-c to kill app */ | 1873 | /* EINTR is expected when user ctl-c to kill app */ |
1869 | cERROR(1, ("Send error in Close = %d", rc)); | 1874 | cERROR(1, "Send error in Close = %d", rc); |
1870 | } | 1875 | } |
1871 | } | 1876 | } |
1872 | 1877 | ||
@@ -1882,7 +1887,7 @@ CIFSSMBFlush(const int xid, struct cifsTconInfo *tcon, int smb_file_id) | |||
1882 | { | 1887 | { |
1883 | int rc = 0; | 1888 | int rc = 0; |
1884 | FLUSH_REQ *pSMB = NULL; | 1889 | FLUSH_REQ *pSMB = NULL; |
1885 | cFYI(1, ("In CIFSSMBFlush")); | 1890 | cFYI(1, "In CIFSSMBFlush"); |
1886 | 1891 | ||
1887 | rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB); | 1892 | rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB); |
1888 | if (rc) | 1893 | if (rc) |
@@ -1893,7 +1898,7 @@ CIFSSMBFlush(const int xid, struct cifsTconInfo *tcon, int smb_file_id) | |||
1893 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 1898 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); |
1894 | cifs_stats_inc(&tcon->num_flushes); | 1899 | cifs_stats_inc(&tcon->num_flushes); |
1895 | if (rc) | 1900 | if (rc) |
1896 | cERROR(1, ("Send error in Flush = %d", rc)); | 1901 | cERROR(1, "Send error in Flush = %d", rc); |
1897 | 1902 | ||
1898 | return rc; | 1903 | return rc; |
1899 | } | 1904 | } |
@@ -1910,7 +1915,7 @@ CIFSSMBRename(const int xid, struct cifsTconInfo *tcon, | |||
1910 | int name_len, name_len2; | 1915 | int name_len, name_len2; |
1911 | __u16 count; | 1916 | __u16 count; |
1912 | 1917 | ||
1913 | cFYI(1, ("In CIFSSMBRename")); | 1918 | cFYI(1, "In CIFSSMBRename"); |
1914 | renameRetry: | 1919 | renameRetry: |
1915 | rc = smb_init(SMB_COM_RENAME, 1, tcon, (void **) &pSMB, | 1920 | rc = smb_init(SMB_COM_RENAME, 1, tcon, (void **) &pSMB, |
1916 | (void **) &pSMBr); | 1921 | (void **) &pSMBr); |
@@ -1956,7 +1961,7 @@ renameRetry: | |||
1956 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1961 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1957 | cifs_stats_inc(&tcon->num_renames); | 1962 | cifs_stats_inc(&tcon->num_renames); |
1958 | if (rc) | 1963 | if (rc) |
1959 | cFYI(1, ("Send error in rename = %d", rc)); | 1964 | cFYI(1, "Send error in rename = %d", rc); |
1960 | 1965 | ||
1961 | cifs_buf_release(pSMB); | 1966 | cifs_buf_release(pSMB); |
1962 | 1967 | ||
@@ -1980,7 +1985,7 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifsTconInfo *pTcon, | |||
1980 | int len_of_str; | 1985 | int len_of_str; |
1981 | __u16 params, param_offset, offset, count, byte_count; | 1986 | __u16 params, param_offset, offset, count, byte_count; |
1982 | 1987 | ||
1983 | cFYI(1, ("Rename to File by handle")); | 1988 | cFYI(1, "Rename to File by handle"); |
1984 | rc = smb_init(SMB_COM_TRANSACTION2, 15, pTcon, (void **) &pSMB, | 1989 | rc = smb_init(SMB_COM_TRANSACTION2, 15, pTcon, (void **) &pSMB, |
1985 | (void **) &pSMBr); | 1990 | (void **) &pSMBr); |
1986 | if (rc) | 1991 | if (rc) |
@@ -2035,7 +2040,7 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifsTconInfo *pTcon, | |||
2035 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2040 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2036 | cifs_stats_inc(&pTcon->num_t2renames); | 2041 | cifs_stats_inc(&pTcon->num_t2renames); |
2037 | if (rc) | 2042 | if (rc) |
2038 | cFYI(1, ("Send error in Rename (by file handle) = %d", rc)); | 2043 | cFYI(1, "Send error in Rename (by file handle) = %d", rc); |
2039 | 2044 | ||
2040 | cifs_buf_release(pSMB); | 2045 | cifs_buf_release(pSMB); |
2041 | 2046 | ||
@@ -2057,7 +2062,7 @@ CIFSSMBCopy(const int xid, struct cifsTconInfo *tcon, const char *fromName, | |||
2057 | int name_len, name_len2; | 2062 | int name_len, name_len2; |
2058 | __u16 count; | 2063 | __u16 count; |
2059 | 2064 | ||
2060 | cFYI(1, ("In CIFSSMBCopy")); | 2065 | cFYI(1, "In CIFSSMBCopy"); |
2061 | copyRetry: | 2066 | copyRetry: |
2062 | rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB, | 2067 | rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB, |
2063 | (void **) &pSMBr); | 2068 | (void **) &pSMBr); |
@@ -2102,8 +2107,8 @@ copyRetry: | |||
2102 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 2107 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
2103 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2108 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2104 | if (rc) { | 2109 | if (rc) { |
2105 | cFYI(1, ("Send error in copy = %d with %d files copied", | 2110 | cFYI(1, "Send error in copy = %d with %d files copied", |
2106 | rc, le16_to_cpu(pSMBr->CopyCount))); | 2111 | rc, le16_to_cpu(pSMBr->CopyCount)); |
2107 | } | 2112 | } |
2108 | cifs_buf_release(pSMB); | 2113 | cifs_buf_release(pSMB); |
2109 | 2114 | ||
@@ -2127,7 +2132,7 @@ CIFSUnixCreateSymLink(const int xid, struct cifsTconInfo *tcon, | |||
2127 | int bytes_returned = 0; | 2132 | int bytes_returned = 0; |
2128 | __u16 params, param_offset, offset, byte_count; | 2133 | __u16 params, param_offset, offset, byte_count; |
2129 | 2134 | ||
2130 | cFYI(1, ("In Symlink Unix style")); | 2135 | cFYI(1, "In Symlink Unix style"); |
2131 | createSymLinkRetry: | 2136 | createSymLinkRetry: |
2132 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 2137 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
2133 | (void **) &pSMBr); | 2138 | (void **) &pSMBr); |
@@ -2192,7 +2197,7 @@ createSymLinkRetry: | |||
2192 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2197 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2193 | cifs_stats_inc(&tcon->num_symlinks); | 2198 | cifs_stats_inc(&tcon->num_symlinks); |
2194 | if (rc) | 2199 | if (rc) |
2195 | cFYI(1, ("Send error in SetPathInfo create symlink = %d", rc)); | 2200 | cFYI(1, "Send error in SetPathInfo create symlink = %d", rc); |
2196 | 2201 | ||
2197 | cifs_buf_release(pSMB); | 2202 | cifs_buf_release(pSMB); |
2198 | 2203 | ||
@@ -2216,7 +2221,7 @@ CIFSUnixCreateHardLink(const int xid, struct cifsTconInfo *tcon, | |||
2216 | int bytes_returned = 0; | 2221 | int bytes_returned = 0; |
2217 | __u16 params, param_offset, offset, byte_count; | 2222 | __u16 params, param_offset, offset, byte_count; |
2218 | 2223 | ||
2219 | cFYI(1, ("In Create Hard link Unix style")); | 2224 | cFYI(1, "In Create Hard link Unix style"); |
2220 | createHardLinkRetry: | 2225 | createHardLinkRetry: |
2221 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 2226 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
2222 | (void **) &pSMBr); | 2227 | (void **) &pSMBr); |
@@ -2278,7 +2283,7 @@ createHardLinkRetry: | |||
2278 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2283 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2279 | cifs_stats_inc(&tcon->num_hardlinks); | 2284 | cifs_stats_inc(&tcon->num_hardlinks); |
2280 | if (rc) | 2285 | if (rc) |
2281 | cFYI(1, ("Send error in SetPathInfo (hard link) = %d", rc)); | 2286 | cFYI(1, "Send error in SetPathInfo (hard link) = %d", rc); |
2282 | 2287 | ||
2283 | cifs_buf_release(pSMB); | 2288 | cifs_buf_release(pSMB); |
2284 | if (rc == -EAGAIN) | 2289 | if (rc == -EAGAIN) |
@@ -2299,7 +2304,7 @@ CIFSCreateHardLink(const int xid, struct cifsTconInfo *tcon, | |||
2299 | int name_len, name_len2; | 2304 | int name_len, name_len2; |
2300 | __u16 count; | 2305 | __u16 count; |
2301 | 2306 | ||
2302 | cFYI(1, ("In CIFSCreateHardLink")); | 2307 | cFYI(1, "In CIFSCreateHardLink"); |
2303 | winCreateHardLinkRetry: | 2308 | winCreateHardLinkRetry: |
2304 | 2309 | ||
2305 | rc = smb_init(SMB_COM_NT_RENAME, 4, tcon, (void **) &pSMB, | 2310 | rc = smb_init(SMB_COM_NT_RENAME, 4, tcon, (void **) &pSMB, |
@@ -2350,7 +2355,7 @@ winCreateHardLinkRetry: | |||
2350 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2355 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2351 | cifs_stats_inc(&tcon->num_hardlinks); | 2356 | cifs_stats_inc(&tcon->num_hardlinks); |
2352 | if (rc) | 2357 | if (rc) |
2353 | cFYI(1, ("Send error in hard link (NT rename) = %d", rc)); | 2358 | cFYI(1, "Send error in hard link (NT rename) = %d", rc); |
2354 | 2359 | ||
2355 | cifs_buf_release(pSMB); | 2360 | cifs_buf_release(pSMB); |
2356 | if (rc == -EAGAIN) | 2361 | if (rc == -EAGAIN) |
@@ -2373,7 +2378,7 @@ CIFSSMBUnixQuerySymLink(const int xid, struct cifsTconInfo *tcon, | |||
2373 | __u16 params, byte_count; | 2378 | __u16 params, byte_count; |
2374 | char *data_start; | 2379 | char *data_start; |
2375 | 2380 | ||
2376 | cFYI(1, ("In QPathSymLinkInfo (Unix) for path %s", searchName)); | 2381 | cFYI(1, "In QPathSymLinkInfo (Unix) for path %s", searchName); |
2377 | 2382 | ||
2378 | querySymLinkRetry: | 2383 | querySymLinkRetry: |
2379 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 2384 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
@@ -2420,7 +2425,7 @@ querySymLinkRetry: | |||
2420 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 2425 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
2421 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2426 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2422 | if (rc) { | 2427 | if (rc) { |
2423 | cFYI(1, ("Send error in QuerySymLinkInfo = %d", rc)); | 2428 | cFYI(1, "Send error in QuerySymLinkInfo = %d", rc); |
2424 | } else { | 2429 | } else { |
2425 | /* decode response */ | 2430 | /* decode response */ |
2426 | 2431 | ||
@@ -2521,21 +2526,21 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata, | |||
2521 | 2526 | ||
2522 | /* should we also check that parm and data areas do not overlap? */ | 2527 | /* should we also check that parm and data areas do not overlap? */ |
2523 | if (*ppparm > end_of_smb) { | 2528 | if (*ppparm > end_of_smb) { |
2524 | cFYI(1, ("parms start after end of smb")); | 2529 | cFYI(1, "parms start after end of smb"); |
2525 | return -EINVAL; | 2530 | return -EINVAL; |
2526 | } else if (parm_count + *ppparm > end_of_smb) { | 2531 | } else if (parm_count + *ppparm > end_of_smb) { |
2527 | cFYI(1, ("parm end after end of smb")); | 2532 | cFYI(1, "parm end after end of smb"); |
2528 | return -EINVAL; | 2533 | return -EINVAL; |
2529 | } else if (*ppdata > end_of_smb) { | 2534 | } else if (*ppdata > end_of_smb) { |
2530 | cFYI(1, ("data starts after end of smb")); | 2535 | cFYI(1, "data starts after end of smb"); |
2531 | return -EINVAL; | 2536 | return -EINVAL; |
2532 | } else if (data_count + *ppdata > end_of_smb) { | 2537 | } else if (data_count + *ppdata > end_of_smb) { |
2533 | cFYI(1, ("data %p + count %d (%p) ends after end of smb %p start %p", | 2538 | cFYI(1, "data %p + count %d (%p) past smb end %p start %p", |
2534 | *ppdata, data_count, (data_count + *ppdata), | 2539 | *ppdata, data_count, (data_count + *ppdata), |
2535 | end_of_smb, pSMBr)); | 2540 | end_of_smb, pSMBr); |
2536 | return -EINVAL; | 2541 | return -EINVAL; |
2537 | } else if (parm_count + data_count > pSMBr->ByteCount) { | 2542 | } else if (parm_count + data_count > pSMBr->ByteCount) { |
2538 | cFYI(1, ("parm count and data count larger than SMB")); | 2543 | cFYI(1, "parm count and data count larger than SMB"); |
2539 | return -EINVAL; | 2544 | return -EINVAL; |
2540 | } | 2545 | } |
2541 | *pdatalen = data_count; | 2546 | *pdatalen = data_count; |
@@ -2554,7 +2559,7 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, | |||
2554 | struct smb_com_transaction_ioctl_req *pSMB; | 2559 | struct smb_com_transaction_ioctl_req *pSMB; |
2555 | struct smb_com_transaction_ioctl_rsp *pSMBr; | 2560 | struct smb_com_transaction_ioctl_rsp *pSMBr; |
2556 | 2561 | ||
2557 | cFYI(1, ("In Windows reparse style QueryLink for path %s", searchName)); | 2562 | cFYI(1, "In Windows reparse style QueryLink for path %s", searchName); |
2558 | rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, | 2563 | rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, |
2559 | (void **) &pSMBr); | 2564 | (void **) &pSMBr); |
2560 | if (rc) | 2565 | if (rc) |
@@ -2583,7 +2588,7 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, | |||
2583 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 2588 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
2584 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2589 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2585 | if (rc) { | 2590 | if (rc) { |
2586 | cFYI(1, ("Send error in QueryReparseLinkInfo = %d", rc)); | 2591 | cFYI(1, "Send error in QueryReparseLinkInfo = %d", rc); |
2587 | } else { /* decode response */ | 2592 | } else { /* decode response */ |
2588 | __u32 data_offset = le32_to_cpu(pSMBr->DataOffset); | 2593 | __u32 data_offset = le32_to_cpu(pSMBr->DataOffset); |
2589 | __u32 data_count = le32_to_cpu(pSMBr->DataCount); | 2594 | __u32 data_count = le32_to_cpu(pSMBr->DataCount); |
@@ -2607,7 +2612,7 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, | |||
2607 | if ((reparse_buf->LinkNamesBuf + | 2612 | if ((reparse_buf->LinkNamesBuf + |
2608 | reparse_buf->TargetNameOffset + | 2613 | reparse_buf->TargetNameOffset + |
2609 | reparse_buf->TargetNameLen) > end_of_smb) { | 2614 | reparse_buf->TargetNameLen) > end_of_smb) { |
2610 | cFYI(1, ("reparse buf beyond SMB")); | 2615 | cFYI(1, "reparse buf beyond SMB"); |
2611 | rc = -EIO; | 2616 | rc = -EIO; |
2612 | goto qreparse_out; | 2617 | goto qreparse_out; |
2613 | } | 2618 | } |
@@ -2628,12 +2633,12 @@ CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, | |||
2628 | } | 2633 | } |
2629 | } else { | 2634 | } else { |
2630 | rc = -EIO; | 2635 | rc = -EIO; |
2631 | cFYI(1, ("Invalid return data count on " | 2636 | cFYI(1, "Invalid return data count on " |
2632 | "get reparse info ioctl")); | 2637 | "get reparse info ioctl"); |
2633 | } | 2638 | } |
2634 | symlinkinfo[buflen] = 0; /* just in case so the caller | 2639 | symlinkinfo[buflen] = 0; /* just in case so the caller |
2635 | does not go off the end of the buffer */ | 2640 | does not go off the end of the buffer */ |
2636 | cFYI(1, ("readlink result - %s", symlinkinfo)); | 2641 | cFYI(1, "readlink result - %s", symlinkinfo); |
2637 | } | 2642 | } |
2638 | 2643 | ||
2639 | qreparse_out: | 2644 | qreparse_out: |
@@ -2656,7 +2661,7 @@ static void cifs_convert_ace(posix_acl_xattr_entry *ace, | |||
2656 | ace->e_perm = cpu_to_le16(cifs_ace->cifs_e_perm); | 2661 | ace->e_perm = cpu_to_le16(cifs_ace->cifs_e_perm); |
2657 | ace->e_tag = cpu_to_le16(cifs_ace->cifs_e_tag); | 2662 | ace->e_tag = cpu_to_le16(cifs_ace->cifs_e_tag); |
2658 | ace->e_id = cpu_to_le32(le64_to_cpu(cifs_ace->cifs_uid)); | 2663 | ace->e_id = cpu_to_le32(le64_to_cpu(cifs_ace->cifs_uid)); |
2659 | /* cFYI(1,("perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id)); */ | 2664 | /* cFYI(1, "perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id); */ |
2660 | 2665 | ||
2661 | return; | 2666 | return; |
2662 | } | 2667 | } |
@@ -2682,8 +2687,8 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen, | |||
2682 | size += sizeof(struct cifs_posix_ace) * count; | 2687 | size += sizeof(struct cifs_posix_ace) * count; |
2683 | /* check if we would go beyond end of SMB */ | 2688 | /* check if we would go beyond end of SMB */ |
2684 | if (size_of_data_area < size) { | 2689 | if (size_of_data_area < size) { |
2685 | cFYI(1, ("bad CIFS POSIX ACL size %d vs. %d", | 2690 | cFYI(1, "bad CIFS POSIX ACL size %d vs. %d", |
2686 | size_of_data_area, size)); | 2691 | size_of_data_area, size); |
2687 | return -EINVAL; | 2692 | return -EINVAL; |
2688 | } | 2693 | } |
2689 | } else if (acl_type & ACL_TYPE_DEFAULT) { | 2694 | } else if (acl_type & ACL_TYPE_DEFAULT) { |
@@ -2730,7 +2735,7 @@ static __u16 convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace, | |||
2730 | cifs_ace->cifs_uid = cpu_to_le64(-1); | 2735 | cifs_ace->cifs_uid = cpu_to_le64(-1); |
2731 | } else | 2736 | } else |
2732 | cifs_ace->cifs_uid = cpu_to_le64(le32_to_cpu(local_ace->e_id)); | 2737 | cifs_ace->cifs_uid = cpu_to_le64(le32_to_cpu(local_ace->e_id)); |
2733 | /*cFYI(1,("perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id));*/ | 2738 | /*cFYI(1, "perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id);*/ |
2734 | return rc; | 2739 | return rc; |
2735 | } | 2740 | } |
2736 | 2741 | ||
@@ -2748,12 +2753,12 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL, | |||
2748 | return 0; | 2753 | return 0; |
2749 | 2754 | ||
2750 | count = posix_acl_xattr_count((size_t)buflen); | 2755 | count = posix_acl_xattr_count((size_t)buflen); |
2751 | cFYI(1, ("setting acl with %d entries from buf of length %d and " | 2756 | cFYI(1, "setting acl with %d entries from buf of length %d and " |
2752 | "version of %d", | 2757 | "version of %d", |
2753 | count, buflen, le32_to_cpu(local_acl->a_version))); | 2758 | count, buflen, le32_to_cpu(local_acl->a_version)); |
2754 | if (le32_to_cpu(local_acl->a_version) != 2) { | 2759 | if (le32_to_cpu(local_acl->a_version) != 2) { |
2755 | cFYI(1, ("unknown POSIX ACL version %d", | 2760 | cFYI(1, "unknown POSIX ACL version %d", |
2756 | le32_to_cpu(local_acl->a_version))); | 2761 | le32_to_cpu(local_acl->a_version)); |
2757 | return 0; | 2762 | return 0; |
2758 | } | 2763 | } |
2759 | cifs_acl->version = cpu_to_le16(1); | 2764 | cifs_acl->version = cpu_to_le16(1); |
@@ -2762,7 +2767,7 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL, | |||
2762 | else if (acl_type == ACL_TYPE_DEFAULT) | 2767 | else if (acl_type == ACL_TYPE_DEFAULT) |
2763 | cifs_acl->default_entry_count = cpu_to_le16(count); | 2768 | cifs_acl->default_entry_count = cpu_to_le16(count); |
2764 | else { | 2769 | else { |
2765 | cFYI(1, ("unknown ACL type %d", acl_type)); | 2770 | cFYI(1, "unknown ACL type %d", acl_type); |
2766 | return 0; | 2771 | return 0; |
2767 | } | 2772 | } |
2768 | for (i = 0; i < count; i++) { | 2773 | for (i = 0; i < count; i++) { |
@@ -2795,7 +2800,7 @@ CIFSSMBGetPosixACL(const int xid, struct cifsTconInfo *tcon, | |||
2795 | int name_len; | 2800 | int name_len; |
2796 | __u16 params, byte_count; | 2801 | __u16 params, byte_count; |
2797 | 2802 | ||
2798 | cFYI(1, ("In GetPosixACL (Unix) for path %s", searchName)); | 2803 | cFYI(1, "In GetPosixACL (Unix) for path %s", searchName); |
2799 | 2804 | ||
2800 | queryAclRetry: | 2805 | queryAclRetry: |
2801 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 2806 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
@@ -2847,7 +2852,7 @@ queryAclRetry: | |||
2847 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2852 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2848 | cifs_stats_inc(&tcon->num_acl_get); | 2853 | cifs_stats_inc(&tcon->num_acl_get); |
2849 | if (rc) { | 2854 | if (rc) { |
2850 | cFYI(1, ("Send error in Query POSIX ACL = %d", rc)); | 2855 | cFYI(1, "Send error in Query POSIX ACL = %d", rc); |
2851 | } else { | 2856 | } else { |
2852 | /* decode response */ | 2857 | /* decode response */ |
2853 | 2858 | ||
@@ -2884,7 +2889,7 @@ CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon, | |||
2884 | int bytes_returned = 0; | 2889 | int bytes_returned = 0; |
2885 | __u16 params, byte_count, data_count, param_offset, offset; | 2890 | __u16 params, byte_count, data_count, param_offset, offset; |
2886 | 2891 | ||
2887 | cFYI(1, ("In SetPosixACL (Unix) for path %s", fileName)); | 2892 | cFYI(1, "In SetPosixACL (Unix) for path %s", fileName); |
2888 | setAclRetry: | 2893 | setAclRetry: |
2889 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 2894 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
2890 | (void **) &pSMBr); | 2895 | (void **) &pSMBr); |
@@ -2939,7 +2944,7 @@ setAclRetry: | |||
2939 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 2944 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
2940 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2945 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2941 | if (rc) | 2946 | if (rc) |
2942 | cFYI(1, ("Set POSIX ACL returned %d", rc)); | 2947 | cFYI(1, "Set POSIX ACL returned %d", rc); |
2943 | 2948 | ||
2944 | setACLerrorExit: | 2949 | setACLerrorExit: |
2945 | cifs_buf_release(pSMB); | 2950 | cifs_buf_release(pSMB); |
@@ -2959,7 +2964,7 @@ CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon, | |||
2959 | int bytes_returned; | 2964 | int bytes_returned; |
2960 | __u16 params, byte_count; | 2965 | __u16 params, byte_count; |
2961 | 2966 | ||
2962 | cFYI(1, ("In GetExtAttr")); | 2967 | cFYI(1, "In GetExtAttr"); |
2963 | if (tcon == NULL) | 2968 | if (tcon == NULL) |
2964 | return -ENODEV; | 2969 | return -ENODEV; |
2965 | 2970 | ||
@@ -2998,7 +3003,7 @@ GetExtAttrRetry: | |||
2998 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 3003 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
2999 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 3004 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
3000 | if (rc) { | 3005 | if (rc) { |
3001 | cFYI(1, ("error %d in GetExtAttr", rc)); | 3006 | cFYI(1, "error %d in GetExtAttr", rc); |
3002 | } else { | 3007 | } else { |
3003 | /* decode response */ | 3008 | /* decode response */ |
3004 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 3009 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
@@ -3013,7 +3018,7 @@ GetExtAttrRetry: | |||
3013 | struct file_chattr_info *pfinfo; | 3018 | struct file_chattr_info *pfinfo; |
3014 | /* BB Do we need a cast or hash here ? */ | 3019 | /* BB Do we need a cast or hash here ? */ |
3015 | if (count != 16) { | 3020 | if (count != 16) { |
3016 | cFYI(1, ("Illegal size ret in GetExtAttr")); | 3021 | cFYI(1, "Illegal size ret in GetExtAttr"); |
3017 | rc = -EIO; | 3022 | rc = -EIO; |
3018 | goto GetExtAttrOut; | 3023 | goto GetExtAttrOut; |
3019 | } | 3024 | } |
@@ -3043,7 +3048,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | |||
3043 | QUERY_SEC_DESC_REQ *pSMB; | 3048 | QUERY_SEC_DESC_REQ *pSMB; |
3044 | struct kvec iov[1]; | 3049 | struct kvec iov[1]; |
3045 | 3050 | ||
3046 | cFYI(1, ("GetCifsACL")); | 3051 | cFYI(1, "GetCifsACL"); |
3047 | 3052 | ||
3048 | *pbuflen = 0; | 3053 | *pbuflen = 0; |
3049 | *acl_inf = NULL; | 3054 | *acl_inf = NULL; |
@@ -3068,7 +3073,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | |||
3068 | CIFS_STD_OP); | 3073 | CIFS_STD_OP); |
3069 | cifs_stats_inc(&tcon->num_acl_get); | 3074 | cifs_stats_inc(&tcon->num_acl_get); |
3070 | if (rc) { | 3075 | if (rc) { |
3071 | cFYI(1, ("Send error in QuerySecDesc = %d", rc)); | 3076 | cFYI(1, "Send error in QuerySecDesc = %d", rc); |
3072 | } else { /* decode response */ | 3077 | } else { /* decode response */ |
3073 | __le32 *parm; | 3078 | __le32 *parm; |
3074 | __u32 parm_len; | 3079 | __u32 parm_len; |
@@ -3083,7 +3088,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | |||
3083 | goto qsec_out; | 3088 | goto qsec_out; |
3084 | pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base; | 3089 | pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base; |
3085 | 3090 | ||
3086 | cFYI(1, ("smb %p parm %p data %p", pSMBr, parm, *acl_inf)); | 3091 | cFYI(1, "smb %p parm %p data %p", pSMBr, parm, *acl_inf); |
3087 | 3092 | ||
3088 | if (le32_to_cpu(pSMBr->ParameterCount) != 4) { | 3093 | if (le32_to_cpu(pSMBr->ParameterCount) != 4) { |
3089 | rc = -EIO; /* bad smb */ | 3094 | rc = -EIO; /* bad smb */ |
@@ -3095,8 +3100,8 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | |||
3095 | 3100 | ||
3096 | acl_len = le32_to_cpu(*parm); | 3101 | acl_len = le32_to_cpu(*parm); |
3097 | if (acl_len != *pbuflen) { | 3102 | if (acl_len != *pbuflen) { |
3098 | cERROR(1, ("acl length %d does not match %d", | 3103 | cERROR(1, "acl length %d does not match %d", |
3099 | acl_len, *pbuflen)); | 3104 | acl_len, *pbuflen); |
3100 | if (*pbuflen > acl_len) | 3105 | if (*pbuflen > acl_len) |
3101 | *pbuflen = acl_len; | 3106 | *pbuflen = acl_len; |
3102 | } | 3107 | } |
@@ -3105,7 +3110,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | |||
3105 | header followed by the smallest SID */ | 3110 | header followed by the smallest SID */ |
3106 | if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) || | 3111 | if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) || |
3107 | (*pbuflen >= 64 * 1024)) { | 3112 | (*pbuflen >= 64 * 1024)) { |
3108 | cERROR(1, ("bad acl length %d", *pbuflen)); | 3113 | cERROR(1, "bad acl length %d", *pbuflen); |
3109 | rc = -EINVAL; | 3114 | rc = -EINVAL; |
3110 | *pbuflen = 0; | 3115 | *pbuflen = 0; |
3111 | } else { | 3116 | } else { |
@@ -3179,9 +3184,9 @@ setCifsAclRetry: | |||
3179 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 3184 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
3180 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 3185 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
3181 | 3186 | ||
3182 | cFYI(1, ("SetCIFSACL bytes_returned: %d, rc: %d", bytes_returned, rc)); | 3187 | cFYI(1, "SetCIFSACL bytes_returned: %d, rc: %d", bytes_returned, rc); |
3183 | if (rc) | 3188 | if (rc) |
3184 | cFYI(1, ("Set CIFS ACL returned %d", rc)); | 3189 | cFYI(1, "Set CIFS ACL returned %d", rc); |
3185 | cifs_buf_release(pSMB); | 3190 | cifs_buf_release(pSMB); |
3186 | 3191 | ||
3187 | if (rc == -EAGAIN) | 3192 | if (rc == -EAGAIN) |
@@ -3205,7 +3210,7 @@ int SMBQueryInformation(const int xid, struct cifsTconInfo *tcon, | |||
3205 | int bytes_returned; | 3210 | int bytes_returned; |
3206 | int name_len; | 3211 | int name_len; |
3207 | 3212 | ||
3208 | cFYI(1, ("In SMBQPath path %s", searchName)); | 3213 | cFYI(1, "In SMBQPath path %s", searchName); |
3209 | QInfRetry: | 3214 | QInfRetry: |
3210 | rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB, | 3215 | rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB, |
3211 | (void **) &pSMBr); | 3216 | (void **) &pSMBr); |
@@ -3231,7 +3236,7 @@ QInfRetry: | |||
3231 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 3236 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
3232 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 3237 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
3233 | if (rc) { | 3238 | if (rc) { |
3234 | cFYI(1, ("Send error in QueryInfo = %d", rc)); | 3239 | cFYI(1, "Send error in QueryInfo = %d", rc); |
3235 | } else if (pFinfo) { | 3240 | } else if (pFinfo) { |
3236 | struct timespec ts; | 3241 | struct timespec ts; |
3237 | __u32 time = le32_to_cpu(pSMBr->last_write_time); | 3242 | __u32 time = le32_to_cpu(pSMBr->last_write_time); |
@@ -3305,7 +3310,7 @@ QFileInfoRetry: | |||
3305 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 3310 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
3306 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 3311 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
3307 | if (rc) { | 3312 | if (rc) { |
3308 | cFYI(1, ("Send error in QPathInfo = %d", rc)); | 3313 | cFYI(1, "Send error in QPathInfo = %d", rc); |
3309 | } else { /* decode response */ | 3314 | } else { /* decode response */ |
3310 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 3315 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
3311 | 3316 | ||
@@ -3343,7 +3348,7 @@ CIFSSMBQPathInfo(const int xid, struct cifsTconInfo *tcon, | |||
3343 | int name_len; | 3348 | int name_len; |
3344 | __u16 params, byte_count; | 3349 | __u16 params, byte_count; |
3345 | 3350 | ||
3346 | /* cFYI(1, ("In QPathInfo path %s", searchName)); */ | 3351 | /* cFYI(1, "In QPathInfo path %s", searchName); */ |
3347 | QPathInfoRetry: | 3352 | QPathInfoRetry: |
3348 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 3353 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
3349 | (void **) &pSMBr); | 3354 | (void **) &pSMBr); |
@@ -3393,7 +3398,7 @@ QPathInfoRetry: | |||
3393 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 3398 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
3394 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 3399 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
3395 | if (rc) { | 3400 | if (rc) { |
3396 | cFYI(1, ("Send error in QPathInfo = %d", rc)); | 3401 | cFYI(1, "Send error in QPathInfo = %d", rc); |
3397 | } else { /* decode response */ | 3402 | } else { /* decode response */ |
3398 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 3403 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
3399 | 3404 | ||
@@ -3473,14 +3478,14 @@ UnixQFileInfoRetry: | |||
3473 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 3478 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
3474 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 3479 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
3475 | if (rc) { | 3480 | if (rc) { |
3476 | cFYI(1, ("Send error in QPathInfo = %d", rc)); | 3481 | cFYI(1, "Send error in QPathInfo = %d", rc); |
3477 | } else { /* decode response */ | 3482 | } else { /* decode response */ |
3478 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 3483 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
3479 | 3484 | ||
3480 | if (rc || (pSMBr->ByteCount < sizeof(FILE_UNIX_BASIC_INFO))) { | 3485 | if (rc || (pSMBr->ByteCount < sizeof(FILE_UNIX_BASIC_INFO))) { |
3481 | cERROR(1, ("Malformed FILE_UNIX_BASIC_INFO response.\n" | 3486 | cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response.\n" |
3482 | "Unix Extensions can be disabled on mount " | 3487 | "Unix Extensions can be disabled on mount " |
3483 | "by specifying the nosfu mount option.")); | 3488 | "by specifying the nosfu mount option."); |
3484 | rc = -EIO; /* bad smb */ | 3489 | rc = -EIO; /* bad smb */ |
3485 | } else { | 3490 | } else { |
3486 | __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); | 3491 | __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); |
@@ -3512,7 +3517,7 @@ CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon, | |||
3512 | int name_len; | 3517 | int name_len; |
3513 | __u16 params, byte_count; | 3518 | __u16 params, byte_count; |
3514 | 3519 | ||
3515 | cFYI(1, ("In QPathInfo (Unix) the path %s", searchName)); | 3520 | cFYI(1, "In QPathInfo (Unix) the path %s", searchName); |
3516 | UnixQPathInfoRetry: | 3521 | UnixQPathInfoRetry: |
3517 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 3522 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
3518 | (void **) &pSMBr); | 3523 | (void **) &pSMBr); |
@@ -3559,14 +3564,14 @@ UnixQPathInfoRetry: | |||
3559 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 3564 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
3560 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 3565 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
3561 | if (rc) { | 3566 | if (rc) { |
3562 | cFYI(1, ("Send error in QPathInfo = %d", rc)); | 3567 | cFYI(1, "Send error in QPathInfo = %d", rc); |
3563 | } else { /* decode response */ | 3568 | } else { /* decode response */ |
3564 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 3569 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
3565 | 3570 | ||
3566 | if (rc || (pSMBr->ByteCount < sizeof(FILE_UNIX_BASIC_INFO))) { | 3571 | if (rc || (pSMBr->ByteCount < sizeof(FILE_UNIX_BASIC_INFO))) { |
3567 | cERROR(1, ("Malformed FILE_UNIX_BASIC_INFO response.\n" | 3572 | cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response.\n" |
3568 | "Unix Extensions can be disabled on mount " | 3573 | "Unix Extensions can be disabled on mount " |
3569 | "by specifying the nosfu mount option.")); | 3574 | "by specifying the nosfu mount option."); |
3570 | rc = -EIO; /* bad smb */ | 3575 | rc = -EIO; /* bad smb */ |
3571 | } else { | 3576 | } else { |
3572 | __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); | 3577 | __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); |
@@ -3600,7 +3605,7 @@ CIFSFindFirst(const int xid, struct cifsTconInfo *tcon, | |||
3600 | int name_len; | 3605 | int name_len; |
3601 | __u16 params, byte_count; | 3606 | __u16 params, byte_count; |
3602 | 3607 | ||
3603 | cFYI(1, ("In FindFirst for %s", searchName)); | 3608 | cFYI(1, "In FindFirst for %s", searchName); |
3604 | 3609 | ||
3605 | findFirstRetry: | 3610 | findFirstRetry: |
3606 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 3611 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
@@ -3677,7 +3682,7 @@ findFirstRetry: | |||
3677 | if (rc) {/* BB add logic to retry regular search if Unix search | 3682 | if (rc) {/* BB add logic to retry regular search if Unix search |
3678 | rejected unexpectedly by server */ | 3683 | rejected unexpectedly by server */ |
3679 | /* BB Add code to handle unsupported level rc */ | 3684 | /* BB Add code to handle unsupported level rc */ |
3680 | cFYI(1, ("Error in FindFirst = %d", rc)); | 3685 | cFYI(1, "Error in FindFirst = %d", rc); |
3681 | 3686 | ||
3682 | cifs_buf_release(pSMB); | 3687 | cifs_buf_release(pSMB); |
3683 | 3688 | ||
@@ -3716,7 +3721,7 @@ findFirstRetry: | |||
3716 | lnoff = le16_to_cpu(parms->LastNameOffset); | 3721 | lnoff = le16_to_cpu(parms->LastNameOffset); |
3717 | if (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE < | 3722 | if (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE < |
3718 | lnoff) { | 3723 | lnoff) { |
3719 | cERROR(1, ("ignoring corrupt resume name")); | 3724 | cERROR(1, "ignoring corrupt resume name"); |
3720 | psrch_inf->last_entry = NULL; | 3725 | psrch_inf->last_entry = NULL; |
3721 | return rc; | 3726 | return rc; |
3722 | } | 3727 | } |
@@ -3744,7 +3749,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
3744 | int bytes_returned, name_len; | 3749 | int bytes_returned, name_len; |
3745 | __u16 params, byte_count; | 3750 | __u16 params, byte_count; |
3746 | 3751 | ||
3747 | cFYI(1, ("In FindNext")); | 3752 | cFYI(1, "In FindNext"); |
3748 | 3753 | ||
3749 | if (psrch_inf->endOfSearch) | 3754 | if (psrch_inf->endOfSearch) |
3750 | return -ENOENT; | 3755 | return -ENOENT; |
@@ -3808,7 +3813,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
3808 | cifs_buf_release(pSMB); | 3813 | cifs_buf_release(pSMB); |
3809 | rc = 0; /* search probably was closed at end of search*/ | 3814 | rc = 0; /* search probably was closed at end of search*/ |
3810 | } else | 3815 | } else |
3811 | cFYI(1, ("FindNext returned = %d", rc)); | 3816 | cFYI(1, "FindNext returned = %d", rc); |
3812 | } else { /* decode response */ | 3817 | } else { /* decode response */ |
3813 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 3818 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
3814 | 3819 | ||
@@ -3844,15 +3849,15 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
3844 | lnoff = le16_to_cpu(parms->LastNameOffset); | 3849 | lnoff = le16_to_cpu(parms->LastNameOffset); |
3845 | if (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE < | 3850 | if (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE < |
3846 | lnoff) { | 3851 | lnoff) { |
3847 | cERROR(1, ("ignoring corrupt resume name")); | 3852 | cERROR(1, "ignoring corrupt resume name"); |
3848 | psrch_inf->last_entry = NULL; | 3853 | psrch_inf->last_entry = NULL; |
3849 | return rc; | 3854 | return rc; |
3850 | } else | 3855 | } else |
3851 | psrch_inf->last_entry = | 3856 | psrch_inf->last_entry = |
3852 | psrch_inf->srch_entries_start + lnoff; | 3857 | psrch_inf->srch_entries_start + lnoff; |
3853 | 3858 | ||
3854 | /* cFYI(1,("fnxt2 entries in buf %d index_of_last %d", | 3859 | /* cFYI(1, "fnxt2 entries in buf %d index_of_last %d", |
3855 | psrch_inf->entries_in_buffer, psrch_inf->index_of_last_entry)); */ | 3860 | psrch_inf->entries_in_buffer, psrch_inf->index_of_last_entry); */ |
3856 | 3861 | ||
3857 | /* BB fixme add unlock here */ | 3862 | /* BB fixme add unlock here */ |
3858 | } | 3863 | } |
@@ -3877,7 +3882,7 @@ CIFSFindClose(const int xid, struct cifsTconInfo *tcon, | |||
3877 | int rc = 0; | 3882 | int rc = 0; |
3878 | FINDCLOSE_REQ *pSMB = NULL; | 3883 | FINDCLOSE_REQ *pSMB = NULL; |
3879 | 3884 | ||
3880 | cFYI(1, ("In CIFSSMBFindClose")); | 3885 | cFYI(1, "In CIFSSMBFindClose"); |
3881 | rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB); | 3886 | rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB); |
3882 | 3887 | ||
3883 | /* no sense returning error if session restarted | 3888 | /* no sense returning error if session restarted |
@@ -3891,7 +3896,7 @@ CIFSFindClose(const int xid, struct cifsTconInfo *tcon, | |||
3891 | pSMB->ByteCount = 0; | 3896 | pSMB->ByteCount = 0; |
3892 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 3897 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); |
3893 | if (rc) | 3898 | if (rc) |
3894 | cERROR(1, ("Send error in FindClose = %d", rc)); | 3899 | cERROR(1, "Send error in FindClose = %d", rc); |
3895 | 3900 | ||
3896 | cifs_stats_inc(&tcon->num_fclose); | 3901 | cifs_stats_inc(&tcon->num_fclose); |
3897 | 3902 | ||
@@ -3914,7 +3919,7 @@ CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon, | |||
3914 | int name_len, bytes_returned; | 3919 | int name_len, bytes_returned; |
3915 | __u16 params, byte_count; | 3920 | __u16 params, byte_count; |
3916 | 3921 | ||
3917 | cFYI(1, ("In GetSrvInodeNum for %s", searchName)); | 3922 | cFYI(1, "In GetSrvInodeNum for %s", searchName); |
3918 | if (tcon == NULL) | 3923 | if (tcon == NULL) |
3919 | return -ENODEV; | 3924 | return -ENODEV; |
3920 | 3925 | ||
@@ -3964,7 +3969,7 @@ GetInodeNumberRetry: | |||
3964 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 3969 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
3965 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 3970 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
3966 | if (rc) { | 3971 | if (rc) { |
3967 | cFYI(1, ("error %d in QueryInternalInfo", rc)); | 3972 | cFYI(1, "error %d in QueryInternalInfo", rc); |
3968 | } else { | 3973 | } else { |
3969 | /* decode response */ | 3974 | /* decode response */ |
3970 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 3975 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
@@ -3979,7 +3984,7 @@ GetInodeNumberRetry: | |||
3979 | struct file_internal_info *pfinfo; | 3984 | struct file_internal_info *pfinfo; |
3980 | /* BB Do we need a cast or hash here ? */ | 3985 | /* BB Do we need a cast or hash here ? */ |
3981 | if (count < 8) { | 3986 | if (count < 8) { |
3982 | cFYI(1, ("Illegal size ret in QryIntrnlInf")); | 3987 | cFYI(1, "Illegal size ret in QryIntrnlInf"); |
3983 | rc = -EIO; | 3988 | rc = -EIO; |
3984 | goto GetInodeNumOut; | 3989 | goto GetInodeNumOut; |
3985 | } | 3990 | } |
@@ -4020,16 +4025,16 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr, | |||
4020 | *num_of_nodes = le16_to_cpu(pSMBr->NumberOfReferrals); | 4025 | *num_of_nodes = le16_to_cpu(pSMBr->NumberOfReferrals); |
4021 | 4026 | ||
4022 | if (*num_of_nodes < 1) { | 4027 | if (*num_of_nodes < 1) { |
4023 | cERROR(1, ("num_referrals: must be at least > 0," | 4028 | cERROR(1, "num_referrals: must be at least > 0," |
4024 | "but we get num_referrals = %d\n", *num_of_nodes)); | 4029 | "but we get num_referrals = %d\n", *num_of_nodes); |
4025 | rc = -EINVAL; | 4030 | rc = -EINVAL; |
4026 | goto parse_DFS_referrals_exit; | 4031 | goto parse_DFS_referrals_exit; |
4027 | } | 4032 | } |
4028 | 4033 | ||
4029 | ref = (struct dfs_referral_level_3 *) &(pSMBr->referrals); | 4034 | ref = (struct dfs_referral_level_3 *) &(pSMBr->referrals); |
4030 | if (ref->VersionNumber != cpu_to_le16(3)) { | 4035 | if (ref->VersionNumber != cpu_to_le16(3)) { |
4031 | cERROR(1, ("Referrals of V%d version are not supported," | 4036 | cERROR(1, "Referrals of V%d version are not supported," |
4032 | "should be V3", le16_to_cpu(ref->VersionNumber))); | 4037 | "should be V3", le16_to_cpu(ref->VersionNumber)); |
4033 | rc = -EINVAL; | 4038 | rc = -EINVAL; |
4034 | goto parse_DFS_referrals_exit; | 4039 | goto parse_DFS_referrals_exit; |
4035 | } | 4040 | } |
@@ -4038,14 +4043,14 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr, | |||
4038 | data_end = (char *)(&(pSMBr->PathConsumed)) + | 4043 | data_end = (char *)(&(pSMBr->PathConsumed)) + |
4039 | le16_to_cpu(pSMBr->t2.DataCount); | 4044 | le16_to_cpu(pSMBr->t2.DataCount); |
4040 | 4045 | ||
4041 | cFYI(1, ("num_referrals: %d dfs flags: 0x%x ... \n", | 4046 | cFYI(1, "num_referrals: %d dfs flags: 0x%x ...\n", |
4042 | *num_of_nodes, | 4047 | *num_of_nodes, |
4043 | le32_to_cpu(pSMBr->DFSFlags))); | 4048 | le32_to_cpu(pSMBr->DFSFlags)); |
4044 | 4049 | ||
4045 | *target_nodes = kzalloc(sizeof(struct dfs_info3_param) * | 4050 | *target_nodes = kzalloc(sizeof(struct dfs_info3_param) * |
4046 | *num_of_nodes, GFP_KERNEL); | 4051 | *num_of_nodes, GFP_KERNEL); |
4047 | if (*target_nodes == NULL) { | 4052 | if (*target_nodes == NULL) { |
4048 | cERROR(1, ("Failed to allocate buffer for target_nodes\n")); | 4053 | cERROR(1, "Failed to allocate buffer for target_nodes\n"); |
4049 | rc = -ENOMEM; | 4054 | rc = -ENOMEM; |
4050 | goto parse_DFS_referrals_exit; | 4055 | goto parse_DFS_referrals_exit; |
4051 | } | 4056 | } |
@@ -4121,7 +4126,7 @@ CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses, | |||
4121 | *num_of_nodes = 0; | 4126 | *num_of_nodes = 0; |
4122 | *target_nodes = NULL; | 4127 | *target_nodes = NULL; |
4123 | 4128 | ||
4124 | cFYI(1, ("In GetDFSRefer the path %s", searchName)); | 4129 | cFYI(1, "In GetDFSRefer the path %s", searchName); |
4125 | if (ses == NULL) | 4130 | if (ses == NULL) |
4126 | return -ENODEV; | 4131 | return -ENODEV; |
4127 | getDFSRetry: | 4132 | getDFSRetry: |
@@ -4188,7 +4193,7 @@ getDFSRetry: | |||
4188 | rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB, | 4193 | rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB, |
4189 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4194 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4190 | if (rc) { | 4195 | if (rc) { |
4191 | cFYI(1, ("Send error in GetDFSRefer = %d", rc)); | 4196 | cFYI(1, "Send error in GetDFSRefer = %d", rc); |
4192 | goto GetDFSRefExit; | 4197 | goto GetDFSRefExit; |
4193 | } | 4198 | } |
4194 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4199 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
@@ -4199,9 +4204,9 @@ getDFSRetry: | |||
4199 | goto GetDFSRefExit; | 4204 | goto GetDFSRefExit; |
4200 | } | 4205 | } |
4201 | 4206 | ||
4202 | cFYI(1, ("Decoding GetDFSRefer response BCC: %d Offset %d", | 4207 | cFYI(1, "Decoding GetDFSRefer response BCC: %d Offset %d", |
4203 | pSMBr->ByteCount, | 4208 | pSMBr->ByteCount, |
4204 | le16_to_cpu(pSMBr->t2.DataOffset))); | 4209 | le16_to_cpu(pSMBr->t2.DataOffset)); |
4205 | 4210 | ||
4206 | /* parse returned result into more usable form */ | 4211 | /* parse returned result into more usable form */ |
4207 | rc = parse_DFS_referrals(pSMBr, num_of_nodes, | 4212 | rc = parse_DFS_referrals(pSMBr, num_of_nodes, |
@@ -4229,7 +4234,7 @@ SMBOldQFSInfo(const int xid, struct cifsTconInfo *tcon, struct kstatfs *FSData) | |||
4229 | int bytes_returned = 0; | 4234 | int bytes_returned = 0; |
4230 | __u16 params, byte_count; | 4235 | __u16 params, byte_count; |
4231 | 4236 | ||
4232 | cFYI(1, ("OldQFSInfo")); | 4237 | cFYI(1, "OldQFSInfo"); |
4233 | oldQFSInfoRetry: | 4238 | oldQFSInfoRetry: |
4234 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4239 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
4235 | (void **) &pSMBr); | 4240 | (void **) &pSMBr); |
@@ -4262,7 +4267,7 @@ oldQFSInfoRetry: | |||
4262 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 4267 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
4263 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4268 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4264 | if (rc) { | 4269 | if (rc) { |
4265 | cFYI(1, ("Send error in QFSInfo = %d", rc)); | 4270 | cFYI(1, "Send error in QFSInfo = %d", rc); |
4266 | } else { /* decode response */ | 4271 | } else { /* decode response */ |
4267 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4272 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
4268 | 4273 | ||
@@ -4270,8 +4275,8 @@ oldQFSInfoRetry: | |||
4270 | rc = -EIO; /* bad smb */ | 4275 | rc = -EIO; /* bad smb */ |
4271 | else { | 4276 | else { |
4272 | __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); | 4277 | __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); |
4273 | cFYI(1, ("qfsinf resp BCC: %d Offset %d", | 4278 | cFYI(1, "qfsinf resp BCC: %d Offset %d", |
4274 | pSMBr->ByteCount, data_offset)); | 4279 | pSMBr->ByteCount, data_offset); |
4275 | 4280 | ||
4276 | response_data = (FILE_SYSTEM_ALLOC_INFO *) | 4281 | response_data = (FILE_SYSTEM_ALLOC_INFO *) |
4277 | (((char *) &pSMBr->hdr.Protocol) + data_offset); | 4282 | (((char *) &pSMBr->hdr.Protocol) + data_offset); |
@@ -4283,11 +4288,10 @@ oldQFSInfoRetry: | |||
4283 | le32_to_cpu(response_data->TotalAllocationUnits); | 4288 | le32_to_cpu(response_data->TotalAllocationUnits); |
4284 | FSData->f_bfree = FSData->f_bavail = | 4289 | FSData->f_bfree = FSData->f_bavail = |
4285 | le32_to_cpu(response_data->FreeAllocationUnits); | 4290 | le32_to_cpu(response_data->FreeAllocationUnits); |
4286 | cFYI(1, | 4291 | cFYI(1, "Blocks: %lld Free: %lld Block size %ld", |
4287 | ("Blocks: %lld Free: %lld Block size %ld", | 4292 | (unsigned long long)FSData->f_blocks, |
4288 | (unsigned long long)FSData->f_blocks, | 4293 | (unsigned long long)FSData->f_bfree, |
4289 | (unsigned long long)FSData->f_bfree, | 4294 | FSData->f_bsize); |
4290 | FSData->f_bsize)); | ||
4291 | } | 4295 | } |
4292 | } | 4296 | } |
4293 | cifs_buf_release(pSMB); | 4297 | cifs_buf_release(pSMB); |
@@ -4309,7 +4313,7 @@ CIFSSMBQFSInfo(const int xid, struct cifsTconInfo *tcon, struct kstatfs *FSData) | |||
4309 | int bytes_returned = 0; | 4313 | int bytes_returned = 0; |
4310 | __u16 params, byte_count; | 4314 | __u16 params, byte_count; |
4311 | 4315 | ||
4312 | cFYI(1, ("In QFSInfo")); | 4316 | cFYI(1, "In QFSInfo"); |
4313 | QFSInfoRetry: | 4317 | QFSInfoRetry: |
4314 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4318 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
4315 | (void **) &pSMBr); | 4319 | (void **) &pSMBr); |
@@ -4342,7 +4346,7 @@ QFSInfoRetry: | |||
4342 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 4346 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
4343 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4347 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4344 | if (rc) { | 4348 | if (rc) { |
4345 | cFYI(1, ("Send error in QFSInfo = %d", rc)); | 4349 | cFYI(1, "Send error in QFSInfo = %d", rc); |
4346 | } else { /* decode response */ | 4350 | } else { /* decode response */ |
4347 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4351 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
4348 | 4352 | ||
@@ -4363,11 +4367,10 @@ QFSInfoRetry: | |||
4363 | le64_to_cpu(response_data->TotalAllocationUnits); | 4367 | le64_to_cpu(response_data->TotalAllocationUnits); |
4364 | FSData->f_bfree = FSData->f_bavail = | 4368 | FSData->f_bfree = FSData->f_bavail = |
4365 | le64_to_cpu(response_data->FreeAllocationUnits); | 4369 | le64_to_cpu(response_data->FreeAllocationUnits); |
4366 | cFYI(1, | 4370 | cFYI(1, "Blocks: %lld Free: %lld Block size %ld", |
4367 | ("Blocks: %lld Free: %lld Block size %ld", | 4371 | (unsigned long long)FSData->f_blocks, |
4368 | (unsigned long long)FSData->f_blocks, | 4372 | (unsigned long long)FSData->f_bfree, |
4369 | (unsigned long long)FSData->f_bfree, | 4373 | FSData->f_bsize); |
4370 | FSData->f_bsize)); | ||
4371 | } | 4374 | } |
4372 | } | 4375 | } |
4373 | cifs_buf_release(pSMB); | 4376 | cifs_buf_release(pSMB); |
@@ -4389,7 +4392,7 @@ CIFSSMBQFSAttributeInfo(const int xid, struct cifsTconInfo *tcon) | |||
4389 | int bytes_returned = 0; | 4392 | int bytes_returned = 0; |
4390 | __u16 params, byte_count; | 4393 | __u16 params, byte_count; |
4391 | 4394 | ||
4392 | cFYI(1, ("In QFSAttributeInfo")); | 4395 | cFYI(1, "In QFSAttributeInfo"); |
4393 | QFSAttributeRetry: | 4396 | QFSAttributeRetry: |
4394 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4397 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
4395 | (void **) &pSMBr); | 4398 | (void **) &pSMBr); |
@@ -4423,7 +4426,7 @@ QFSAttributeRetry: | |||
4423 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 4426 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
4424 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4427 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4425 | if (rc) { | 4428 | if (rc) { |
4426 | cERROR(1, ("Send error in QFSAttributeInfo = %d", rc)); | 4429 | cERROR(1, "Send error in QFSAttributeInfo = %d", rc); |
4427 | } else { /* decode response */ | 4430 | } else { /* decode response */ |
4428 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4431 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
4429 | 4432 | ||
@@ -4459,7 +4462,7 @@ CIFSSMBQFSDeviceInfo(const int xid, struct cifsTconInfo *tcon) | |||
4459 | int bytes_returned = 0; | 4462 | int bytes_returned = 0; |
4460 | __u16 params, byte_count; | 4463 | __u16 params, byte_count; |
4461 | 4464 | ||
4462 | cFYI(1, ("In QFSDeviceInfo")); | 4465 | cFYI(1, "In QFSDeviceInfo"); |
4463 | QFSDeviceRetry: | 4466 | QFSDeviceRetry: |
4464 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4467 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
4465 | (void **) &pSMBr); | 4468 | (void **) &pSMBr); |
@@ -4494,7 +4497,7 @@ QFSDeviceRetry: | |||
4494 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 4497 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
4495 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4498 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4496 | if (rc) { | 4499 | if (rc) { |
4497 | cFYI(1, ("Send error in QFSDeviceInfo = %d", rc)); | 4500 | cFYI(1, "Send error in QFSDeviceInfo = %d", rc); |
4498 | } else { /* decode response */ | 4501 | } else { /* decode response */ |
4499 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4502 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
4500 | 4503 | ||
@@ -4529,7 +4532,7 @@ CIFSSMBQFSUnixInfo(const int xid, struct cifsTconInfo *tcon) | |||
4529 | int bytes_returned = 0; | 4532 | int bytes_returned = 0; |
4530 | __u16 params, byte_count; | 4533 | __u16 params, byte_count; |
4531 | 4534 | ||
4532 | cFYI(1, ("In QFSUnixInfo")); | 4535 | cFYI(1, "In QFSUnixInfo"); |
4533 | QFSUnixRetry: | 4536 | QFSUnixRetry: |
4534 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4537 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
4535 | (void **) &pSMBr); | 4538 | (void **) &pSMBr); |
@@ -4563,7 +4566,7 @@ QFSUnixRetry: | |||
4563 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 4566 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
4564 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4567 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4565 | if (rc) { | 4568 | if (rc) { |
4566 | cERROR(1, ("Send error in QFSUnixInfo = %d", rc)); | 4569 | cERROR(1, "Send error in QFSUnixInfo = %d", rc); |
4567 | } else { /* decode response */ | 4570 | } else { /* decode response */ |
4568 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4571 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
4569 | 4572 | ||
@@ -4598,7 +4601,7 @@ CIFSSMBSetFSUnixInfo(const int xid, struct cifsTconInfo *tcon, __u64 cap) | |||
4598 | int bytes_returned = 0; | 4601 | int bytes_returned = 0; |
4599 | __u16 params, param_offset, offset, byte_count; | 4602 | __u16 params, param_offset, offset, byte_count; |
4600 | 4603 | ||
4601 | cFYI(1, ("In SETFSUnixInfo")); | 4604 | cFYI(1, "In SETFSUnixInfo"); |
4602 | SETFSUnixRetry: | 4605 | SETFSUnixRetry: |
4603 | /* BB switch to small buf init to save memory */ | 4606 | /* BB switch to small buf init to save memory */ |
4604 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4607 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
@@ -4646,7 +4649,7 @@ SETFSUnixRetry: | |||
4646 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 4649 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
4647 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4650 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4648 | if (rc) { | 4651 | if (rc) { |
4649 | cERROR(1, ("Send error in SETFSUnixInfo = %d", rc)); | 4652 | cERROR(1, "Send error in SETFSUnixInfo = %d", rc); |
4650 | } else { /* decode response */ | 4653 | } else { /* decode response */ |
4651 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4654 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
4652 | if (rc) | 4655 | if (rc) |
@@ -4674,7 +4677,7 @@ CIFSSMBQFSPosixInfo(const int xid, struct cifsTconInfo *tcon, | |||
4674 | int bytes_returned = 0; | 4677 | int bytes_returned = 0; |
4675 | __u16 params, byte_count; | 4678 | __u16 params, byte_count; |
4676 | 4679 | ||
4677 | cFYI(1, ("In QFSPosixInfo")); | 4680 | cFYI(1, "In QFSPosixInfo"); |
4678 | QFSPosixRetry: | 4681 | QFSPosixRetry: |
4679 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4682 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
4680 | (void **) &pSMBr); | 4683 | (void **) &pSMBr); |
@@ -4708,7 +4711,7 @@ QFSPosixRetry: | |||
4708 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 4711 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
4709 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4712 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4710 | if (rc) { | 4713 | if (rc) { |
4711 | cFYI(1, ("Send error in QFSUnixInfo = %d", rc)); | 4714 | cFYI(1, "Send error in QFSUnixInfo = %d", rc); |
4712 | } else { /* decode response */ | 4715 | } else { /* decode response */ |
4713 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4716 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
4714 | 4717 | ||
@@ -4768,7 +4771,7 @@ CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, const char *fileName, | |||
4768 | int bytes_returned = 0; | 4771 | int bytes_returned = 0; |
4769 | __u16 params, byte_count, data_count, param_offset, offset; | 4772 | __u16 params, byte_count, data_count, param_offset, offset; |
4770 | 4773 | ||
4771 | cFYI(1, ("In SetEOF")); | 4774 | cFYI(1, "In SetEOF"); |
4772 | SetEOFRetry: | 4775 | SetEOFRetry: |
4773 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 4776 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
4774 | (void **) &pSMBr); | 4777 | (void **) &pSMBr); |
@@ -4834,7 +4837,7 @@ SetEOFRetry: | |||
4834 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 4837 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
4835 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 4838 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
4836 | if (rc) | 4839 | if (rc) |
4837 | cFYI(1, ("SetPathInfo (file size) returned %d", rc)); | 4840 | cFYI(1, "SetPathInfo (file size) returned %d", rc); |
4838 | 4841 | ||
4839 | cifs_buf_release(pSMB); | 4842 | cifs_buf_release(pSMB); |
4840 | 4843 | ||
@@ -4854,8 +4857,8 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size, | |||
4854 | int rc = 0; | 4857 | int rc = 0; |
4855 | __u16 params, param_offset, offset, byte_count, count; | 4858 | __u16 params, param_offset, offset, byte_count, count; |
4856 | 4859 | ||
4857 | cFYI(1, ("SetFileSize (via SetFileInfo) %lld", | 4860 | cFYI(1, "SetFileSize (via SetFileInfo) %lld", |
4858 | (long long)size)); | 4861 | (long long)size); |
4859 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); | 4862 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); |
4860 | 4863 | ||
4861 | if (rc) | 4864 | if (rc) |
@@ -4914,9 +4917,7 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size, | |||
4914 | pSMB->ByteCount = cpu_to_le16(byte_count); | 4917 | pSMB->ByteCount = cpu_to_le16(byte_count); |
4915 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 4918 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); |
4916 | if (rc) { | 4919 | if (rc) { |
4917 | cFYI(1, | 4920 | cFYI(1, "Send error in SetFileInfo (SetFileSize) = %d", rc); |
4918 | ("Send error in SetFileInfo (SetFileSize) = %d", | ||
4919 | rc)); | ||
4920 | } | 4921 | } |
4921 | 4922 | ||
4922 | /* Note: On -EAGAIN error only caller can retry on handle based calls | 4923 | /* Note: On -EAGAIN error only caller can retry on handle based calls |
@@ -4940,7 +4941,7 @@ CIFSSMBSetFileInfo(const int xid, struct cifsTconInfo *tcon, | |||
4940 | int rc = 0; | 4941 | int rc = 0; |
4941 | __u16 params, param_offset, offset, byte_count, count; | 4942 | __u16 params, param_offset, offset, byte_count, count; |
4942 | 4943 | ||
4943 | cFYI(1, ("Set Times (via SetFileInfo)")); | 4944 | cFYI(1, "Set Times (via SetFileInfo)"); |
4944 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); | 4945 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); |
4945 | 4946 | ||
4946 | if (rc) | 4947 | if (rc) |
@@ -4985,7 +4986,7 @@ CIFSSMBSetFileInfo(const int xid, struct cifsTconInfo *tcon, | |||
4985 | memcpy(data_offset, data, sizeof(FILE_BASIC_INFO)); | 4986 | memcpy(data_offset, data, sizeof(FILE_BASIC_INFO)); |
4986 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 4987 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); |
4987 | if (rc) | 4988 | if (rc) |
4988 | cFYI(1, ("Send error in Set Time (SetFileInfo) = %d", rc)); | 4989 | cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); |
4989 | 4990 | ||
4990 | /* Note: On -EAGAIN error only caller can retry on handle based calls | 4991 | /* Note: On -EAGAIN error only caller can retry on handle based calls |
4991 | since file handle passed in no longer valid */ | 4992 | since file handle passed in no longer valid */ |
@@ -5002,7 +5003,7 @@ CIFSSMBSetFileDisposition(const int xid, struct cifsTconInfo *tcon, | |||
5002 | int rc = 0; | 5003 | int rc = 0; |
5003 | __u16 params, param_offset, offset, byte_count, count; | 5004 | __u16 params, param_offset, offset, byte_count, count; |
5004 | 5005 | ||
5005 | cFYI(1, ("Set File Disposition (via SetFileInfo)")); | 5006 | cFYI(1, "Set File Disposition (via SetFileInfo)"); |
5006 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); | 5007 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); |
5007 | 5008 | ||
5008 | if (rc) | 5009 | if (rc) |
@@ -5044,7 +5045,7 @@ CIFSSMBSetFileDisposition(const int xid, struct cifsTconInfo *tcon, | |||
5044 | *data_offset = delete_file ? 1 : 0; | 5045 | *data_offset = delete_file ? 1 : 0; |
5045 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 5046 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); |
5046 | if (rc) | 5047 | if (rc) |
5047 | cFYI(1, ("Send error in SetFileDisposition = %d", rc)); | 5048 | cFYI(1, "Send error in SetFileDisposition = %d", rc); |
5048 | 5049 | ||
5049 | return rc; | 5050 | return rc; |
5050 | } | 5051 | } |
@@ -5062,7 +5063,7 @@ CIFSSMBSetPathInfo(const int xid, struct cifsTconInfo *tcon, | |||
5062 | char *data_offset; | 5063 | char *data_offset; |
5063 | __u16 params, param_offset, offset, byte_count, count; | 5064 | __u16 params, param_offset, offset, byte_count, count; |
5064 | 5065 | ||
5065 | cFYI(1, ("In SetTimes")); | 5066 | cFYI(1, "In SetTimes"); |
5066 | 5067 | ||
5067 | SetTimesRetry: | 5068 | SetTimesRetry: |
5068 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 5069 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
@@ -5118,7 +5119,7 @@ SetTimesRetry: | |||
5118 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 5119 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
5119 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 5120 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
5120 | if (rc) | 5121 | if (rc) |
5121 | cFYI(1, ("SetPathInfo (times) returned %d", rc)); | 5122 | cFYI(1, "SetPathInfo (times) returned %d", rc); |
5122 | 5123 | ||
5123 | cifs_buf_release(pSMB); | 5124 | cifs_buf_release(pSMB); |
5124 | 5125 | ||
@@ -5143,7 +5144,7 @@ CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon, char *fileName, | |||
5143 | int bytes_returned; | 5144 | int bytes_returned; |
5144 | int name_len; | 5145 | int name_len; |
5145 | 5146 | ||
5146 | cFYI(1, ("In SetAttrLegacy")); | 5147 | cFYI(1, "In SetAttrLegacy"); |
5147 | 5148 | ||
5148 | SetAttrLgcyRetry: | 5149 | SetAttrLgcyRetry: |
5149 | rc = smb_init(SMB_COM_SETATTR, 8, tcon, (void **) &pSMB, | 5150 | rc = smb_init(SMB_COM_SETATTR, 8, tcon, (void **) &pSMB, |
@@ -5169,7 +5170,7 @@ SetAttrLgcyRetry: | |||
5169 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 5170 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
5170 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 5171 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
5171 | if (rc) | 5172 | if (rc) |
5172 | cFYI(1, ("Error in LegacySetAttr = %d", rc)); | 5173 | cFYI(1, "Error in LegacySetAttr = %d", rc); |
5173 | 5174 | ||
5174 | cifs_buf_release(pSMB); | 5175 | cifs_buf_release(pSMB); |
5175 | 5176 | ||
@@ -5231,7 +5232,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifsTconInfo *tcon, | |||
5231 | int rc = 0; | 5232 | int rc = 0; |
5232 | u16 params, param_offset, offset, byte_count, count; | 5233 | u16 params, param_offset, offset, byte_count, count; |
5233 | 5234 | ||
5234 | cFYI(1, ("Set Unix Info (via SetFileInfo)")); | 5235 | cFYI(1, "Set Unix Info (via SetFileInfo)"); |
5235 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); | 5236 | rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); |
5236 | 5237 | ||
5237 | if (rc) | 5238 | if (rc) |
@@ -5276,7 +5277,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifsTconInfo *tcon, | |||
5276 | 5277 | ||
5277 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); | 5278 | rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); |
5278 | if (rc) | 5279 | if (rc) |
5279 | cFYI(1, ("Send error in Set Time (SetFileInfo) = %d", rc)); | 5280 | cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); |
5280 | 5281 | ||
5281 | /* Note: On -EAGAIN error only caller can retry on handle based calls | 5282 | /* Note: On -EAGAIN error only caller can retry on handle based calls |
5282 | since file handle passed in no longer valid */ | 5283 | since file handle passed in no longer valid */ |
@@ -5297,7 +5298,7 @@ CIFSSMBUnixSetPathInfo(const int xid, struct cifsTconInfo *tcon, char *fileName, | |||
5297 | FILE_UNIX_BASIC_INFO *data_offset; | 5298 | FILE_UNIX_BASIC_INFO *data_offset; |
5298 | __u16 params, param_offset, offset, count, byte_count; | 5299 | __u16 params, param_offset, offset, count, byte_count; |
5299 | 5300 | ||
5300 | cFYI(1, ("In SetUID/GID/Mode")); | 5301 | cFYI(1, "In SetUID/GID/Mode"); |
5301 | setPermsRetry: | 5302 | setPermsRetry: |
5302 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 5303 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
5303 | (void **) &pSMBr); | 5304 | (void **) &pSMBr); |
@@ -5353,7 +5354,7 @@ setPermsRetry: | |||
5353 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 5354 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
5354 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 5355 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
5355 | if (rc) | 5356 | if (rc) |
5356 | cFYI(1, ("SetPathInfo (perms) returned %d", rc)); | 5357 | cFYI(1, "SetPathInfo (perms) returned %d", rc); |
5357 | 5358 | ||
5358 | cifs_buf_release(pSMB); | 5359 | cifs_buf_release(pSMB); |
5359 | if (rc == -EAGAIN) | 5360 | if (rc == -EAGAIN) |
@@ -5372,7 +5373,7 @@ int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, | |||
5372 | struct dir_notify_req *dnotify_req; | 5373 | struct dir_notify_req *dnotify_req; |
5373 | int bytes_returned; | 5374 | int bytes_returned; |
5374 | 5375 | ||
5375 | cFYI(1, ("In CIFSSMBNotify for file handle %d", (int)netfid)); | 5376 | cFYI(1, "In CIFSSMBNotify for file handle %d", (int)netfid); |
5376 | rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, | 5377 | rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, |
5377 | (void **) &pSMBr); | 5378 | (void **) &pSMBr); |
5378 | if (rc) | 5379 | if (rc) |
@@ -5406,7 +5407,7 @@ int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, | |||
5406 | (struct smb_hdr *)pSMBr, &bytes_returned, | 5407 | (struct smb_hdr *)pSMBr, &bytes_returned, |
5407 | CIFS_ASYNC_OP); | 5408 | CIFS_ASYNC_OP); |
5408 | if (rc) { | 5409 | if (rc) { |
5409 | cFYI(1, ("Error in Notify = %d", rc)); | 5410 | cFYI(1, "Error in Notify = %d", rc); |
5410 | } else { | 5411 | } else { |
5411 | /* Add file to outstanding requests */ | 5412 | /* Add file to outstanding requests */ |
5412 | /* BB change to kmem cache alloc */ | 5413 | /* BB change to kmem cache alloc */ |
@@ -5462,7 +5463,7 @@ CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon, | |||
5462 | char *end_of_smb; | 5463 | char *end_of_smb; |
5463 | __u16 params, byte_count, data_offset; | 5464 | __u16 params, byte_count, data_offset; |
5464 | 5465 | ||
5465 | cFYI(1, ("In Query All EAs path %s", searchName)); | 5466 | cFYI(1, "In Query All EAs path %s", searchName); |
5466 | QAllEAsRetry: | 5467 | QAllEAsRetry: |
5467 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 5468 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
5468 | (void **) &pSMBr); | 5469 | (void **) &pSMBr); |
@@ -5509,7 +5510,7 @@ QAllEAsRetry: | |||
5509 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 5510 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
5510 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 5511 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
5511 | if (rc) { | 5512 | if (rc) { |
5512 | cFYI(1, ("Send error in QueryAllEAs = %d", rc)); | 5513 | cFYI(1, "Send error in QueryAllEAs = %d", rc); |
5513 | goto QAllEAsOut; | 5514 | goto QAllEAsOut; |
5514 | } | 5515 | } |
5515 | 5516 | ||
@@ -5537,16 +5538,16 @@ QAllEAsRetry: | |||
5537 | (((char *) &pSMBr->hdr.Protocol) + data_offset); | 5538 | (((char *) &pSMBr->hdr.Protocol) + data_offset); |
5538 | 5539 | ||
5539 | list_len = le32_to_cpu(ea_response_data->list_len); | 5540 | list_len = le32_to_cpu(ea_response_data->list_len); |
5540 | cFYI(1, ("ea length %d", list_len)); | 5541 | cFYI(1, "ea length %d", list_len); |
5541 | if (list_len <= 8) { | 5542 | if (list_len <= 8) { |
5542 | cFYI(1, ("empty EA list returned from server")); | 5543 | cFYI(1, "empty EA list returned from server"); |
5543 | goto QAllEAsOut; | 5544 | goto QAllEAsOut; |
5544 | } | 5545 | } |
5545 | 5546 | ||
5546 | /* make sure list_len doesn't go past end of SMB */ | 5547 | /* make sure list_len doesn't go past end of SMB */ |
5547 | end_of_smb = (char *)pByteArea(&pSMBr->hdr) + BCC(&pSMBr->hdr); | 5548 | end_of_smb = (char *)pByteArea(&pSMBr->hdr) + BCC(&pSMBr->hdr); |
5548 | if ((char *)ea_response_data + list_len > end_of_smb) { | 5549 | if ((char *)ea_response_data + list_len > end_of_smb) { |
5549 | cFYI(1, ("EA list appears to go beyond SMB")); | 5550 | cFYI(1, "EA list appears to go beyond SMB"); |
5550 | rc = -EIO; | 5551 | rc = -EIO; |
5551 | goto QAllEAsOut; | 5552 | goto QAllEAsOut; |
5552 | } | 5553 | } |
@@ -5563,7 +5564,7 @@ QAllEAsRetry: | |||
5563 | temp_ptr += 4; | 5564 | temp_ptr += 4; |
5564 | /* make sure we can read name_len and value_len */ | 5565 | /* make sure we can read name_len and value_len */ |
5565 | if (list_len < 0) { | 5566 | if (list_len < 0) { |
5566 | cFYI(1, ("EA entry goes beyond length of list")); | 5567 | cFYI(1, "EA entry goes beyond length of list"); |
5567 | rc = -EIO; | 5568 | rc = -EIO; |
5568 | goto QAllEAsOut; | 5569 | goto QAllEAsOut; |
5569 | } | 5570 | } |
@@ -5572,7 +5573,7 @@ QAllEAsRetry: | |||
5572 | value_len = le16_to_cpu(temp_fea->value_len); | 5573 | value_len = le16_to_cpu(temp_fea->value_len); |
5573 | list_len -= name_len + 1 + value_len; | 5574 | list_len -= name_len + 1 + value_len; |
5574 | if (list_len < 0) { | 5575 | if (list_len < 0) { |
5575 | cFYI(1, ("EA entry goes beyond length of list")); | 5576 | cFYI(1, "EA entry goes beyond length of list"); |
5576 | rc = -EIO; | 5577 | rc = -EIO; |
5577 | goto QAllEAsOut; | 5578 | goto QAllEAsOut; |
5578 | } | 5579 | } |
@@ -5639,7 +5640,7 @@ CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, const char *fileName, | |||
5639 | int bytes_returned = 0; | 5640 | int bytes_returned = 0; |
5640 | __u16 params, param_offset, byte_count, offset, count; | 5641 | __u16 params, param_offset, byte_count, offset, count; |
5641 | 5642 | ||
5642 | cFYI(1, ("In SetEA")); | 5643 | cFYI(1, "In SetEA"); |
5643 | SetEARetry: | 5644 | SetEARetry: |
5644 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, | 5645 | rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, |
5645 | (void **) &pSMBr); | 5646 | (void **) &pSMBr); |
@@ -5721,7 +5722,7 @@ SetEARetry: | |||
5721 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 5722 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
5722 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 5723 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
5723 | if (rc) | 5724 | if (rc) |
5724 | cFYI(1, ("SetPathInfo (EA) returned %d", rc)); | 5725 | cFYI(1, "SetPathInfo (EA) returned %d", rc); |
5725 | 5726 | ||
5726 | cifs_buf_release(pSMB); | 5727 | cifs_buf_release(pSMB); |
5727 | 5728 | ||