aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-05-04 23:12:25 -0400
committerSteve French <smfrench@gmail.com>2013-05-04 23:17:23 -0400
commitf96637be081141d6f8813429499f164260b49d70 (patch)
treec91f5a9b5a2b7a67bbeda15d7c9805655547a098
parentf7f7c1850eb98da758731ea7edfa830ebefe24cd (diff)
[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg
It's not obvious from reading the macro names that these macros are for debugging. Convert the names to a single more typical kernel style cifs_dbg macro. cERROR(1, ...) -> cifs_dbg(VFS, ...) cFYI(1, ...) -> cifs_dbg(FYI, ...) cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...) Move the terminating format newline from the macro to the call site. Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the "CIFS VFS: " prefix for VFS messages. Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y) $ size fs/cifs/cifs.ko* text data bss dec hex filename 265245 2525 132 267902 4167e fs/cifs/cifs.ko.new 268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old Other miscellaneous changes around these conversions: o Miscellaneous typo fixes o Add terminating \n's to almost all formats and remove them from the macros to be more kernel style like. A few formats previously had defective \n's o Remove unnecessary OOM messages as kmalloc() calls dump_stack o Coalesce formats to make grep easier, added missing spaces when coalescing formats o Use %s, __func__ instead of embedded function name o Removed unnecessary "cifs: " prefixes o Convert kzalloc with multiply to kcalloc o Remove unused cifswarn macro Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r--fs/cifs/asn1.c40
-rw-r--r--fs/cifs/cache.c6
-rw-r--r--fs/cifs/cifs_debug.c67
-rw-r--r--fs/cifs/cifs_debug.h70
-rw-r--r--fs/cifs/cifs_dfs_ref.c41
-rw-r--r--fs/cifs/cifs_spnego.c2
-rw-r--r--fs/cifs/cifs_unicode.c4
-rw-r--r--fs/cifs/cifsacl.c127
-rw-r--r--fs/cifs/cifsencrypt.c102
-rw-r--r--fs/cifs/cifsfs.c36
-rw-r--r--fs/cifs/cifsproto.h10
-rw-r--r--fs/cifs/cifssmb.c483
-rw-r--r--fs/cifs/connect.c310
-rw-r--r--fs/cifs/dir.c44
-rw-r--r--fs/cifs/dns_resolve.c17
-rw-r--r--fs/cifs/export.c2
-rw-r--r--fs/cifs/file.c166
-rw-r--r--fs/cifs/fscache.c58
-rw-r--r--fs/cifs/inode.c109
-rw-r--r--fs/cifs/ioctl.c6
-rw-r--r--fs/cifs/link.c24
-rw-r--r--fs/cifs/misc.c78
-rw-r--r--fs/cifs/netmisc.c16
-rw-r--r--fs/cifs/readdir.c77
-rw-r--r--fs/cifs/sess.c69
-rw-r--r--fs/cifs/smb1ops.c47
-rw-r--r--fs/cifs/smb2file.c8
-rw-r--r--fs/cifs/smb2inode.c2
-rw-r--r--fs/cifs/smb2maperror.c2
-rw-r--r--fs/cifs/smb2misc.c96
-rw-r--r--fs/cifs/smb2ops.c16
-rw-r--r--fs/cifs/smb2pdu.c157
-rw-r--r--fs/cifs/smb2transport.c26
-rw-r--r--fs/cifs/smbencrypt.c17
-rw-r--r--fs/cifs/transport.c61
-rw-r--r--fs/cifs/xattr.c54
36 files changed, 1223 insertions, 1227 deletions
diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c
index 1d36db114772..a3b56544c21b 100644
--- a/fs/cifs/asn1.c
+++ b/fs/cifs/asn1.c
@@ -506,11 +506,11 @@ decode_negTokenInit(unsigned char *security_blob, int length,
506 506
507 /* GSSAPI header */ 507 /* GSSAPI header */
508 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 508 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
509 cFYI(1, "Error decoding negTokenInit header"); 509 cifs_dbg(FYI, "Error decoding negTokenInit header\n");
510 return 0; 510 return 0;
511 } else if ((cls != ASN1_APL) || (con != ASN1_CON) 511 } else if ((cls != ASN1_APL) || (con != ASN1_CON)
512 || (tag != ASN1_EOC)) { 512 || (tag != ASN1_EOC)) {
513 cFYI(1, "cls = %d con = %d tag = %d", cls, con, tag); 513 cifs_dbg(FYI, "cls = %d con = %d tag = %d\n", cls, con, tag);
514 return 0; 514 return 0;
515 } 515 }
516 516
@@ -531,52 +531,52 @@ decode_negTokenInit(unsigned char *security_blob, int length,
531 531
532 /* SPNEGO OID not present or garbled -- bail out */ 532 /* SPNEGO OID not present or garbled -- bail out */
533 if (!rc) { 533 if (!rc) {
534 cFYI(1, "Error decoding negTokenInit header"); 534 cifs_dbg(FYI, "Error decoding negTokenInit header\n");
535 return 0; 535 return 0;
536 } 536 }
537 537
538 /* SPNEGO */ 538 /* SPNEGO */
539 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 539 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
540 cFYI(1, "Error decoding negTokenInit"); 540 cifs_dbg(FYI, "Error decoding negTokenInit\n");
541 return 0; 541 return 0;
542 } else if ((cls != ASN1_CTX) || (con != ASN1_CON) 542 } else if ((cls != ASN1_CTX) || (con != ASN1_CON)
543 || (tag != ASN1_EOC)) { 543 || (tag != ASN1_EOC)) {
544 cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0", 544 cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
545 cls, con, tag, end, *end); 545 cls, con, tag, end, *end);
546 return 0; 546 return 0;
547 } 547 }
548 548
549 /* negTokenInit */ 549 /* negTokenInit */
550 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 550 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
551 cFYI(1, "Error decoding negTokenInit"); 551 cifs_dbg(FYI, "Error decoding negTokenInit\n");
552 return 0; 552 return 0;
553 } else if ((cls != ASN1_UNI) || (con != ASN1_CON) 553 } else if ((cls != ASN1_UNI) || (con != ASN1_CON)
554 || (tag != ASN1_SEQ)) { 554 || (tag != ASN1_SEQ)) {
555 cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1", 555 cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
556 cls, con, tag, end, *end); 556 cls, con, tag, end, *end);
557 return 0; 557 return 0;
558 } 558 }
559 559
560 /* sequence */ 560 /* sequence */
561 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { 561 if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
562 cFYI(1, "Error decoding 2nd part of negTokenInit"); 562 cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n");
563 return 0; 563 return 0;
564 } else if ((cls != ASN1_CTX) || (con != ASN1_CON) 564 } else if ((cls != ASN1_CTX) || (con != ASN1_CON)
565 || (tag != ASN1_EOC)) { 565 || (tag != ASN1_EOC)) {
566 cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0", 566 cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
567 cls, con, tag, end, *end); 567 cls, con, tag, end, *end);
568 return 0; 568 return 0;
569 } 569 }
570 570
571 /* sequence of */ 571 /* sequence of */
572 if (asn1_header_decode 572 if (asn1_header_decode
573 (&ctx, &sequence_end, &cls, &con, &tag) == 0) { 573 (&ctx, &sequence_end, &cls, &con, &tag) == 0) {
574 cFYI(1, "Error decoding 2nd part of negTokenInit"); 574 cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n");
575 return 0; 575 return 0;
576 } else if ((cls != ASN1_UNI) || (con != ASN1_CON) 576 } else if ((cls != ASN1_UNI) || (con != ASN1_CON)
577 || (tag != ASN1_SEQ)) { 577 || (tag != ASN1_SEQ)) {
578 cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1", 578 cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
579 cls, con, tag, end, *end); 579 cls, con, tag, end, *end);
580 return 0; 580 return 0;
581 } 581 }
582 582
@@ -584,15 +584,15 @@ decode_negTokenInit(unsigned char *security_blob, int length,
584 while (!asn1_eoc_decode(&ctx, sequence_end)) { 584 while (!asn1_eoc_decode(&ctx, sequence_end)) {
585 rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag); 585 rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag);
586 if (!rc) { 586 if (!rc) {
587 cFYI(1, "Error decoding negTokenInit hdr exit2"); 587 cifs_dbg(FYI, "Error decoding negTokenInit hdr exit2\n");
588 return 0; 588 return 0;
589 } 589 }
590 if ((tag == ASN1_OJI) && (con == ASN1_PRI)) { 590 if ((tag == ASN1_OJI) && (con == ASN1_PRI)) {
591 if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) { 591 if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) {
592 592
593 cFYI(1, "OID len = %d oid = 0x%lx 0x%lx " 593 cifs_dbg(FYI, "OID len = %d oid = 0x%lx 0x%lx 0x%lx 0x%lx\n",
594 "0x%lx 0x%lx", oidlen, *oid, 594 oidlen, *oid, *(oid + 1), *(oid + 2),
595 *(oid + 1), *(oid + 2), *(oid + 3)); 595 *(oid + 3));
596 596
597 if (compare_oid(oid, oidlen, MSKRB5_OID, 597 if (compare_oid(oid, oidlen, MSKRB5_OID,
598 MSKRB5_OID_LEN)) 598 MSKRB5_OID_LEN))
@@ -610,7 +610,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
610 kfree(oid); 610 kfree(oid);
611 } 611 }
612 } else { 612 } else {
613 cFYI(1, "Should be an oid what is going on?"); 613 cifs_dbg(FYI, "Should be an oid what is going on?\n");
614 } 614 }
615 } 615 }
616 616
diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c
index 282d6de7e410..6c665bf4a27c 100644
--- a/fs/cifs/cache.c
+++ b/fs/cifs/cache.c
@@ -92,7 +92,7 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data,
92 break; 92 break;
93 93
94 default: 94 default:
95 cERROR(1, "Unknown network family '%d'", sa->sa_family); 95 cifs_dbg(VFS, "Unknown network family '%d'\n", sa->sa_family);
96 key_len = 0; 96 key_len = 0;
97 break; 97 break;
98 } 98 }
@@ -152,7 +152,7 @@ static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer,
152 152
153 sharename = extract_sharename(tcon->treeName); 153 sharename = extract_sharename(tcon->treeName);
154 if (IS_ERR(sharename)) { 154 if (IS_ERR(sharename)) {
155 cFYI(1, "%s: couldn't extract sharename", __func__); 155 cifs_dbg(FYI, "%s: couldn't extract sharename\n", __func__);
156 sharename = NULL; 156 sharename = NULL;
157 return 0; 157 return 0;
158 } 158 }
@@ -302,7 +302,7 @@ static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data)
302 pagevec_init(&pvec, 0); 302 pagevec_init(&pvec, 0);
303 first = 0; 303 first = 0;
304 304
305 cFYI(1, "%s: cifs inode 0x%p now uncached", __func__, cifsi); 305 cifs_dbg(FYI, "%s: cifs inode 0x%p now uncached\n", __func__, cifsi);
306 306
307 for (;;) { 307 for (;;) {
308 nr_pages = pagevec_lookup(&pvec, 308 nr_pages = pagevec_lookup(&pvec,
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index d9ea6ede6a7a..d59748346020 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -57,15 +57,32 @@ cifs_dump_mem(char *label, void *data, int length)
57 } 57 }
58} 58}
59 59
60#ifdef CONFIG_CIFS_DEBUG
61void cifs_vfs_err(const char *fmt, ...)
62{
63 struct va_format vaf;
64 va_list args;
65
66 va_start(args, fmt);
67
68 vaf.fmt = fmt;
69 vaf.va = &args;
70
71 printk(KERN_ERR "CIFS VFS: %pV", &vaf);
72
73 va_end(args);
74}
75#endif
76
60void cifs_dump_detail(void *buf) 77void cifs_dump_detail(void *buf)
61{ 78{
62#ifdef CONFIG_CIFS_DEBUG2 79#ifdef CONFIG_CIFS_DEBUG2
63 struct smb_hdr *smb = (struct smb_hdr *)buf; 80 struct smb_hdr *smb = (struct smb_hdr *)buf;
64 81
65 cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", 82 cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d\n",
66 smb->Command, smb->Status.CifsError, 83 smb->Command, smb->Status.CifsError,
67 smb->Flags, smb->Flags2, smb->Mid, smb->Pid); 84 smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
68 cERROR(1, "smb buf %p len %u", smb, smbCalcSize(smb)); 85 cifs_dbg(VFS, "smb buf %p len %u\n", smb, smbCalcSize(smb));
69#endif /* CONFIG_CIFS_DEBUG2 */ 86#endif /* CONFIG_CIFS_DEBUG2 */
70} 87}
71 88
@@ -78,25 +95,25 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
78 if (server == NULL) 95 if (server == NULL)
79 return; 96 return;
80 97
81 cERROR(1, "Dump pending requests:"); 98 cifs_dbg(VFS, "Dump pending requests:\n");
82 spin_lock(&GlobalMid_Lock); 99 spin_lock(&GlobalMid_Lock);
83 list_for_each(tmp, &server->pending_mid_q) { 100 list_for_each(tmp, &server->pending_mid_q) {
84 mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 101 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
85 cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu", 102 cifs_dbg(VFS, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu\n",
86 mid_entry->mid_state, 103 mid_entry->mid_state,
87 le16_to_cpu(mid_entry->command), 104 le16_to_cpu(mid_entry->command),
88 mid_entry->pid, 105 mid_entry->pid,
89 mid_entry->callback_data, 106 mid_entry->callback_data,
90 mid_entry->mid); 107 mid_entry->mid);
91#ifdef CONFIG_CIFS_STATS2 108#ifdef CONFIG_CIFS_STATS2
92 cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld", 109 cifs_dbg(VFS, "IsLarge: %d buf: %p time rcv: %ld now: %ld\n",
93 mid_entry->large_buf, 110 mid_entry->large_buf,
94 mid_entry->resp_buf, 111 mid_entry->resp_buf,
95 mid_entry->when_received, 112 mid_entry->when_received,
96 jiffies); 113 jiffies);
97#endif /* STATS2 */ 114#endif /* STATS2 */
98 cERROR(1, "IsMult: %d IsEnd: %d", mid_entry->multiRsp, 115 cifs_dbg(VFS, "IsMult: %d IsEnd: %d\n",
99 mid_entry->multiEnd); 116 mid_entry->multiRsp, mid_entry->multiEnd);
100 if (mid_entry->resp_buf) { 117 if (mid_entry->resp_buf) {
101 cifs_dump_detail(mid_entry->resp_buf); 118 cifs_dump_detail(mid_entry->resp_buf);
102 cifs_dump_mem("existing buf: ", 119 cifs_dump_mem("existing buf: ",
@@ -603,7 +620,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
603 global_secflags = CIFSSEC_MAX; 620 global_secflags = CIFSSEC_MAX;
604 return count; 621 return count;
605 } else if (!isdigit(c)) { 622 } else if (!isdigit(c)) {
606 cERROR(1, "invalid flag %c", c); 623 cifs_dbg(VFS, "invalid flag %c\n", c);
607 return -EINVAL; 624 return -EINVAL;
608 } 625 }
609 } 626 }
@@ -611,16 +628,16 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
611 628
612 flags = simple_strtoul(flags_string, NULL, 0); 629 flags = simple_strtoul(flags_string, NULL, 0);
613 630
614 cFYI(1, "sec flags 0x%x", flags); 631 cifs_dbg(FYI, "sec flags 0x%x\n", flags);
615 632
616 if (flags <= 0) { 633 if (flags <= 0) {
617 cERROR(1, "invalid security flags %s", flags_string); 634 cifs_dbg(VFS, "invalid security flags %s\n", flags_string);
618 return -EINVAL; 635 return -EINVAL;
619 } 636 }
620 637
621 if (flags & ~CIFSSEC_MASK) { 638 if (flags & ~CIFSSEC_MASK) {
622 cERROR(1, "attempt to set unsupported security flags 0x%x", 639 cifs_dbg(VFS, "attempt to set unsupported security flags 0x%x\n",
623 flags & ~CIFSSEC_MASK); 640 flags & ~CIFSSEC_MASK);
624 return -EINVAL; 641 return -EINVAL;
625 } 642 }
626 /* flags look ok - update the global security flags for cifs module */ 643 /* flags look ok - update the global security flags for cifs module */
@@ -628,9 +645,9 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
628 if (global_secflags & CIFSSEC_MUST_SIGN) { 645 if (global_secflags & CIFSSEC_MUST_SIGN) {
629 /* requiring signing implies signing is allowed */ 646 /* requiring signing implies signing is allowed */
630 global_secflags |= CIFSSEC_MAY_SIGN; 647 global_secflags |= CIFSSEC_MAY_SIGN;
631 cFYI(1, "packet signing now required"); 648 cifs_dbg(FYI, "packet signing now required\n");
632 } else if ((global_secflags & CIFSSEC_MAY_SIGN) == 0) { 649 } else if ((global_secflags & CIFSSEC_MAY_SIGN) == 0) {
633 cFYI(1, "packet signing disabled"); 650 cifs_dbg(FYI, "packet signing disabled\n");
634 } 651 }
635 /* BB should we turn on MAY flags for other MUST options? */ 652 /* BB should we turn on MAY flags for other MUST options? */
636 return count; 653 return count;
diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h
index 69ae3d3c3b31..c99b40fb609b 100644
--- a/fs/cifs/cifs_debug.h
+++ b/fs/cifs/cifs_debug.h
@@ -25,18 +25,20 @@
25void cifs_dump_mem(char *label, void *data, int length); 25void cifs_dump_mem(char *label, void *data, int length);
26void cifs_dump_detail(void *); 26void cifs_dump_detail(void *);
27void cifs_dump_mids(struct TCP_Server_Info *); 27void cifs_dump_mids(struct TCP_Server_Info *);
28#ifdef CONFIG_CIFS_DEBUG2
29#define DBG2 2
30#else
31#define DBG2 0
32#endif
33extern int traceSMB; /* flag which enables the function below */ 28extern int traceSMB; /* flag which enables the function below */
34void dump_smb(void *, int); 29void dump_smb(void *, int);
35#define CIFS_INFO 0x01 30#define CIFS_INFO 0x01
36#define CIFS_RC 0x02 31#define CIFS_RC 0x02
37#define CIFS_TIMER 0x04 32#define CIFS_TIMER 0x04
38 33
34#define VFS 1
35#define FYI 2
39extern int cifsFYI; 36extern int cifsFYI;
37#ifdef CONFIG_CIFS_DEBUG2
38#define NOISY 4
39#else
40#define NOISY 0
41#endif
40 42
41/* 43/*
42 * debug ON 44 * debug ON
@@ -44,31 +46,21 @@ extern int cifsFYI;
44 */ 46 */
45#ifdef CONFIG_CIFS_DEBUG 47#ifdef CONFIG_CIFS_DEBUG
46 48
47/* information message: e.g., configuration, major event */ 49__printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
48#define cifsfyi(fmt, ...) \
49do { \
50 if (cifsFYI & CIFS_INFO) \
51 printk(KERN_DEBUG "%s: " fmt "\n", \
52 __FILE__, ##__VA_ARGS__); \
53} while (0)
54
55#define cFYI(set, fmt, ...) \
56do { \
57 if (set) \
58 cifsfyi(fmt, ##__VA_ARGS__); \
59} while (0)
60 50
61#define cifswarn(fmt, ...) \ 51/* information message: e.g., configuration, major event */
62 printk(KERN_WARNING fmt "\n", ##__VA_ARGS__) 52#define cifs_dbg(type, fmt, ...) \
63
64/* error event message: e.g., i/o error */
65#define cifserror(fmt, ...) \
66 printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
67
68#define cERROR(set, fmt, ...) \
69do { \ 53do { \
70 if (set) \ 54 if (type == FYI) { \
71 cifserror(fmt, ##__VA_ARGS__); \ 55 if (cifsFYI & CIFS_INFO) { \
56 printk(KERN_DEBUG "%s: " fmt, \
57 __FILE__, ##__VA_ARGS__); \
58 } \
59 } else if (type == VFS) { \
60 cifs_vfs_err(fmt, ##__VA_ARGS__); \
61 } else if (type == NOISY && type != 0) { \
62 printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
63 } \
72} while (0) 64} while (0)
73 65
74/* 66/*
@@ -76,27 +68,11 @@ do { \
76 * --------- 68 * ---------
77 */ 69 */
78#else /* _CIFS_DEBUG */ 70#else /* _CIFS_DEBUG */
79#define cifsfyi(fmt, ...) \ 71#define cifs_dbg(type, fmt, ...) \
80do { \ 72do { \
81 if (0) \ 73 if (0) \
82 printk(KERN_DEBUG "%s: " fmt "\n", \ 74 printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
83 __FILE__, ##__VA_ARGS__); \
84} while (0) 75} while (0)
85#define cFYI(set, fmt, ...) \ 76#endif
86do { \
87 if (0 && set) \
88 cifsfyi(fmt, ##__VA_ARGS__); \
89} while (0)
90#define cifserror(fmt, ...) \
91do { \
92 if (0) \
93 printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
94} while (0)
95#define cERROR(set, fmt, ...) \
96do { \
97 if (0 && set) \
98 cifserror(fmt, ##__VA_ARGS__); \
99} while (0)
100#endif /* _CIFS_DEBUG */
101 77
102#endif /* _H_CIFS_DEBUG */ 78#endif /* _H_CIFS_DEBUG */
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 210fce2df308..8e33ec65847b 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -84,8 +84,8 @@ static char *cifs_get_share_name(const char *node_name)
84 /* find server name end */ 84 /* find server name end */
85 pSep = memchr(UNC+2, '\\', len-2); 85 pSep = memchr(UNC+2, '\\', len-2);
86 if (!pSep) { 86 if (!pSep) {
87 cERROR(1, "%s: no server name end in node name: %s", 87 cifs_dbg(VFS, "%s: no server name end in node name: %s\n",
88 __func__, node_name); 88 __func__, node_name);
89 kfree(UNC); 89 kfree(UNC);
90 return ERR_PTR(-EINVAL); 90 return ERR_PTR(-EINVAL);
91 } 91 }
@@ -141,8 +141,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
141 141
142 rc = dns_resolve_server_name_to_ip(*devname, &srvIP); 142 rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
143 if (rc < 0) { 143 if (rc < 0) {
144 cFYI(1, "%s: Failed to resolve server part of %s to IP: %d", 144 cifs_dbg(FYI, "%s: Failed to resolve server part of %s to IP: %d\n",
145 __func__, *devname, rc); 145 __func__, *devname, rc);
146 goto compose_mount_options_err; 146 goto compose_mount_options_err;
147 } 147 }
148 148
@@ -216,8 +216,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
216 strcat(mountdata, fullpath + ref->path_consumed); 216 strcat(mountdata, fullpath + ref->path_consumed);
217 } 217 }
218 218
219 /*cFYI(1, "%s: parent mountdata: %s", __func__,sb_mountdata);*/ 219 /*cifs_dbg(FYI, "%s: parent mountdata: %s\n", __func__, sb_mountdata);*/
220 /*cFYI(1, "%s: submount mountdata: %s", __func__, mountdata );*/ 220 /*cifs_dbg(FYI, "%s: submount mountdata: %s\n", __func__, mountdata );*/
221 221
222compose_mount_options_out: 222compose_mount_options_out:
223 kfree(srvIP); 223 kfree(srvIP);
@@ -260,11 +260,12 @@ static struct vfsmount *cifs_dfs_do_refmount(struct cifs_sb_info *cifs_sb,
260 260
261static void dump_referral(const struct dfs_info3_param *ref) 261static void dump_referral(const struct dfs_info3_param *ref)
262{ 262{
263 cFYI(1, "DFS: ref path: %s", ref->path_name); 263 cifs_dbg(FYI, "DFS: ref path: %s\n", ref->path_name);
264 cFYI(1, "DFS: node path: %s", ref->node_name); 264 cifs_dbg(FYI, "DFS: node path: %s\n", ref->node_name);
265 cFYI(1, "DFS: fl: %hd, srv_type: %hd", ref->flags, ref->server_type); 265 cifs_dbg(FYI, "DFS: fl: %hd, srv_type: %hd\n",
266 cFYI(1, "DFS: ref_flags: %hd, path_consumed: %hd", ref->ref_flag, 266 ref->flags, ref->server_type);
267 ref->path_consumed); 267 cifs_dbg(FYI, "DFS: ref_flags: %hd, path_consumed: %hd\n",
268 ref->ref_flag, ref->path_consumed);
268} 269}
269 270
270/* 271/*
@@ -283,7 +284,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
283 struct vfsmount *mnt; 284 struct vfsmount *mnt;
284 struct tcon_link *tlink; 285 struct tcon_link *tlink;
285 286
286 cFYI(1, "in %s", __func__); 287 cifs_dbg(FYI, "in %s\n", __func__);
287 BUG_ON(IS_ROOT(mntpt)); 288 BUG_ON(IS_ROOT(mntpt));
288 289
289 /* 290 /*
@@ -320,15 +321,15 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
320 /* connect to a node */ 321 /* connect to a node */
321 len = strlen(referrals[i].node_name); 322 len = strlen(referrals[i].node_name);
322 if (len < 2) { 323 if (len < 2) {
323 cERROR(1, "%s: Net Address path too short: %s", 324 cifs_dbg(VFS, "%s: Net Address path too short: %s\n",
324 __func__, referrals[i].node_name); 325 __func__, referrals[i].node_name);
325 mnt = ERR_PTR(-EINVAL); 326 mnt = ERR_PTR(-EINVAL);
326 break; 327 break;
327 } 328 }
328 mnt = cifs_dfs_do_refmount(cifs_sb, 329 mnt = cifs_dfs_do_refmount(cifs_sb,
329 full_path, referrals + i); 330 full_path, referrals + i);
330 cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, 331 cifs_dbg(FYI, "%s: cifs_dfs_do_refmount:%s , mnt:%p\n",
331 referrals[i].node_name, mnt); 332 __func__, referrals[i].node_name, mnt);
332 if (!IS_ERR(mnt)) 333 if (!IS_ERR(mnt))
333 goto success; 334 goto success;
334 } 335 }
@@ -343,7 +344,7 @@ success:
343free_full_path: 344free_full_path:
344 kfree(full_path); 345 kfree(full_path);
345cdda_exit: 346cdda_exit:
346 cFYI(1, "leaving %s" , __func__); 347 cifs_dbg(FYI, "leaving %s\n" , __func__);
347 return mnt; 348 return mnt;
348} 349}
349 350
@@ -354,11 +355,11 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path)
354{ 355{
355 struct vfsmount *newmnt; 356 struct vfsmount *newmnt;
356 357
357 cFYI(1, "in %s", __func__); 358 cifs_dbg(FYI, "in %s\n", __func__);
358 359
359 newmnt = cifs_dfs_do_automount(path->dentry); 360 newmnt = cifs_dfs_do_automount(path->dentry);
360 if (IS_ERR(newmnt)) { 361 if (IS_ERR(newmnt)) {
361 cFYI(1, "leaving %s [automount failed]" , __func__); 362 cifs_dbg(FYI, "leaving %s [automount failed]\n" , __func__);
362 return newmnt; 363 return newmnt;
363 } 364 }
364 365
@@ -366,7 +367,7 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path)
366 mnt_set_expiry(newmnt, &cifs_dfs_automount_list); 367 mnt_set_expiry(newmnt, &cifs_dfs_automount_list);
367 schedule_delayed_work(&cifs_dfs_automount_task, 368 schedule_delayed_work(&cifs_dfs_automount_task,
368 cifs_dfs_mountpoint_expiry_timeout); 369 cifs_dfs_mountpoint_expiry_timeout);
369 cFYI(1, "leaving %s [ok]" , __func__); 370 cifs_dbg(FYI, "leaving %s [ok]\n" , __func__);
370 return newmnt; 371 return newmnt;
371} 372}
372 373
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
index b7ae3cb55549..a3e932547617 100644
--- a/fs/cifs/cifs_spnego.c
+++ b/fs/cifs/cifs_spnego.c
@@ -163,7 +163,7 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
163 dp = description + strlen(description); 163 dp = description + strlen(description);
164 sprintf(dp, ";pid=0x%x", current->pid); 164 sprintf(dp, ";pid=0x%x", current->pid);
165 165
166 cFYI(1, "key description = %s", description); 166 cifs_dbg(FYI, "key description = %s\n", description);
167 spnego_key = request_key(&cifs_spnego_key_type, description, ""); 167 spnego_key = request_key(&cifs_spnego_key_type, description, "");
168 168
169#ifdef CONFIG_CIFS_DEBUG2 169#ifdef CONFIG_CIFS_DEBUG2
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
index 71d5d0a5f6b2..0227b45ef00a 100644
--- a/fs/cifs/cifs_unicode.c
+++ b/fs/cifs/cifs_unicode.c
@@ -227,8 +227,8 @@ cifs_strtoUTF16(__le16 *to, const char *from, int len,
227 for (i = 0; len && *from; i++, from += charlen, len -= charlen) { 227 for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
228 charlen = codepage->char2uni(from, len, &wchar_to); 228 charlen = codepage->char2uni(from, len, &wchar_to);
229 if (charlen < 1) { 229 if (charlen < 1) {
230 cERROR(1, "strtoUTF16: char2uni of 0x%x returned %d", 230 cifs_dbg(VFS, "strtoUTF16: char2uni of 0x%x returned %d\n",
231 *from, charlen); 231 *from, charlen);
232 /* A question mark */ 232 /* A question mark */
233 wchar_to = 0x003f; 233 wchar_to = 0x003f;
234 charlen = 1; 234 charlen = 1;
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 0bba930d0009..51f5e0ee7237 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -218,13 +218,13 @@ id_to_sid(unsigned int cid, uint sidtype, struct cifs_sid *ssid)
218 sidkey = request_key(&cifs_idmap_key_type, desc, ""); 218 sidkey = request_key(&cifs_idmap_key_type, desc, "");
219 if (IS_ERR(sidkey)) { 219 if (IS_ERR(sidkey)) {
220 rc = -EINVAL; 220 rc = -EINVAL;
221 cFYI(1, "%s: Can't map %cid %u to a SID", __func__, 221 cifs_dbg(FYI, "%s: Can't map %cid %u to a SID\n",
222 sidtype == SIDOWNER ? 'u' : 'g', cid); 222 __func__, sidtype == SIDOWNER ? 'u' : 'g', cid);
223 goto out_revert_creds; 223 goto out_revert_creds;
224 } else if (sidkey->datalen < CIFS_SID_BASE_SIZE) { 224 } else if (sidkey->datalen < CIFS_SID_BASE_SIZE) {
225 rc = -EIO; 225 rc = -EIO;
226 cFYI(1, "%s: Downcall contained malformed key " 226 cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
227 "(datalen=%hu)", __func__, sidkey->datalen); 227 __func__, sidkey->datalen);
228 goto invalidate_key; 228 goto invalidate_key;
229 } 229 }
230 230
@@ -240,8 +240,8 @@ id_to_sid(unsigned int cid, uint sidtype, struct cifs_sid *ssid)
240 ksid_size = CIFS_SID_BASE_SIZE + (ksid->num_subauth * sizeof(__le32)); 240 ksid_size = CIFS_SID_BASE_SIZE + (ksid->num_subauth * sizeof(__le32));
241 if (ksid_size > sidkey->datalen) { 241 if (ksid_size > sidkey->datalen) {
242 rc = -EIO; 242 rc = -EIO;
243 cFYI(1, "%s: Downcall contained malformed key (datalen=%hu, " 243 cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu, ksid_size=%u)\n",
244 "ksid_size=%u)", __func__, sidkey->datalen, ksid_size); 244 __func__, sidkey->datalen, ksid_size);
245 goto invalidate_key; 245 goto invalidate_key;
246 } 246 }
247 247
@@ -273,8 +273,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
273 * Just return an error. 273 * Just return an error.
274 */ 274 */
275 if (unlikely(psid->num_subauth > SID_MAX_SUB_AUTHORITIES)) { 275 if (unlikely(psid->num_subauth > SID_MAX_SUB_AUTHORITIES)) {
276 cFYI(1, "%s: %u subauthorities is too many!", __func__, 276 cifs_dbg(FYI, "%s: %u subauthorities is too many!\n",
277 psid->num_subauth); 277 __func__, psid->num_subauth);
278 return -EIO; 278 return -EIO;
279 } 279 }
280 280
@@ -286,8 +286,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
286 sidkey = request_key(&cifs_idmap_key_type, sidstr, ""); 286 sidkey = request_key(&cifs_idmap_key_type, sidstr, "");
287 if (IS_ERR(sidkey)) { 287 if (IS_ERR(sidkey)) {
288 rc = -EINVAL; 288 rc = -EINVAL;
289 cFYI(1, "%s: Can't map SID %s to a %cid", __func__, sidstr, 289 cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n",
290 sidtype == SIDOWNER ? 'u' : 'g'); 290 __func__, sidstr, sidtype == SIDOWNER ? 'u' : 'g');
291 goto out_revert_creds; 291 goto out_revert_creds;
292 } 292 }
293 293
@@ -299,8 +299,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
299 BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t)); 299 BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t));
300 if (sidkey->datalen != sizeof(uid_t)) { 300 if (sidkey->datalen != sizeof(uid_t)) {
301 rc = -EIO; 301 rc = -EIO;
302 cFYI(1, "%s: Downcall contained malformed key " 302 cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
303 "(datalen=%hu)", __func__, sidkey->datalen); 303 __func__, sidkey->datalen);
304 key_invalidate(sidkey); 304 key_invalidate(sidkey);
305 goto out_key_put; 305 goto out_key_put;
306 } 306 }
@@ -345,7 +345,8 @@ init_cifs_idmap(void)
345 struct key *keyring; 345 struct key *keyring;
346 int ret; 346 int ret;
347 347
348 cFYI(1, "Registering the %s key type", cifs_idmap_key_type.name); 348 cifs_dbg(FYI, "Registering the %s key type\n",
349 cifs_idmap_key_type.name);
349 350
350 /* create an override credential set with a special thread keyring in 351 /* create an override credential set with a special thread keyring in
351 * which requests are cached 352 * which requests are cached
@@ -378,7 +379,7 @@ init_cifs_idmap(void)
378 cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING; 379 cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
379 root_cred = cred; 380 root_cred = cred;
380 381
381 cFYI(1, "cifs idmap keyring: %d", key_serial(keyring)); 382 cifs_dbg(FYI, "cifs idmap keyring: %d\n", key_serial(keyring));
382 return 0; 383 return 0;
383 384
384failed_put_key: 385failed_put_key:
@@ -394,7 +395,7 @@ exit_cifs_idmap(void)
394 key_revoke(root_cred->thread_keyring); 395 key_revoke(root_cred->thread_keyring);
395 unregister_key_type(&cifs_idmap_key_type); 396 unregister_key_type(&cifs_idmap_key_type);
396 put_cred(root_cred); 397 put_cred(root_cred);
397 cFYI(1, "Unregistered %s key type", cifs_idmap_key_type.name); 398 cifs_dbg(FYI, "Unregistered %s key type\n", cifs_idmap_key_type.name);
398} 399}
399 400
400/* copy ntsd, owner sid, and group sid from a security descriptor to another */ 401/* copy ntsd, owner sid, and group sid from a security descriptor to another */
@@ -461,14 +462,14 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
461 *pbits_to_set &= ~S_IXUGO; 462 *pbits_to_set &= ~S_IXUGO;
462 return; 463 return;
463 } else if (type != ACCESS_ALLOWED) { 464 } else if (type != ACCESS_ALLOWED) {
464 cERROR(1, "unknown access control type %d", type); 465 cifs_dbg(VFS, "unknown access control type %d\n", type);
465 return; 466 return;
466 } 467 }
467 /* else ACCESS_ALLOWED type */ 468 /* else ACCESS_ALLOWED type */
468 469
469 if (flags & GENERIC_ALL) { 470 if (flags & GENERIC_ALL) {
470 *pmode |= (S_IRWXUGO & (*pbits_to_set)); 471 *pmode |= (S_IRWXUGO & (*pbits_to_set));
471 cFYI(DBG2, "all perms"); 472 cifs_dbg(NOISY, "all perms\n");
472 return; 473 return;
473 } 474 }
474 if ((flags & GENERIC_WRITE) || 475 if ((flags & GENERIC_WRITE) ||
@@ -481,7 +482,7 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
481 ((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS)) 482 ((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS))
482 *pmode |= (S_IXUGO & (*pbits_to_set)); 483 *pmode |= (S_IXUGO & (*pbits_to_set));
483 484
484 cFYI(DBG2, "access flags 0x%x mode now 0x%x", flags, *pmode); 485 cifs_dbg(NOISY, "access flags 0x%x mode now 0x%x\n", flags, *pmode);
485 return; 486 return;
486} 487}
487 488
@@ -510,7 +511,8 @@ static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
510 if (mode & S_IXUGO) 511 if (mode & S_IXUGO)
511 *pace_flags |= SET_FILE_EXEC_RIGHTS; 512 *pace_flags |= SET_FILE_EXEC_RIGHTS;
512 513
513 cFYI(DBG2, "mode: 0x%x, access flags now 0x%x", mode, *pace_flags); 514 cifs_dbg(NOISY, "mode: 0x%x, access flags now 0x%x\n",
515 mode, *pace_flags);
514 return; 516 return;
515} 517}
516 518
@@ -550,24 +552,24 @@ static void dump_ace(struct cifs_ace *pace, char *end_of_acl)
550 /* validate that we do not go past end of acl */ 552 /* validate that we do not go past end of acl */
551 553
552 if (le16_to_cpu(pace->size) < 16) { 554 if (le16_to_cpu(pace->size) < 16) {
553 cERROR(1, "ACE too small %d", le16_to_cpu(pace->size)); 555 cifs_dbg(VFS, "ACE too small %d\n", le16_to_cpu(pace->size));
554 return; 556 return;
555 } 557 }
556 558
557 if (end_of_acl < (char *)pace + le16_to_cpu(pace->size)) { 559 if (end_of_acl < (char *)pace + le16_to_cpu(pace->size)) {
558 cERROR(1, "ACL too small to parse ACE"); 560 cifs_dbg(VFS, "ACL too small to parse ACE\n");
559 return; 561 return;
560 } 562 }
561 563
562 num_subauth = pace->sid.num_subauth; 564 num_subauth = pace->sid.num_subauth;
563 if (num_subauth) { 565 if (num_subauth) {
564 int i; 566 int i;
565 cFYI(1, "ACE revision %d num_auth %d type %d flags %d size %d", 567 cifs_dbg(FYI, "ACE revision %d num_auth %d type %d flags %d size %d\n",
566 pace->sid.revision, pace->sid.num_subauth, pace->type, 568 pace->sid.revision, pace->sid.num_subauth, pace->type,
567 pace->flags, le16_to_cpu(pace->size)); 569 pace->flags, le16_to_cpu(pace->size));
568 for (i = 0; i < num_subauth; ++i) { 570 for (i = 0; i < num_subauth; ++i) {
569 cFYI(1, "ACE sub_auth[%d]: 0x%x", i, 571 cifs_dbg(FYI, "ACE sub_auth[%d]: 0x%x\n",
570 le32_to_cpu(pace->sid.sub_auth[i])); 572 i, le32_to_cpu(pace->sid.sub_auth[i]));
571 } 573 }
572 574
573 /* BB add length check to make sure that we do not have huge 575 /* BB add length check to make sure that we do not have huge
@@ -600,13 +602,13 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
600 602
601 /* validate that we do not go past end of acl */ 603 /* validate that we do not go past end of acl */
602 if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) { 604 if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {
603 cERROR(1, "ACL too small to parse DACL"); 605 cifs_dbg(VFS, "ACL too small to parse DACL\n");
604 return; 606 return;
605 } 607 }
606 608
607 cFYI(DBG2, "DACL revision %d size %d num aces %d", 609 cifs_dbg(NOISY, "DACL revision %d size %d num aces %d\n",
608 le16_to_cpu(pdacl->revision), le16_to_cpu(pdacl->size), 610 le16_to_cpu(pdacl->revision), le16_to_cpu(pdacl->size),
609 le32_to_cpu(pdacl->num_aces)); 611 le32_to_cpu(pdacl->num_aces));
610 612
611 /* reset rwx permissions for user/group/other. 613 /* reset rwx permissions for user/group/other.
612 Also, if num_aces is 0 i.e. DACL has no ACEs, 614 Also, if num_aces is 0 i.e. DACL has no ACEs,
@@ -626,10 +628,8 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
626 return; 628 return;
627 ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), 629 ppace = kmalloc(num_aces * sizeof(struct cifs_ace *),
628 GFP_KERNEL); 630 GFP_KERNEL);
629 if (!ppace) { 631 if (!ppace)
630 cERROR(1, "DACL memory allocation error");
631 return; 632 return;
632 }
633 633
634 for (i = 0; i < num_aces; ++i) { 634 for (i = 0; i < num_aces; ++i) {
635 ppace[i] = (struct cifs_ace *) (acl_base + acl_size); 635 ppace[i] = (struct cifs_ace *) (acl_base + acl_size);
@@ -702,25 +702,25 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl)
702 /* validate that we do not go past end of ACL - sid must be at least 8 702 /* validate that we do not go past end of ACL - sid must be at least 8
703 bytes long (assuming no sub-auths - e.g. the null SID */ 703 bytes long (assuming no sub-auths - e.g. the null SID */
704 if (end_of_acl < (char *)psid + 8) { 704 if (end_of_acl < (char *)psid + 8) {
705 cERROR(1, "ACL too small to parse SID %p", psid); 705 cifs_dbg(VFS, "ACL too small to parse SID %p\n", psid);
706 return -EINVAL; 706 return -EINVAL;
707 } 707 }
708 708
709#ifdef CONFIG_CIFS_DEBUG2 709#ifdef CONFIG_CIFS_DEBUG2
710 if (psid->num_subauth) { 710 if (psid->num_subauth) {
711 int i; 711 int i;
712 cFYI(1, "SID revision %d num_auth %d", 712 cifs_dbg(FYI, "SID revision %d num_auth %d\n",
713 psid->revision, psid->num_subauth); 713 psid->revision, psid->num_subauth);
714 714
715 for (i = 0; i < psid->num_subauth; i++) { 715 for (i = 0; i < psid->num_subauth; i++) {
716 cFYI(1, "SID sub_auth[%d]: 0x%x ", i, 716 cifs_dbg(FYI, "SID sub_auth[%d]: 0x%x\n",
717 le32_to_cpu(psid->sub_auth[i])); 717 i, le32_to_cpu(psid->sub_auth[i]));
718 } 718 }
719 719
720 /* BB add length check to make sure that we do not have huge 720 /* BB add length check to make sure that we do not have huge
721 num auths and therefore go off the end */ 721 num auths and therefore go off the end */
722 cFYI(1, "RID 0x%x", 722 cifs_dbg(FYI, "RID 0x%x\n",
723 le32_to_cpu(psid->sub_auth[psid->num_subauth-1])); 723 le32_to_cpu(psid->sub_auth[psid->num_subauth-1]));
724 } 724 }
725#endif 725#endif
726 726
@@ -747,31 +747,33 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
747 le32_to_cpu(pntsd->gsidoffset)); 747 le32_to_cpu(pntsd->gsidoffset));
748 dacloffset = le32_to_cpu(pntsd->dacloffset); 748 dacloffset = le32_to_cpu(pntsd->dacloffset);
749 dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset); 749 dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);
750 cFYI(DBG2, "revision %d type 0x%x ooffset 0x%x goffset 0x%x " 750 cifs_dbg(NOISY, "revision %d type 0x%x ooffset 0x%x goffset 0x%x sacloffset 0x%x dacloffset 0x%x\n",
751 "sacloffset 0x%x dacloffset 0x%x",
752 pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset), 751 pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset),
753 le32_to_cpu(pntsd->gsidoffset), 752 le32_to_cpu(pntsd->gsidoffset),
754 le32_to_cpu(pntsd->sacloffset), dacloffset); 753 le32_to_cpu(pntsd->sacloffset), dacloffset);
755/* cifs_dump_mem("owner_sid: ", owner_sid_ptr, 64); */ 754/* cifs_dump_mem("owner_sid: ", owner_sid_ptr, 64); */
756 rc = parse_sid(owner_sid_ptr, end_of_acl); 755 rc = parse_sid(owner_sid_ptr, end_of_acl);
757 if (rc) { 756 if (rc) {
758 cFYI(1, "%s: Error %d parsing Owner SID", __func__, rc); 757 cifs_dbg(FYI, "%s: Error %d parsing Owner SID\n", __func__, rc);
759 return rc; 758 return rc;
760 } 759 }
761 rc = sid_to_id(cifs_sb, owner_sid_ptr, fattr, SIDOWNER); 760 rc = sid_to_id(cifs_sb, owner_sid_ptr, fattr, SIDOWNER);
762 if (rc) { 761 if (rc) {
763 cFYI(1, "%s: Error %d mapping Owner SID to uid", __func__, rc); 762 cifs_dbg(FYI, "%s: Error %d mapping Owner SID to uid\n",
763 __func__, rc);
764 return rc; 764 return rc;
765 } 765 }
766 766
767 rc = parse_sid(group_sid_ptr, end_of_acl); 767 rc = parse_sid(group_sid_ptr, end_of_acl);
768 if (rc) { 768 if (rc) {
769 cFYI(1, "%s: Error %d mapping Owner SID to gid", __func__, rc); 769 cifs_dbg(FYI, "%s: Error %d mapping Owner SID to gid\n",
770 __func__, rc);
770 return rc; 771 return rc;
771 } 772 }
772 rc = sid_to_id(cifs_sb, group_sid_ptr, fattr, SIDGROUP); 773 rc = sid_to_id(cifs_sb, group_sid_ptr, fattr, SIDGROUP);
773 if (rc) { 774 if (rc) {
774 cFYI(1, "%s: Error %d mapping Group SID to gid", __func__, rc); 775 cifs_dbg(FYI, "%s: Error %d mapping Group SID to gid\n",
776 __func__, rc);
775 return rc; 777 return rc;
776 } 778 }
777 779
@@ -779,7 +781,7 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
779 parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr, 781 parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr,
780 group_sid_ptr, fattr); 782 group_sid_ptr, fattr);
781 else 783 else
782 cFYI(1, "no ACL"); /* BB grant all or default perms? */ 784 cifs_dbg(FYI, "no ACL\n"); /* BB grant all or default perms? */
783 785
784 return rc; 786 return rc;
785} 787}
@@ -829,8 +831,8 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
829 id = from_kuid(&init_user_ns, uid); 831 id = from_kuid(&init_user_ns, uid);
830 rc = id_to_sid(id, SIDOWNER, nowner_sid_ptr); 832 rc = id_to_sid(id, SIDOWNER, nowner_sid_ptr);
831 if (rc) { 833 if (rc) {
832 cFYI(1, "%s: Mapping error %d for owner id %d", 834 cifs_dbg(FYI, "%s: Mapping error %d for owner id %d\n",
833 __func__, rc, id); 835 __func__, rc, id);
834 kfree(nowner_sid_ptr); 836 kfree(nowner_sid_ptr);
835 return rc; 837 return rc;
836 } 838 }
@@ -849,8 +851,8 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
849 id = from_kgid(&init_user_ns, gid); 851 id = from_kgid(&init_user_ns, gid);
850 rc = id_to_sid(id, SIDGROUP, ngroup_sid_ptr); 852 rc = id_to_sid(id, SIDGROUP, ngroup_sid_ptr);
851 if (rc) { 853 if (rc) {
852 cFYI(1, "%s: Mapping error %d for group id %d", 854 cifs_dbg(FYI, "%s: Mapping error %d for group id %d\n",
853 __func__, rc, id); 855 __func__, rc, id);
854 kfree(ngroup_sid_ptr); 856 kfree(ngroup_sid_ptr);
855 return rc; 857 return rc;
856 } 858 }
@@ -880,7 +882,7 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
880 882
881 cifs_put_tlink(tlink); 883 cifs_put_tlink(tlink);
882 884
883 cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); 885 cifs_dbg(FYI, "%s: rc = %d ACL len %d\n", __func__, rc, *pacllen);
884 if (rc) 886 if (rc)
885 return ERR_PTR(rc); 887 return ERR_PTR(rc);
886 return pntsd; 888 return pntsd;
@@ -917,7 +919,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
917 cifs_put_tlink(tlink); 919 cifs_put_tlink(tlink);
918 free_xid(xid); 920 free_xid(xid);
919 921
920 cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); 922 cifs_dbg(FYI, "%s: rc = %d ACL len %d\n", __func__, rc, *pacllen);
921 if (rc) 923 if (rc)
922 return ERR_PTR(rc); 924 return ERR_PTR(rc);
923 return pntsd; 925 return pntsd;
@@ -971,12 +973,12 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
971 create_options, &fid, &oplock, NULL, cifs_sb->local_nls, 973 create_options, &fid, &oplock, NULL, cifs_sb->local_nls,
972 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 974 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
973 if (rc) { 975 if (rc) {
974 cERROR(1, "Unable to open file to set ACL"); 976 cifs_dbg(VFS, "Unable to open file to set ACL\n");
975 goto out; 977 goto out;
976 } 978 }
977 979
978 rc = CIFSSMBSetCIFSACL(xid, tcon, fid, pnntsd, acllen, aclflag); 980 rc = CIFSSMBSetCIFSACL(xid, tcon, fid, pnntsd, acllen, aclflag);
979 cFYI(DBG2, "SetCIFSACL rc = %d", rc); 981 cifs_dbg(NOISY, "SetCIFSACL rc = %d\n", rc);
980 982
981 CIFSSMBClose(xid, tcon, fid); 983 CIFSSMBClose(xid, tcon, fid);
982out: 984out:
@@ -994,7 +996,7 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
994 u32 acllen = 0; 996 u32 acllen = 0;
995 int rc = 0; 997 int rc = 0;
996 998
997 cFYI(DBG2, "converting ACL to mode for %s", path); 999 cifs_dbg(NOISY, "converting ACL to mode for %s\n", path);
998 1000
999 if (pfid) 1001 if (pfid)
1000 pntsd = get_cifs_acl_by_fid(cifs_sb, *pfid, &acllen); 1002 pntsd = get_cifs_acl_by_fid(cifs_sb, *pfid, &acllen);
@@ -1004,12 +1006,12 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
1004 /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */ 1006 /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */
1005 if (IS_ERR(pntsd)) { 1007 if (IS_ERR(pntsd)) {
1006 rc = PTR_ERR(pntsd); 1008 rc = PTR_ERR(pntsd);
1007 cERROR(1, "%s: error %d getting sec desc", __func__, rc); 1009 cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);
1008 } else { 1010 } else {
1009 rc = parse_sec_desc(cifs_sb, pntsd, acllen, fattr); 1011 rc = parse_sec_desc(cifs_sb, pntsd, acllen, fattr);
1010 kfree(pntsd); 1012 kfree(pntsd);
1011 if (rc) 1013 if (rc)
1012 cERROR(1, "parse sec desc failed rc = %d", rc); 1014 cifs_dbg(VFS, "parse sec desc failed rc = %d\n", rc);
1013 } 1015 }
1014 1016
1015 return rc; 1017 return rc;
@@ -1026,13 +1028,13 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
1026 struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */ 1028 struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */
1027 struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */ 1029 struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
1028 1030
1029 cFYI(DBG2, "set ACL from mode for %s", path); 1031 cifs_dbg(NOISY, "set ACL from mode for %s\n", path);
1030 1032
1031 /* Get the security descriptor */ 1033 /* Get the security descriptor */
1032 pntsd = get_cifs_acl(CIFS_SB(inode->i_sb), inode, path, &secdesclen); 1034 pntsd = get_cifs_acl(CIFS_SB(inode->i_sb), inode, path, &secdesclen);
1033 if (IS_ERR(pntsd)) { 1035 if (IS_ERR(pntsd)) {
1034 rc = PTR_ERR(pntsd); 1036 rc = PTR_ERR(pntsd);
1035 cERROR(1, "%s: error %d getting sec desc", __func__, rc); 1037 cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);
1036 goto out; 1038 goto out;
1037 } 1039 }
1038 1040
@@ -1045,7 +1047,6 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
1045 secdesclen = max_t(u32, secdesclen, DEFAULT_SEC_DESC_LEN); 1047 secdesclen = max_t(u32, secdesclen, DEFAULT_SEC_DESC_LEN);
1046 pnntsd = kmalloc(secdesclen, GFP_KERNEL); 1048 pnntsd = kmalloc(secdesclen, GFP_KERNEL);
1047 if (!pnntsd) { 1049 if (!pnntsd) {
1048 cERROR(1, "Unable to allocate security descriptor");
1049 kfree(pntsd); 1050 kfree(pntsd);
1050 return -ENOMEM; 1051 return -ENOMEM;
1051 } 1052 }
@@ -1053,12 +1054,12 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
1053 rc = build_sec_desc(pntsd, pnntsd, secdesclen, nmode, uid, gid, 1054 rc = build_sec_desc(pntsd, pnntsd, secdesclen, nmode, uid, gid,
1054 &aclflag); 1055 &aclflag);
1055 1056
1056 cFYI(DBG2, "build_sec_desc rc: %d", rc); 1057 cifs_dbg(NOISY, "build_sec_desc rc: %d\n", rc);
1057 1058
1058 if (!rc) { 1059 if (!rc) {
1059 /* Set the security descriptor */ 1060 /* Set the security descriptor */
1060 rc = set_cifs_acl(pnntsd, secdesclen, inode, path, aclflag); 1061 rc = set_cifs_acl(pnntsd, secdesclen, inode, path, aclflag);
1061 cFYI(DBG2, "set_cifs_acl rc: %d", rc); 1062 cifs_dbg(NOISY, "set_cifs_acl rc: %d\n", rc);
1062 } 1063 }
1063 1064
1064 kfree(pnntsd); 1065 kfree(pnntsd);
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 652f5051be09..2cbbec6ce9cb 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -50,20 +50,20 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
50 return -EINVAL; 50 return -EINVAL;
51 51
52 if (!server->secmech.sdescmd5) { 52 if (!server->secmech.sdescmd5) {
53 cERROR(1, "%s: Can't generate signature", __func__); 53 cifs_dbg(VFS, "%s: Can't generate signature\n", __func__);
54 return -1; 54 return -1;
55 } 55 }
56 56
57 rc = crypto_shash_init(&server->secmech.sdescmd5->shash); 57 rc = crypto_shash_init(&server->secmech.sdescmd5->shash);
58 if (rc) { 58 if (rc) {
59 cERROR(1, "%s: Could not init md5", __func__); 59 cifs_dbg(VFS, "%s: Could not init md5\n", __func__);
60 return rc; 60 return rc;
61 } 61 }
62 62
63 rc = crypto_shash_update(&server->secmech.sdescmd5->shash, 63 rc = crypto_shash_update(&server->secmech.sdescmd5->shash,
64 server->session_key.response, server->session_key.len); 64 server->session_key.response, server->session_key.len);
65 if (rc) { 65 if (rc) {
66 cERROR(1, "%s: Could not update with response", __func__); 66 cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
67 return rc; 67 return rc;
68 } 68 }
69 69
@@ -71,7 +71,7 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
71 if (iov[i].iov_len == 0) 71 if (iov[i].iov_len == 0)
72 continue; 72 continue;
73 if (iov[i].iov_base == NULL) { 73 if (iov[i].iov_base == NULL) {
74 cERROR(1, "null iovec entry"); 74 cifs_dbg(VFS, "null iovec entry\n");
75 return -EIO; 75 return -EIO;
76 } 76 }
77 /* The first entry includes a length field (which does not get 77 /* The first entry includes a length field (which does not get
@@ -88,8 +88,8 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
88 iov[i].iov_base, iov[i].iov_len); 88 iov[i].iov_base, iov[i].iov_len);
89 } 89 }
90 if (rc) { 90 if (rc) {
91 cERROR(1, "%s: Could not update with payload", 91 cifs_dbg(VFS, "%s: Could not update with payload\n",
92 __func__); 92 __func__);
93 return rc; 93 return rc;
94 } 94 }
95 } 95 }
@@ -106,7 +106,7 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
106 106
107 rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature); 107 rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature);
108 if (rc) 108 if (rc)
109 cERROR(1, "%s: Could not generate md5 hash", __func__); 109 cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
110 110
111 return rc; 111 return rc;
112} 112}
@@ -196,8 +196,8 @@ int cifs_verify_signature(struct smb_rqst *rqst,
196 196
197 /* Do not need to verify session setups with signature "BSRSPYL " */ 197 /* Do not need to verify session setups with signature "BSRSPYL " */
198 if (memcmp(cifs_pdu->Signature.SecuritySignature, "BSRSPYL ", 8) == 0) 198 if (memcmp(cifs_pdu->Signature.SecuritySignature, "BSRSPYL ", 8) == 0)
199 cFYI(1, "dummy signature received for smb command 0x%x", 199 cifs_dbg(FYI, "dummy signature received for smb command 0x%x\n",
200 cifs_pdu->Command); 200 cifs_pdu->Command);
201 201
202 /* save off the origiginal signature so we can modify the smb and check 202 /* save off the origiginal signature so we can modify the smb and check
203 its signature against what the server sent */ 203 its signature against what the server sent */
@@ -235,30 +235,30 @@ int setup_ntlm_response(struct cifs_ses *ses, const struct nls_table *nls_cp)
235 return -EINVAL; 235 return -EINVAL;
236 236
237 ses->auth_key.response = kmalloc(temp_len, GFP_KERNEL); 237 ses->auth_key.response = kmalloc(temp_len, GFP_KERNEL);
238 if (!ses->auth_key.response) { 238 if (!ses->auth_key.response)
239 cERROR(1, "NTLM can't allocate (%u bytes) memory", temp_len);
240 return -ENOMEM; 239 return -ENOMEM;
241 } 240
242 ses->auth_key.len = temp_len; 241 ses->auth_key.len = temp_len;
243 242
244 rc = SMBNTencrypt(ses->password, ses->server->cryptkey, 243 rc = SMBNTencrypt(ses->password, ses->server->cryptkey,
245 ses->auth_key.response + CIFS_SESS_KEY_SIZE, nls_cp); 244 ses->auth_key.response + CIFS_SESS_KEY_SIZE, nls_cp);
246 if (rc) { 245 if (rc) {
247 cFYI(1, "%s Can't generate NTLM response, error: %d", 246 cifs_dbg(FYI, "%s Can't generate NTLM response, error: %d\n",
248 __func__, rc); 247 __func__, rc);
249 return rc; 248 return rc;
250 } 249 }
251 250
252 rc = E_md4hash(ses->password, temp_key, nls_cp); 251 rc = E_md4hash(ses->password, temp_key, nls_cp);
253 if (rc) { 252 if (rc) {
254 cFYI(1, "%s Can't generate NT hash, error: %d", __func__, rc); 253 cifs_dbg(FYI, "%s Can't generate NT hash, error: %d\n",
254 __func__, rc);
255 return rc; 255 return rc;
256 } 256 }
257 257
258 rc = mdfour(ses->auth_key.response, temp_key, CIFS_SESS_KEY_SIZE); 258 rc = mdfour(ses->auth_key.response, temp_key, CIFS_SESS_KEY_SIZE);
259 if (rc) 259 if (rc)
260 cFYI(1, "%s Can't generate NTLM session key, error: %d", 260 cifs_dbg(FYI, "%s Can't generate NTLM session key, error: %d\n",
261 __func__, rc); 261 __func__, rc);
262 262
263 return rc; 263 return rc;
264} 264}
@@ -334,7 +334,6 @@ build_avpair_blob(struct cifs_ses *ses, const struct nls_table *nls_cp)
334 ses->auth_key.response = kzalloc(ses->auth_key.len, GFP_KERNEL); 334 ses->auth_key.response = kzalloc(ses->auth_key.len, GFP_KERNEL);
335 if (!ses->auth_key.response) { 335 if (!ses->auth_key.response) {
336 ses->auth_key.len = 0; 336 ses->auth_key.len = 0;
337 cERROR(1, "Challenge target info allocation failure");
338 return -ENOMEM; 337 return -ENOMEM;
339 } 338 }
340 339
@@ -420,7 +419,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
420 wchar_t *server; 419 wchar_t *server;
421 420
422 if (!ses->server->secmech.sdeschmacmd5) { 421 if (!ses->server->secmech.sdeschmacmd5) {
423 cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash"); 422 cifs_dbg(VFS, "%s: can't generate ntlmv2 hash\n", __func__);
424 return -1; 423 return -1;
425 } 424 }
426 425
@@ -430,13 +429,13 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
430 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, nt_hash, 429 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, nt_hash,
431 CIFS_NTHASH_SIZE); 430 CIFS_NTHASH_SIZE);
432 if (rc) { 431 if (rc) {
433 cERROR(1, "%s: Could not set NT Hash as a key", __func__); 432 cifs_dbg(VFS, "%s: Could not set NT Hash as a key\n", __func__);
434 return rc; 433 return rc;
435 } 434 }
436 435
437 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); 436 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
438 if (rc) { 437 if (rc) {
439 cERROR(1, "calc_ntlmv2_hash: could not init hmacmd5"); 438 cifs_dbg(VFS, "%s: could not init hmacmd5\n", __func__);
440 return rc; 439 return rc;
441 } 440 }
442 441
@@ -444,7 +443,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
444 len = ses->user_name ? strlen(ses->user_name) : 0; 443 len = ses->user_name ? strlen(ses->user_name) : 0;
445 user = kmalloc(2 + (len * 2), GFP_KERNEL); 444 user = kmalloc(2 + (len * 2), GFP_KERNEL);
446 if (user == NULL) { 445 if (user == NULL) {
447 cERROR(1, "calc_ntlmv2_hash: user mem alloc failure");
448 rc = -ENOMEM; 446 rc = -ENOMEM;
449 return rc; 447 return rc;
450 } 448 }
@@ -460,7 +458,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
460 (char *)user, 2 * len); 458 (char *)user, 2 * len);
461 kfree(user); 459 kfree(user);
462 if (rc) { 460 if (rc) {
463 cERROR(1, "%s: Could not update with user", __func__); 461 cifs_dbg(VFS, "%s: Could not update with user\n", __func__);
464 return rc; 462 return rc;
465 } 463 }
466 464
@@ -470,7 +468,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
470 468
471 domain = kmalloc(2 + (len * 2), GFP_KERNEL); 469 domain = kmalloc(2 + (len * 2), GFP_KERNEL);
472 if (domain == NULL) { 470 if (domain == NULL) {
473 cERROR(1, "calc_ntlmv2_hash: domain mem alloc failure");
474 rc = -ENOMEM; 471 rc = -ENOMEM;
475 return rc; 472 return rc;
476 } 473 }
@@ -481,8 +478,8 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
481 (char *)domain, 2 * len); 478 (char *)domain, 2 * len);
482 kfree(domain); 479 kfree(domain);
483 if (rc) { 480 if (rc) {
484 cERROR(1, "%s: Could not update with domain", 481 cifs_dbg(VFS, "%s: Could not update with domain\n",
485 __func__); 482 __func__);
486 return rc; 483 return rc;
487 } 484 }
488 } else if (ses->serverName) { 485 } else if (ses->serverName) {
@@ -490,7 +487,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
490 487
491 server = kmalloc(2 + (len * 2), GFP_KERNEL); 488 server = kmalloc(2 + (len * 2), GFP_KERNEL);
492 if (server == NULL) { 489 if (server == NULL) {
493 cERROR(1, "calc_ntlmv2_hash: server mem alloc failure");
494 rc = -ENOMEM; 490 rc = -ENOMEM;
495 return rc; 491 return rc;
496 } 492 }
@@ -501,8 +497,8 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
501 (char *)server, 2 * len); 497 (char *)server, 2 * len);
502 kfree(server); 498 kfree(server);
503 if (rc) { 499 if (rc) {
504 cERROR(1, "%s: Could not update with server", 500 cifs_dbg(VFS, "%s: Could not update with server\n",
505 __func__); 501 __func__);
506 return rc; 502 return rc;
507 } 503 }
508 } 504 }
@@ -510,7 +506,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
510 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, 506 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
511 ntlmv2_hash); 507 ntlmv2_hash);
512 if (rc) 508 if (rc)
513 cERROR(1, "%s: Could not generate md5 hash", __func__); 509 cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
514 510
515 return rc; 511 return rc;
516} 512}
@@ -522,20 +518,21 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
522 unsigned int offset = CIFS_SESS_KEY_SIZE + 8; 518 unsigned int offset = CIFS_SESS_KEY_SIZE + 8;
523 519
524 if (!ses->server->secmech.sdeschmacmd5) { 520 if (!ses->server->secmech.sdeschmacmd5) {
525 cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash"); 521 cifs_dbg(VFS, "%s: can't generate ntlmv2 hash\n", __func__);
526 return -1; 522 return -1;
527 } 523 }
528 524
529 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, 525 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5,
530 ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE); 526 ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE);
531 if (rc) { 527 if (rc) {
532 cERROR(1, "%s: Could not set NTLMV2 Hash as a key", __func__); 528 cifs_dbg(VFS, "%s: Could not set NTLMV2 Hash as a key\n",
529 __func__);
533 return rc; 530 return rc;
534 } 531 }
535 532
536 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); 533 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
537 if (rc) { 534 if (rc) {
538 cERROR(1, "CalcNTLMv2_response: could not init hmacmd5"); 535 cifs_dbg(VFS, "%s: could not init hmacmd5\n", __func__);
539 return rc; 536 return rc;
540 } 537 }
541 538
@@ -548,14 +545,14 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
548 rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, 545 rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash,
549 ses->auth_key.response + offset, ses->auth_key.len - offset); 546 ses->auth_key.response + offset, ses->auth_key.len - offset);
550 if (rc) { 547 if (rc) {
551 cERROR(1, "%s: Could not update with response", __func__); 548 cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
552 return rc; 549 return rc;
553 } 550 }
554 551
555 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, 552 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
556 ses->auth_key.response + CIFS_SESS_KEY_SIZE); 553 ses->auth_key.response + CIFS_SESS_KEY_SIZE);
557 if (rc) 554 if (rc)
558 cERROR(1, "%s: Could not generate md5 hash", __func__); 555 cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
559 556
560 return rc; 557 return rc;
561} 558}
@@ -575,14 +572,15 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
575 if (!ses->domainName) { 572 if (!ses->domainName) {
576 rc = find_domain_name(ses, nls_cp); 573 rc = find_domain_name(ses, nls_cp);
577 if (rc) { 574 if (rc) {
578 cERROR(1, "error %d finding domain name", rc); 575 cifs_dbg(VFS, "error %d finding domain name\n",
576 rc);
579 goto setup_ntlmv2_rsp_ret; 577 goto setup_ntlmv2_rsp_ret;
580 } 578 }
581 } 579 }
582 } else { 580 } else {
583 rc = build_avpair_blob(ses, nls_cp); 581 rc = build_avpair_blob(ses, nls_cp);
584 if (rc) { 582 if (rc) {
585 cERROR(1, "error %d building av pair blob", rc); 583 cifs_dbg(VFS, "error %d building av pair blob\n", rc);
586 goto setup_ntlmv2_rsp_ret; 584 goto setup_ntlmv2_rsp_ret;
587 } 585 }
588 } 586 }
@@ -595,7 +593,6 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
595 if (!ses->auth_key.response) { 593 if (!ses->auth_key.response) {
596 rc = ENOMEM; 594 rc = ENOMEM;
597 ses->auth_key.len = 0; 595 ses->auth_key.len = 0;
598 cERROR(1, "%s: Can't allocate auth blob", __func__);
599 goto setup_ntlmv2_rsp_ret; 596 goto setup_ntlmv2_rsp_ret;
600 } 597 }
601 ses->auth_key.len += baselen; 598 ses->auth_key.len += baselen;
@@ -613,14 +610,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
613 /* calculate ntlmv2_hash */ 610 /* calculate ntlmv2_hash */
614 rc = calc_ntlmv2_hash(ses, ntlmv2_hash, nls_cp); 611 rc = calc_ntlmv2_hash(ses, ntlmv2_hash, nls_cp);
615 if (rc) { 612 if (rc) {
616 cERROR(1, "could not get v2 hash rc %d", rc); 613 cifs_dbg(VFS, "could not get v2 hash rc %d\n", rc);
617 goto setup_ntlmv2_rsp_ret; 614 goto setup_ntlmv2_rsp_ret;
618 } 615 }
619 616
620 /* calculate first part of the client response (CR1) */ 617 /* calculate first part of the client response (CR1) */
621 rc = CalcNTLMv2_response(ses, ntlmv2_hash); 618 rc = CalcNTLMv2_response(ses, ntlmv2_hash);
622 if (rc) { 619 if (rc) {
623 cERROR(1, "Could not calculate CR1 rc: %d", rc); 620 cifs_dbg(VFS, "Could not calculate CR1 rc: %d\n", rc);
624 goto setup_ntlmv2_rsp_ret; 621 goto setup_ntlmv2_rsp_ret;
625 } 622 }
626 623
@@ -628,13 +625,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
628 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, 625 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5,
629 ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE); 626 ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE);
630 if (rc) { 627 if (rc) {
631 cERROR(1, "%s: Could not set NTLMV2 Hash as a key", __func__); 628 cifs_dbg(VFS, "%s: Could not set NTLMV2 Hash as a key\n",
629 __func__);
632 goto setup_ntlmv2_rsp_ret; 630 goto setup_ntlmv2_rsp_ret;
633 } 631 }
634 632
635 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); 633 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
636 if (rc) { 634 if (rc) {
637 cERROR(1, "%s: Could not init hmacmd5", __func__); 635 cifs_dbg(VFS, "%s: Could not init hmacmd5\n", __func__);
638 goto setup_ntlmv2_rsp_ret; 636 goto setup_ntlmv2_rsp_ret;
639 } 637 }
640 638
@@ -642,14 +640,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
642 ses->auth_key.response + CIFS_SESS_KEY_SIZE, 640 ses->auth_key.response + CIFS_SESS_KEY_SIZE,
643 CIFS_HMAC_MD5_HASH_SIZE); 641 CIFS_HMAC_MD5_HASH_SIZE);
644 if (rc) { 642 if (rc) {
645 cERROR(1, "%s: Could not update with response", __func__); 643 cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
646 goto setup_ntlmv2_rsp_ret; 644 goto setup_ntlmv2_rsp_ret;
647 } 645 }
648 646
649 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, 647 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
650 ses->auth_key.response); 648 ses->auth_key.response);
651 if (rc) 649 if (rc)
652 cERROR(1, "%s: Could not generate md5 hash", __func__); 650 cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
653 651
654setup_ntlmv2_rsp_ret: 652setup_ntlmv2_rsp_ret:
655 kfree(tiblob); 653 kfree(tiblob);
@@ -671,7 +669,7 @@ calc_seckey(struct cifs_ses *ses)
671 tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); 669 tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
672 if (IS_ERR(tfm_arc4)) { 670 if (IS_ERR(tfm_arc4)) {
673 rc = PTR_ERR(tfm_arc4); 671 rc = PTR_ERR(tfm_arc4);
674 cERROR(1, "could not allocate crypto API arc4"); 672 cifs_dbg(VFS, "could not allocate crypto API arc4\n");
675 return rc; 673 return rc;
676 } 674 }
677 675
@@ -680,7 +678,8 @@ calc_seckey(struct cifs_ses *ses)
680 rc = crypto_blkcipher_setkey(tfm_arc4, ses->auth_key.response, 678 rc = crypto_blkcipher_setkey(tfm_arc4, ses->auth_key.response,
681 CIFS_SESS_KEY_SIZE); 679 CIFS_SESS_KEY_SIZE);
682 if (rc) { 680 if (rc) {
683 cERROR(1, "%s: Could not set response as a key", __func__); 681 cifs_dbg(VFS, "%s: Could not set response as a key\n",
682 __func__);
684 return rc; 683 return rc;
685 } 684 }
686 685
@@ -689,7 +688,7 @@ calc_seckey(struct cifs_ses *ses)
689 688
690 rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, CIFS_CPHTXT_SIZE); 689 rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, CIFS_CPHTXT_SIZE);
691 if (rc) { 690 if (rc) {
692 cERROR(1, "could not encrypt session key rc: %d", rc); 691 cifs_dbg(VFS, "could not encrypt session key rc: %d\n", rc);
693 crypto_free_blkcipher(tfm_arc4); 692 crypto_free_blkcipher(tfm_arc4);
694 return rc; 693 return rc;
695 } 694 }
@@ -731,20 +730,20 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
731 730
732 server->secmech.hmacmd5 = crypto_alloc_shash("hmac(md5)", 0, 0); 731 server->secmech.hmacmd5 = crypto_alloc_shash("hmac(md5)", 0, 0);
733 if (IS_ERR(server->secmech.hmacmd5)) { 732 if (IS_ERR(server->secmech.hmacmd5)) {
734 cERROR(1, "could not allocate crypto hmacmd5"); 733 cifs_dbg(VFS, "could not allocate crypto hmacmd5\n");
735 return PTR_ERR(server->secmech.hmacmd5); 734 return PTR_ERR(server->secmech.hmacmd5);
736 } 735 }
737 736
738 server->secmech.md5 = crypto_alloc_shash("md5", 0, 0); 737 server->secmech.md5 = crypto_alloc_shash("md5", 0, 0);
739 if (IS_ERR(server->secmech.md5)) { 738 if (IS_ERR(server->secmech.md5)) {
740 cERROR(1, "could not allocate crypto md5"); 739 cifs_dbg(VFS, "could not allocate crypto md5\n");
741 rc = PTR_ERR(server->secmech.md5); 740 rc = PTR_ERR(server->secmech.md5);
742 goto crypto_allocate_md5_fail; 741 goto crypto_allocate_md5_fail;
743 } 742 }
744 743
745 server->secmech.hmacsha256 = crypto_alloc_shash("hmac(sha256)", 0, 0); 744 server->secmech.hmacsha256 = crypto_alloc_shash("hmac(sha256)", 0, 0);
746 if (IS_ERR(server->secmech.hmacsha256)) { 745 if (IS_ERR(server->secmech.hmacsha256)) {
747 cERROR(1, "could not allocate crypto hmacsha256\n"); 746 cifs_dbg(VFS, "could not allocate crypto hmacsha256\n");
748 rc = PTR_ERR(server->secmech.hmacsha256); 747 rc = PTR_ERR(server->secmech.hmacsha256);
749 goto crypto_allocate_hmacsha256_fail; 748 goto crypto_allocate_hmacsha256_fail;
750 } 749 }
@@ -753,7 +752,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
753 crypto_shash_descsize(server->secmech.hmacmd5); 752 crypto_shash_descsize(server->secmech.hmacmd5);
754 server->secmech.sdeschmacmd5 = kmalloc(size, GFP_KERNEL); 753 server->secmech.sdeschmacmd5 = kmalloc(size, GFP_KERNEL);
755 if (!server->secmech.sdeschmacmd5) { 754 if (!server->secmech.sdeschmacmd5) {
756 cERROR(1, "cifs_crypto_shash_allocate: can't alloc hmacmd5");
757 rc = -ENOMEM; 755 rc = -ENOMEM;
758 goto crypto_allocate_hmacmd5_sdesc_fail; 756 goto crypto_allocate_hmacmd5_sdesc_fail;
759 } 757 }
@@ -764,7 +762,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
764 crypto_shash_descsize(server->secmech.md5); 762 crypto_shash_descsize(server->secmech.md5);
765 server->secmech.sdescmd5 = kmalloc(size, GFP_KERNEL); 763 server->secmech.sdescmd5 = kmalloc(size, GFP_KERNEL);
766 if (!server->secmech.sdescmd5) { 764 if (!server->secmech.sdescmd5) {
767 cERROR(1, "cifs_crypto_shash_allocate: can't alloc md5");
768 rc = -ENOMEM; 765 rc = -ENOMEM;
769 goto crypto_allocate_md5_sdesc_fail; 766 goto crypto_allocate_md5_sdesc_fail;
770 } 767 }
@@ -775,7 +772,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
775 crypto_shash_descsize(server->secmech.hmacsha256); 772 crypto_shash_descsize(server->secmech.hmacsha256);
776 server->secmech.sdeschmacsha256 = kmalloc(size, GFP_KERNEL); 773 server->secmech.sdeschmacsha256 = kmalloc(size, GFP_KERNEL);
777 if (!server->secmech.sdeschmacsha256) { 774 if (!server->secmech.sdeschmacsha256) {
778 cERROR(1, "%s: Can't alloc hmacsha256\n", __func__);
779 rc = -ENOMEM; 775 rc = -ENOMEM;
780 goto crypto_allocate_hmacsha256_sdesc_fail; 776 goto crypto_allocate_hmacsha256_sdesc_fail;
781 } 777 }
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 345fc89c4286..72e4efee1389 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -161,7 +161,7 @@ cifs_read_super(struct super_block *sb)
161 161
162#ifdef CONFIG_CIFS_NFSD_EXPORT 162#ifdef CONFIG_CIFS_NFSD_EXPORT
163 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { 163 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
164 cFYI(1, "export ops supported"); 164 cifs_dbg(FYI, "export ops supported\n");
165 sb->s_export_op = &cifs_export_ops; 165 sb->s_export_op = &cifs_export_ops;
166 } 166 }
167#endif /* CONFIG_CIFS_NFSD_EXPORT */ 167#endif /* CONFIG_CIFS_NFSD_EXPORT */
@@ -169,7 +169,7 @@ cifs_read_super(struct super_block *sb)
169 return 0; 169 return 0;
170 170
171out_no_root: 171out_no_root:
172 cERROR(1, "cifs_read_super: get root inode failed"); 172 cifs_dbg(VFS, "%s: get root inode failed\n", __func__);
173 return rc; 173 return rc;
174} 174}
175 175
@@ -502,7 +502,7 @@ static void cifs_umount_begin(struct super_block *sb)
502 /* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */ 502 /* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
503 /* cancel_notify_requests(tcon); */ 503 /* cancel_notify_requests(tcon); */
504 if (tcon->ses && tcon->ses->server) { 504 if (tcon->ses && tcon->ses->server) {
505 cFYI(1, "wake up tasks now - umount begin not complete"); 505 cifs_dbg(FYI, "wake up tasks now - umount begin not complete\n");
506 wake_up_all(&tcon->ses->server->request_q); 506 wake_up_all(&tcon->ses->server->request_q);
507 wake_up_all(&tcon->ses->server->response_q); 507 wake_up_all(&tcon->ses->server->response_q);
508 msleep(1); /* yield */ 508 msleep(1); /* yield */
@@ -573,7 +573,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
573 if (full_path == NULL) 573 if (full_path == NULL)
574 return ERR_PTR(-ENOMEM); 574 return ERR_PTR(-ENOMEM);
575 575
576 cFYI(1, "Get root dentry for %s", full_path); 576 cifs_dbg(FYI, "Get root dentry for %s\n", full_path);
577 577
578 sep = CIFS_DIR_SEP(cifs_sb); 578 sep = CIFS_DIR_SEP(cifs_sb);
579 dentry = dget(sb->s_root); 579 dentry = dget(sb->s_root);
@@ -632,7 +632,7 @@ cifs_do_mount(struct file_system_type *fs_type,
632 struct cifs_mnt_data mnt_data; 632 struct cifs_mnt_data mnt_data;
633 struct dentry *root; 633 struct dentry *root;
634 634
635 cFYI(1, "Devname: %s flags: %d ", dev_name, flags); 635 cifs_dbg(FYI, "Devname: %s flags: %d\n", dev_name, flags);
636 636
637 volume_info = cifs_get_volume_info((char *)data, dev_name); 637 volume_info = cifs_get_volume_info((char *)data, dev_name);
638 if (IS_ERR(volume_info)) 638 if (IS_ERR(volume_info))
@@ -655,7 +655,8 @@ cifs_do_mount(struct file_system_type *fs_type,
655 rc = cifs_mount(cifs_sb, volume_info); 655 rc = cifs_mount(cifs_sb, volume_info);
656 if (rc) { 656 if (rc) {
657 if (!(flags & MS_SILENT)) 657 if (!(flags & MS_SILENT))
658 cERROR(1, "cifs_mount failed w/return code = %d", rc); 658 cifs_dbg(VFS, "cifs_mount failed w/return code = %d\n",
659 rc);
659 root = ERR_PTR(rc); 660 root = ERR_PTR(rc);
660 goto out_mountdata; 661 goto out_mountdata;
661 } 662 }
@@ -675,7 +676,7 @@ cifs_do_mount(struct file_system_type *fs_type,
675 } 676 }
676 677
677 if (sb->s_root) { 678 if (sb->s_root) {
678 cFYI(1, "Use existing superblock"); 679 cifs_dbg(FYI, "Use existing superblock\n");
679 cifs_umount(cifs_sb); 680 cifs_umount(cifs_sb);
680 } else { 681 } else {
681 rc = cifs_read_super(sb); 682 rc = cifs_read_super(sb);
@@ -691,7 +692,7 @@ cifs_do_mount(struct file_system_type *fs_type,
691 if (IS_ERR(root)) 692 if (IS_ERR(root))
692 goto out_super; 693 goto out_super;
693 694
694 cFYI(1, "dentry root is: %p", root); 695 cifs_dbg(FYI, "dentry root is: %p\n", root);
695 goto out; 696 goto out;
696 697
697out_super: 698out_super:
@@ -723,7 +724,8 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
723 724
724 rc = filemap_fdatawrite(inode->i_mapping); 725 rc = filemap_fdatawrite(inode->i_mapping);
725 if (rc) 726 if (rc)
726 cFYI(1, "cifs_file_aio_write: %d rc on %p inode", rc, inode); 727 cifs_dbg(FYI, "cifs_file_aio_write: %d rc on %p inode\n",
728 rc, inode);
727 729
728 return written; 730 return written;
729} 731}
@@ -1030,7 +1032,10 @@ cifs_init_request_bufs(void)
1030 } else { 1032 } else {
1031 CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/ 1033 CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/
1032 } 1034 }
1033/* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */ 1035/*
1036 cifs_dbg(VFS, "CIFSMaxBufSize %d 0x%x\n",
1037 CIFSMaxBufSize, CIFSMaxBufSize);
1038*/
1034 cifs_req_cachep = kmem_cache_create("cifs_request", 1039 cifs_req_cachep = kmem_cache_create("cifs_request",
1035 CIFSMaxBufSize + max_hdr_size, 0, 1040 CIFSMaxBufSize + max_hdr_size, 0,
1036 SLAB_HWCACHE_ALIGN, NULL); 1041 SLAB_HWCACHE_ALIGN, NULL);
@@ -1041,7 +1046,7 @@ cifs_init_request_bufs(void)
1041 cifs_min_rcv = 1; 1046 cifs_min_rcv = 1;
1042 else if (cifs_min_rcv > 64) { 1047 else if (cifs_min_rcv > 64) {
1043 cifs_min_rcv = 64; 1048 cifs_min_rcv = 64;
1044 cERROR(1, "cifs_min_rcv set to maximum (64)"); 1049 cifs_dbg(VFS, "cifs_min_rcv set to maximum (64)\n");
1045 } 1050 }
1046 1051
1047 cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv, 1052 cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
@@ -1072,7 +1077,7 @@ cifs_init_request_bufs(void)
1072 cifs_min_small = 2; 1077 cifs_min_small = 2;
1073 else if (cifs_min_small > 256) { 1078 else if (cifs_min_small > 256) {
1074 cifs_min_small = 256; 1079 cifs_min_small = 256;
1075 cFYI(1, "cifs_min_small set to maximum (256)"); 1080 cifs_dbg(FYI, "cifs_min_small set to maximum (256)\n");
1076 } 1081 }
1077 1082
1078 cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small, 1083 cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small,
@@ -1163,10 +1168,11 @@ init_cifs(void)
1163 1168
1164 if (cifs_max_pending < 2) { 1169 if (cifs_max_pending < 2) {
1165 cifs_max_pending = 2; 1170 cifs_max_pending = 2;
1166 cFYI(1, "cifs_max_pending set to min of 2"); 1171 cifs_dbg(FYI, "cifs_max_pending set to min of 2\n");
1167 } else if (cifs_max_pending > CIFS_MAX_REQ) { 1172 } else if (cifs_max_pending > CIFS_MAX_REQ) {
1168 cifs_max_pending = CIFS_MAX_REQ; 1173 cifs_max_pending = CIFS_MAX_REQ;
1169 cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ); 1174 cifs_dbg(FYI, "cifs_max_pending set to max of %u\n",
1175 CIFS_MAX_REQ);
1170 } 1176 }
1171 1177
1172 cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); 1178 cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
@@ -1235,7 +1241,7 @@ out_clean_proc:
1235static void __exit 1241static void __exit
1236exit_cifs(void) 1242exit_cifs(void)
1237{ 1243{
1238 cFYI(DBG2, "exit_cifs"); 1244 cifs_dbg(NOISY, "exit_cifs\n");
1239 unregister_filesystem(&cifs_fs_type); 1245 unregister_filesystem(&cifs_fs_type);
1240 cifs_dfs_release_automount_timer(); 1246 cifs_dfs_release_automount_timer();
1241#ifdef CONFIG_CIFS_ACL 1247#ifdef CONFIG_CIFS_ACL
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index f450f0683ddd..dda188a94332 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -45,17 +45,17 @@ extern void _free_xid(unsigned int);
45#define get_xid() \ 45#define get_xid() \
46({ \ 46({ \
47 unsigned int __xid = _get_xid(); \ 47 unsigned int __xid = _get_xid(); \
48 cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d", \ 48 cifs_dbg(FYI, "CIFS VFS: in %s as Xid: %u with uid: %d\n", \
49 __func__, __xid, \ 49 __func__, __xid, \
50 from_kuid(&init_user_ns, current_fsuid())); \ 50 from_kuid(&init_user_ns, current_fsuid())); \
51 __xid; \ 51 __xid; \
52}) 52})
53 53
54#define free_xid(curr_xid) \ 54#define free_xid(curr_xid) \
55do { \ 55do { \
56 _free_xid(curr_xid); \ 56 _free_xid(curr_xid); \
57 cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d", \ 57 cifs_dbg(FYI, "CIFS VFS: leaving %s (xid = %u) rc = %d\n", \
58 __func__, curr_xid, (int)rc); \ 58 __func__, curr_xid, (int)rc); \
59} while (0) 59} while (0)
60extern int init_cifs_idmap(void); 60extern int init_cifs_idmap(void);
61extern void exit_cifs_idmap(void); 61extern void exit_cifs_idmap(void);
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 1e7a4fe1f810..728b3176984a 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -139,8 +139,8 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
139 if (smb_command != SMB_COM_WRITE_ANDX && 139 if (smb_command != SMB_COM_WRITE_ANDX &&
140 smb_command != SMB_COM_OPEN_ANDX && 140 smb_command != SMB_COM_OPEN_ANDX &&
141 smb_command != SMB_COM_TREE_DISCONNECT) { 141 smb_command != SMB_COM_TREE_DISCONNECT) {
142 cFYI(1, "can not send cmd %d while umounting", 142 cifs_dbg(FYI, "can not send cmd %d while umounting\n",
143 smb_command); 143 smb_command);
144 return -ENODEV; 144 return -ENODEV;
145 } 145 }
146 } 146 }
@@ -163,7 +163,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
163 * back on-line 163 * back on-line
164 */ 164 */
165 if (!tcon->retry) { 165 if (!tcon->retry) {
166 cFYI(1, "gave up waiting on reconnect in smb_init"); 166 cifs_dbg(FYI, "gave up waiting on reconnect in smb_init\n");
167 return -EHOSTDOWN; 167 return -EHOSTDOWN;
168 } 168 }
169 } 169 }
@@ -191,7 +191,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
191 cifs_mark_open_files_invalid(tcon); 191 cifs_mark_open_files_invalid(tcon);
192 rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage); 192 rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage);
193 mutex_unlock(&ses->session_mutex); 193 mutex_unlock(&ses->session_mutex);
194 cFYI(1, "reconnect tcon rc = %d", rc); 194 cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
195 195
196 if (rc) 196 if (rc)
197 goto out; 197 goto out;
@@ -396,7 +396,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
396 else /* if override flags set only sign/seal OR them with global auth */ 396 else /* if override flags set only sign/seal OR them with global auth */
397 secFlags = global_secflags | ses->overrideSecFlg; 397 secFlags = global_secflags | ses->overrideSecFlg;
398 398
399 cFYI(1, "secFlags 0x%x", secFlags); 399 cifs_dbg(FYI, "secFlags 0x%x\n", secFlags);
400 400
401 pSMB->hdr.Mid = get_next_mid(server); 401 pSMB->hdr.Mid = get_next_mid(server);
402 pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS); 402 pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS);
@@ -404,12 +404,12 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
404 if ((secFlags & CIFSSEC_MUST_KRB5) == CIFSSEC_MUST_KRB5) 404 if ((secFlags & CIFSSEC_MUST_KRB5) == CIFSSEC_MUST_KRB5)
405 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; 405 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
406 else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_KRB5) { 406 else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_KRB5) {
407 cFYI(1, "Kerberos only mechanism, enable extended security"); 407 cifs_dbg(FYI, "Kerberos only mechanism, enable extended security\n");
408 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; 408 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
409 } else if ((secFlags & CIFSSEC_MUST_NTLMSSP) == CIFSSEC_MUST_NTLMSSP) 409 } else if ((secFlags & CIFSSEC_MUST_NTLMSSP) == CIFSSEC_MUST_NTLMSSP)
410 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; 410 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
411 else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_NTLMSSP) { 411 else if ((secFlags & CIFSSEC_AUTH_MASK) == CIFSSEC_MAY_NTLMSSP) {
412 cFYI(1, "NTLMSSP only mechanism, enable extended security"); 412 cifs_dbg(FYI, "NTLMSSP only mechanism, enable extended security\n");
413 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; 413 pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
414 } 414 }
415 415
@@ -428,7 +428,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
428 goto neg_err_exit; 428 goto neg_err_exit;
429 429
430 server->dialect = le16_to_cpu(pSMBr->DialectIndex); 430 server->dialect = le16_to_cpu(pSMBr->DialectIndex);
431 cFYI(1, "Dialect: %d", server->dialect); 431 cifs_dbg(FYI, "Dialect: %d\n", server->dialect);
432 /* Check wct = 1 error case */ 432 /* Check wct = 1 error case */
433 if ((pSMBr->hdr.WordCount < 13) || (server->dialect == BAD_PROT)) { 433 if ((pSMBr->hdr.WordCount < 13) || (server->dialect == BAD_PROT)) {
434 /* core returns wct = 1, but we do not ask for core - otherwise 434 /* core returns wct = 1, but we do not ask for core - otherwise
@@ -447,8 +447,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
447 (secFlags & CIFSSEC_MAY_PLNTXT)) 447 (secFlags & CIFSSEC_MAY_PLNTXT))
448 server->secType = LANMAN; 448 server->secType = LANMAN;
449 else { 449 else {
450 cERROR(1, "mount failed weak security disabled" 450 cifs_dbg(VFS, "mount failed weak security disabled in /proc/fs/cifs/SecurityFlags\n");
451 " in /proc/fs/cifs/SecurityFlags");
452 rc = -EOPNOTSUPP; 451 rc = -EOPNOTSUPP;
453 goto neg_err_exit; 452 goto neg_err_exit;
454 } 453 }
@@ -482,9 +481,9 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
482 utc = CURRENT_TIME; 481 utc = CURRENT_TIME;
483 ts = cnvrtDosUnixTm(rsp->SrvTime.Date, 482 ts = cnvrtDosUnixTm(rsp->SrvTime.Date,
484 rsp->SrvTime.Time, 0); 483 rsp->SrvTime.Time, 0);
485 cFYI(1, "SrvTime %d sec since 1970 (utc: %d) diff: %d", 484 cifs_dbg(FYI, "SrvTime %d sec since 1970 (utc: %d) diff: %d\n",
486 (int)ts.tv_sec, (int)utc.tv_sec, 485 (int)ts.tv_sec, (int)utc.tv_sec,
487 (int)(utc.tv_sec - ts.tv_sec)); 486 (int)(utc.tv_sec - ts.tv_sec));
488 val = (int)(utc.tv_sec - ts.tv_sec); 487 val = (int)(utc.tv_sec - ts.tv_sec);
489 seconds = abs(val); 488 seconds = abs(val);
490 result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ; 489 result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ;
@@ -498,7 +497,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
498 server->timeAdj = (int)tmp; 497 server->timeAdj = (int)tmp;
499 server->timeAdj *= 60; /* also in seconds */ 498 server->timeAdj *= 60; /* also in seconds */
500 } 499 }
501 cFYI(1, "server->timeAdj: %d seconds", server->timeAdj); 500 cifs_dbg(FYI, "server->timeAdj: %d seconds\n", server->timeAdj);
502 501
503 502
504 /* BB get server time for time conversions and add 503 /* BB get server time for time conversions and add
@@ -513,14 +512,13 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
513 goto neg_err_exit; 512 goto neg_err_exit;
514 } 513 }
515 514
516 cFYI(1, "LANMAN negotiated"); 515 cifs_dbg(FYI, "LANMAN negotiated\n");
517 /* we will not end up setting signing flags - as no signing 516 /* we will not end up setting signing flags - as no signing
518 was in LANMAN and server did not return the flags on */ 517 was in LANMAN and server did not return the flags on */
519 goto signing_check; 518 goto signing_check;
520#else /* weak security disabled */ 519#else /* weak security disabled */
521 } else if (pSMBr->hdr.WordCount == 13) { 520 } else if (pSMBr->hdr.WordCount == 13) {
522 cERROR(1, "mount failed, cifs module not built " 521 cifs_dbg(VFS, "mount failed, cifs module not built with CIFS_WEAK_PW_HASH support\n");
523 "with CIFS_WEAK_PW_HASH support");
524 rc = -EOPNOTSUPP; 522 rc = -EOPNOTSUPP;
525#endif /* WEAK_PW_HASH */ 523#endif /* WEAK_PW_HASH */
526 goto neg_err_exit; 524 goto neg_err_exit;
@@ -532,14 +530,13 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
532 /* else wct == 17 NTLM */ 530 /* else wct == 17 NTLM */
533 server->sec_mode = pSMBr->SecurityMode; 531 server->sec_mode = pSMBr->SecurityMode;
534 if ((server->sec_mode & SECMODE_USER) == 0) 532 if ((server->sec_mode & SECMODE_USER) == 0)
535 cFYI(1, "share mode security"); 533 cifs_dbg(FYI, "share mode security\n");
536 534
537 if ((server->sec_mode & SECMODE_PW_ENCRYPT) == 0) 535 if ((server->sec_mode & SECMODE_PW_ENCRYPT) == 0)
538#ifdef CONFIG_CIFS_WEAK_PW_HASH 536#ifdef CONFIG_CIFS_WEAK_PW_HASH
539 if ((secFlags & CIFSSEC_MAY_PLNTXT) == 0) 537 if ((secFlags & CIFSSEC_MAY_PLNTXT) == 0)
540#endif /* CIFS_WEAK_PW_HASH */ 538#endif /* CIFS_WEAK_PW_HASH */
541 cERROR(1, "Server requests plain text password" 539 cifs_dbg(VFS, "Server requests plain text password but client support disabled\n");
542 " but client support disabled");
543 540
544 if ((secFlags & CIFSSEC_MUST_NTLMV2) == CIFSSEC_MUST_NTLMV2) 541 if ((secFlags & CIFSSEC_MUST_NTLMV2) == CIFSSEC_MUST_NTLMV2)
545 server->secType = NTLMv2; 542 server->secType = NTLMv2;
@@ -555,7 +552,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
555 server->secType = LANMAN; 552 server->secType = LANMAN;
556 else { 553 else {
557 rc = -EOPNOTSUPP; 554 rc = -EOPNOTSUPP;
558 cERROR(1, "Invalid security type"); 555 cifs_dbg(VFS, "Invalid security type\n");
559 goto neg_err_exit; 556 goto neg_err_exit;
560 } 557 }
561 /* else ... any others ...? */ 558 /* else ... any others ...? */
@@ -568,7 +565,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
568 /* probably no need to store and check maxvcs */ 565 /* probably no need to store and check maxvcs */
569 server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize); 566 server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize);
570 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize); 567 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
571 cFYI(DBG2, "Max buf = %d", ses->server->maxBuf); 568 cifs_dbg(NOISY, "Max buf = %d\n", ses->server->maxBuf);
572 server->capabilities = le32_to_cpu(pSMBr->Capabilities); 569 server->capabilities = le32_to_cpu(pSMBr->Capabilities);
573 server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone); 570 server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone);
574 server->timeAdj *= 60; 571 server->timeAdj *= 60;
@@ -590,7 +587,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
590 if (memcmp(server->server_GUID, 587 if (memcmp(server->server_GUID,
591 pSMBr->u.extended_response. 588 pSMBr->u.extended_response.
592 GUID, 16) != 0) { 589 GUID, 16) != 0) {
593 cFYI(1, "server UID changed"); 590 cifs_dbg(FYI, "server UID changed\n");
594 memcpy(server->server_GUID, 591 memcpy(server->server_GUID,
595 pSMBr->u.extended_response.GUID, 592 pSMBr->u.extended_response.GUID,
596 16); 593 16);
@@ -633,21 +630,19 @@ signing_check:
633 if ((secFlags & CIFSSEC_MAY_SIGN) == 0) { 630 if ((secFlags & CIFSSEC_MAY_SIGN) == 0) {
634 /* MUST_SIGN already includes the MAY_SIGN FLAG 631 /* MUST_SIGN already includes the MAY_SIGN FLAG
635 so if this is zero it means that signing is disabled */ 632 so if this is zero it means that signing is disabled */
636 cFYI(1, "Signing disabled"); 633 cifs_dbg(FYI, "Signing disabled\n");
637 if (server->sec_mode & SECMODE_SIGN_REQUIRED) { 634 if (server->sec_mode & SECMODE_SIGN_REQUIRED) {
638 cERROR(1, "Server requires " 635 cifs_dbg(VFS, "Server requires packet signing to be enabled in /proc/fs/cifs/SecurityFlags\n");
639 "packet signing to be enabled in "
640 "/proc/fs/cifs/SecurityFlags.");
641 rc = -EOPNOTSUPP; 636 rc = -EOPNOTSUPP;
642 } 637 }
643 server->sec_mode &= 638 server->sec_mode &=
644 ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); 639 ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED);
645 } else if ((secFlags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { 640 } else if ((secFlags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) {
646 /* signing required */ 641 /* signing required */
647 cFYI(1, "Must sign - secFlags 0x%x", secFlags); 642 cifs_dbg(FYI, "Must sign - secFlags 0x%x\n", secFlags);
648 if ((server->sec_mode & 643 if ((server->sec_mode &
649 (SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED)) == 0) { 644 (SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED)) == 0) {
650 cERROR(1, "signing required but server lacks support"); 645 cifs_dbg(VFS, "signing required but server lacks support\n");
651 rc = -EOPNOTSUPP; 646 rc = -EOPNOTSUPP;
652 } else 647 } else
653 server->sec_mode |= SECMODE_SIGN_REQUIRED; 648 server->sec_mode |= SECMODE_SIGN_REQUIRED;
@@ -661,7 +656,7 @@ signing_check:
661neg_err_exit: 656neg_err_exit:
662 cifs_buf_release(pSMB); 657 cifs_buf_release(pSMB);
663 658
664 cFYI(1, "negprot rc %d", rc); 659 cifs_dbg(FYI, "negprot rc %d\n", rc);
665 return rc; 660 return rc;
666} 661}
667 662
@@ -671,7 +666,7 @@ CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon)
671 struct smb_hdr *smb_buffer; 666 struct smb_hdr *smb_buffer;
672 int rc = 0; 667 int rc = 0;
673 668
674 cFYI(1, "In tree disconnect"); 669 cifs_dbg(FYI, "In tree disconnect\n");
675 670
676 /* BB: do we need to check this? These should never be NULL. */ 671 /* BB: do we need to check this? These should never be NULL. */
677 if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) 672 if ((tcon->ses == NULL) || (tcon->ses->server == NULL))
@@ -693,7 +688,7 @@ CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon)
693 688
694 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)smb_buffer, 0); 689 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)smb_buffer, 0);
695 if (rc) 690 if (rc)
696 cFYI(1, "Tree disconnect failed %d", rc); 691 cifs_dbg(FYI, "Tree disconnect failed %d\n", rc);
697 692
698 /* No need to return error on this operation if tid invalidated and 693 /* No need to return error on this operation if tid invalidated and
699 closed on server already e.g. due to tcp session crashing */ 694 closed on server already e.g. due to tcp session crashing */
@@ -728,7 +723,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
728 struct smb_rqst rqst = { .rq_iov = &iov, 723 struct smb_rqst rqst = { .rq_iov = &iov,
729 .rq_nvec = 1 }; 724 .rq_nvec = 1 };
730 725
731 cFYI(1, "In echo request"); 726 cifs_dbg(FYI, "In echo request\n");
732 727
733 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb); 728 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb);
734 if (rc) 729 if (rc)
@@ -747,7 +742,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
747 rc = cifs_call_async(server, &rqst, NULL, cifs_echo_callback, 742 rc = cifs_call_async(server, &rqst, NULL, cifs_echo_callback,
748 server, CIFS_ASYNC_OP | CIFS_ECHO_OP); 743 server, CIFS_ASYNC_OP | CIFS_ECHO_OP);
749 if (rc) 744 if (rc)
750 cFYI(1, "Echo request failed: %d", rc); 745 cifs_dbg(FYI, "Echo request failed: %d\n", rc);
751 746
752 cifs_small_buf_release(smb); 747 cifs_small_buf_release(smb);
753 748
@@ -760,7 +755,7 @@ CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses)
760 LOGOFF_ANDX_REQ *pSMB; 755 LOGOFF_ANDX_REQ *pSMB;
761 int rc = 0; 756 int rc = 0;
762 757
763 cFYI(1, "In SMBLogoff for session disconnect"); 758 cifs_dbg(FYI, "In SMBLogoff for session disconnect\n");
764 759
765 /* 760 /*
766 * BB: do we need to check validity of ses and server? They should 761 * BB: do we need to check validity of ses and server? They should
@@ -814,7 +809,7 @@ CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
814 int bytes_returned = 0; 809 int bytes_returned = 0;
815 __u16 params, param_offset, offset, byte_count; 810 __u16 params, param_offset, offset, byte_count;
816 811
817 cFYI(1, "In POSIX delete"); 812 cifs_dbg(FYI, "In POSIX delete\n");
818PsxDelete: 813PsxDelete:
819 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 814 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
820 (void **) &pSMBr); 815 (void **) &pSMBr);
@@ -866,7 +861,7 @@ PsxDelete:
866 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 861 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
867 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 862 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
868 if (rc) 863 if (rc)
869 cFYI(1, "Posix delete returned %d", rc); 864 cifs_dbg(FYI, "Posix delete returned %d\n", rc);
870 cifs_buf_release(pSMB); 865 cifs_buf_release(pSMB);
871 866
872 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes); 867 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes);
@@ -914,7 +909,7 @@ DelFileRetry:
914 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 909 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
915 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes); 910 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes);
916 if (rc) 911 if (rc)
917 cFYI(1, "Error in RMFile = %d", rc); 912 cifs_dbg(FYI, "Error in RMFile = %d\n", rc);
918 913
919 cifs_buf_release(pSMB); 914 cifs_buf_release(pSMB);
920 if (rc == -EAGAIN) 915 if (rc == -EAGAIN)
@@ -934,7 +929,7 @@ CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
934 int name_len; 929 int name_len;
935 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 930 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
936 931
937 cFYI(1, "In CIFSSMBRmDir"); 932 cifs_dbg(FYI, "In CIFSSMBRmDir\n");
938RmDirRetry: 933RmDirRetry:
939 rc = smb_init(SMB_COM_DELETE_DIRECTORY, 0, tcon, (void **) &pSMB, 934 rc = smb_init(SMB_COM_DELETE_DIRECTORY, 0, tcon, (void **) &pSMB,
940 (void **) &pSMBr); 935 (void **) &pSMBr);
@@ -960,7 +955,7 @@ RmDirRetry:
960 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 955 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
961 cifs_stats_inc(&tcon->stats.cifs_stats.num_rmdirs); 956 cifs_stats_inc(&tcon->stats.cifs_stats.num_rmdirs);
962 if (rc) 957 if (rc)
963 cFYI(1, "Error in RMDir = %d", rc); 958 cifs_dbg(FYI, "Error in RMDir = %d\n", rc);
964 959
965 cifs_buf_release(pSMB); 960 cifs_buf_release(pSMB);
966 if (rc == -EAGAIN) 961 if (rc == -EAGAIN)
@@ -979,7 +974,7 @@ CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
979 int name_len; 974 int name_len;
980 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 975 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
981 976
982 cFYI(1, "In CIFSSMBMkDir"); 977 cifs_dbg(FYI, "In CIFSSMBMkDir\n");
983MkDirRetry: 978MkDirRetry:
984 rc = smb_init(SMB_COM_CREATE_DIRECTORY, 0, tcon, (void **) &pSMB, 979 rc = smb_init(SMB_COM_CREATE_DIRECTORY, 0, tcon, (void **) &pSMB,
985 (void **) &pSMBr); 980 (void **) &pSMBr);
@@ -1005,7 +1000,7 @@ MkDirRetry:
1005 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 1000 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
1006 cifs_stats_inc(&tcon->stats.cifs_stats.num_mkdirs); 1001 cifs_stats_inc(&tcon->stats.cifs_stats.num_mkdirs);
1007 if (rc) 1002 if (rc)
1008 cFYI(1, "Error in Mkdir = %d", rc); 1003 cifs_dbg(FYI, "Error in Mkdir = %d\n", rc);
1009 1004
1010 cifs_buf_release(pSMB); 1005 cifs_buf_release(pSMB);
1011 if (rc == -EAGAIN) 1006 if (rc == -EAGAIN)
@@ -1029,7 +1024,7 @@ CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
1029 OPEN_PSX_REQ *pdata; 1024 OPEN_PSX_REQ *pdata;
1030 OPEN_PSX_RSP *psx_rsp; 1025 OPEN_PSX_RSP *psx_rsp;
1031 1026
1032 cFYI(1, "In POSIX Create"); 1027 cifs_dbg(FYI, "In POSIX Create\n");
1033PsxCreat: 1028PsxCreat:
1034 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 1029 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
1035 (void **) &pSMBr); 1030 (void **) &pSMBr);
@@ -1083,11 +1078,11 @@ PsxCreat:
1083 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1078 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1084 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 1079 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
1085 if (rc) { 1080 if (rc) {
1086 cFYI(1, "Posix create returned %d", rc); 1081 cifs_dbg(FYI, "Posix create returned %d\n", rc);
1087 goto psx_create_err; 1082 goto psx_create_err;
1088 } 1083 }
1089 1084
1090 cFYI(1, "copying inode info"); 1085 cifs_dbg(FYI, "copying inode info\n");
1091 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 1086 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
1092 1087
1093 if (rc || get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP)) { 1088 if (rc || get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP)) {
@@ -1109,11 +1104,11 @@ PsxCreat:
1109 /* check to make sure response data is there */ 1104 /* check to make sure response data is there */
1110 if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) { 1105 if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) {
1111 pRetData->Type = cpu_to_le32(-1); /* unknown */ 1106 pRetData->Type = cpu_to_le32(-1); /* unknown */
1112 cFYI(DBG2, "unknown type"); 1107 cifs_dbg(NOISY, "unknown type\n");
1113 } else { 1108 } else {
1114 if (get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP) 1109 if (get_bcc(&pSMBr->hdr) < sizeof(OPEN_PSX_RSP)
1115 + sizeof(FILE_UNIX_BASIC_INFO)) { 1110 + sizeof(FILE_UNIX_BASIC_INFO)) {
1116 cERROR(1, "Open response data too small"); 1111 cifs_dbg(VFS, "Open response data too small\n");
1117 pRetData->Type = cpu_to_le32(-1); 1112 pRetData->Type = cpu_to_le32(-1);
1118 goto psx_create_err; 1113 goto psx_create_err;
1119 } 1114 }
@@ -1160,7 +1155,7 @@ static __u16 convert_disposition(int disposition)
1160 ofun = SMBOPEN_OCREATE | SMBOPEN_OTRUNC; 1155 ofun = SMBOPEN_OCREATE | SMBOPEN_OTRUNC;
1161 break; 1156 break;
1162 default: 1157 default:
1163 cFYI(1, "unknown disposition %d", disposition); 1158 cifs_dbg(FYI, "unknown disposition %d\n", disposition);
1164 ofun = SMBOPEN_OAPPEND; /* regular open */ 1159 ofun = SMBOPEN_OAPPEND; /* regular open */
1165 } 1160 }
1166 return ofun; 1161 return ofun;
@@ -1251,7 +1246,7 @@ OldOpenRetry:
1251 (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1246 (struct smb_hdr *)pSMBr, &bytes_returned, 0);
1252 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens); 1247 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
1253 if (rc) { 1248 if (rc) {
1254 cFYI(1, "Error in Open = %d", rc); 1249 cifs_dbg(FYI, "Error in Open = %d\n", rc);
1255 } else { 1250 } else {
1256 /* BB verify if wct == 15 */ 1251 /* BB verify if wct == 15 */
1257 1252
@@ -1364,7 +1359,7 @@ openRetry:
1364 (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1359 (struct smb_hdr *)pSMBr, &bytes_returned, 0);
1365 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens); 1360 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
1366 if (rc) { 1361 if (rc) {
1367 cFYI(1, "Error in Open = %d", rc); 1362 cifs_dbg(FYI, "Error in Open = %d\n", rc);
1368 } else { 1363 } else {
1369 *pOplock = pSMBr->OplockLevel; /* 1 byte no need to le_to_cpu */ 1364 *pOplock = pSMBr->OplockLevel; /* 1 byte no need to le_to_cpu */
1370 *netfid = pSMBr->Fid; /* cifs fid stays in le */ 1365 *netfid = pSMBr->Fid; /* cifs fid stays in le */
@@ -1425,8 +1420,8 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1425 char *buf = server->smallbuf; 1420 char *buf = server->smallbuf;
1426 unsigned int buflen = get_rfc1002_length(buf) + 4; 1421 unsigned int buflen = get_rfc1002_length(buf) + 4;
1427 1422
1428 cFYI(1, "%s: mid=%llu offset=%llu bytes=%u", __func__, 1423 cifs_dbg(FYI, "%s: mid=%llu offset=%llu bytes=%u\n",
1429 mid->mid, rdata->offset, rdata->bytes); 1424 __func__, mid->mid, rdata->offset, rdata->bytes);
1430 1425
1431 /* 1426 /*
1432 * read the rest of READ_RSP header (sans Data array), or whatever we 1427 * read the rest of READ_RSP header (sans Data array), or whatever we
@@ -1447,16 +1442,16 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1447 /* Was the SMB read successful? */ 1442 /* Was the SMB read successful? */
1448 rdata->result = server->ops->map_error(buf, false); 1443 rdata->result = server->ops->map_error(buf, false);
1449 if (rdata->result != 0) { 1444 if (rdata->result != 0) {
1450 cFYI(1, "%s: server returned error %d", __func__, 1445 cifs_dbg(FYI, "%s: server returned error %d\n",
1451 rdata->result); 1446 __func__, rdata->result);
1452 return cifs_readv_discard(server, mid); 1447 return cifs_readv_discard(server, mid);
1453 } 1448 }
1454 1449
1455 /* Is there enough to get to the rest of the READ_RSP header? */ 1450 /* Is there enough to get to the rest of the READ_RSP header? */
1456 if (server->total_read < server->vals->read_rsp_size) { 1451 if (server->total_read < server->vals->read_rsp_size) {
1457 cFYI(1, "%s: server returned short header. got=%u expected=%zu", 1452 cifs_dbg(FYI, "%s: server returned short header. got=%u expected=%zu\n",
1458 __func__, server->total_read, 1453 __func__, server->total_read,
1459 server->vals->read_rsp_size); 1454 server->vals->read_rsp_size);
1460 rdata->result = -EIO; 1455 rdata->result = -EIO;
1461 return cifs_readv_discard(server, mid); 1456 return cifs_readv_discard(server, mid);
1462 } 1457 }
@@ -1468,19 +1463,19 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1468 * is beyond the EOF. Treat it as if the data starts just after 1463 * is beyond the EOF. Treat it as if the data starts just after
1469 * the header. 1464 * the header.
1470 */ 1465 */
1471 cFYI(1, "%s: data offset (%u) inside read response header", 1466 cifs_dbg(FYI, "%s: data offset (%u) inside read response header\n",
1472 __func__, data_offset); 1467 __func__, data_offset);
1473 data_offset = server->total_read; 1468 data_offset = server->total_read;
1474 } else if (data_offset > MAX_CIFS_SMALL_BUFFER_SIZE) { 1469 } else if (data_offset > MAX_CIFS_SMALL_BUFFER_SIZE) {
1475 /* data_offset is beyond the end of smallbuf */ 1470 /* data_offset is beyond the end of smallbuf */
1476 cFYI(1, "%s: data offset (%u) beyond end of smallbuf", 1471 cifs_dbg(FYI, "%s: data offset (%u) beyond end of smallbuf\n",
1477 __func__, data_offset); 1472 __func__, data_offset);
1478 rdata->result = -EIO; 1473 rdata->result = -EIO;
1479 return cifs_readv_discard(server, mid); 1474 return cifs_readv_discard(server, mid);
1480 } 1475 }
1481 1476
1482 cFYI(1, "%s: total_read=%u data_offset=%u", __func__, 1477 cifs_dbg(FYI, "%s: total_read=%u data_offset=%u\n",
1483 server->total_read, data_offset); 1478 __func__, server->total_read, data_offset);
1484 1479
1485 len = data_offset - server->total_read; 1480 len = data_offset - server->total_read;
1486 if (len > 0) { 1481 if (len > 0) {
@@ -1496,8 +1491,8 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1496 /* set up first iov for signature check */ 1491 /* set up first iov for signature check */
1497 rdata->iov.iov_base = buf; 1492 rdata->iov.iov_base = buf;
1498 rdata->iov.iov_len = server->total_read; 1493 rdata->iov.iov_len = server->total_read;
1499 cFYI(1, "0: iov_base=%p iov_len=%zu", 1494 cifs_dbg(FYI, "0: iov_base=%p iov_len=%zu\n",
1500 rdata->iov.iov_base, rdata->iov.iov_len); 1495 rdata->iov.iov_base, rdata->iov.iov_len);
1501 1496
1502 /* how much data is in the response? */ 1497 /* how much data is in the response? */
1503 data_len = server->ops->read_data_length(buf); 1498 data_len = server->ops->read_data_length(buf);
@@ -1514,8 +1509,8 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1514 server->total_read += length; 1509 server->total_read += length;
1515 rdata->bytes = length; 1510 rdata->bytes = length;
1516 1511
1517 cFYI(1, "total_read=%u buflen=%u remaining=%u", server->total_read, 1512 cifs_dbg(FYI, "total_read=%u buflen=%u remaining=%u\n",
1518 buflen, data_len); 1513 server->total_read, buflen, data_len);
1519 1514
1520 /* discard anything left over */ 1515 /* discard anything left over */
1521 if (server->total_read < buflen) 1516 if (server->total_read < buflen)
@@ -1538,8 +1533,9 @@ cifs_readv_callback(struct mid_q_entry *mid)
1538 .rq_pagesz = rdata->pagesz, 1533 .rq_pagesz = rdata->pagesz,
1539 .rq_tailsz = rdata->tailsz }; 1534 .rq_tailsz = rdata->tailsz };
1540 1535
1541 cFYI(1, "%s: mid=%llu state=%d result=%d bytes=%u", __func__, 1536 cifs_dbg(FYI, "%s: mid=%llu state=%d result=%d bytes=%u\n",
1542 mid->mid, mid->mid_state, rdata->result, rdata->bytes); 1537 __func__, mid->mid, mid->mid_state, rdata->result,
1538 rdata->bytes);
1543 1539
1544 switch (mid->mid_state) { 1540 switch (mid->mid_state) {
1545 case MID_RESPONSE_RECEIVED: 1541 case MID_RESPONSE_RECEIVED:
@@ -1551,8 +1547,8 @@ cifs_readv_callback(struct mid_q_entry *mid)
1551 rc = cifs_verify_signature(&rqst, server, 1547 rc = cifs_verify_signature(&rqst, server,
1552 mid->sequence_number + 1); 1548 mid->sequence_number + 1);
1553 if (rc) 1549 if (rc)
1554 cERROR(1, "SMB signature verification returned " 1550 cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
1555 "error = %d", rc); 1551 rc);
1556 } 1552 }
1557 /* FIXME: should this be counted toward the initiating task? */ 1553 /* FIXME: should this be counted toward the initiating task? */
1558 task_io_account_read(rdata->bytes); 1554 task_io_account_read(rdata->bytes);
@@ -1582,8 +1578,8 @@ cifs_async_readv(struct cifs_readdata *rdata)
1582 struct smb_rqst rqst = { .rq_iov = &rdata->iov, 1578 struct smb_rqst rqst = { .rq_iov = &rdata->iov,
1583 .rq_nvec = 1 }; 1579 .rq_nvec = 1 };
1584 1580
1585 cFYI(1, "%s: offset=%llu bytes=%u", __func__, 1581 cifs_dbg(FYI, "%s: offset=%llu bytes=%u\n",
1586 rdata->offset, rdata->bytes); 1582 __func__, rdata->offset, rdata->bytes);
1587 1583
1588 if (tcon->ses->capabilities & CAP_LARGE_FILES) 1584 if (tcon->ses->capabilities & CAP_LARGE_FILES)
1589 wct = 12; 1585 wct = 12;
@@ -1653,7 +1649,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1653 struct cifs_tcon *tcon = io_parms->tcon; 1649 struct cifs_tcon *tcon = io_parms->tcon;
1654 unsigned int count = io_parms->length; 1650 unsigned int count = io_parms->length;
1655 1651
1656 cFYI(1, "Reading %d bytes on fid %d", count, netfid); 1652 cifs_dbg(FYI, "Reading %d bytes on fid %d\n", count, netfid);
1657 if (tcon->ses->capabilities & CAP_LARGE_FILES) 1653 if (tcon->ses->capabilities & CAP_LARGE_FILES)
1658 wct = 12; 1654 wct = 12;
1659 else { 1655 else {
@@ -1701,7 +1697,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1701 cifs_stats_inc(&tcon->stats.cifs_stats.num_reads); 1697 cifs_stats_inc(&tcon->stats.cifs_stats.num_reads);
1702 pSMBr = (READ_RSP *)iov[0].iov_base; 1698 pSMBr = (READ_RSP *)iov[0].iov_base;
1703 if (rc) { 1699 if (rc) {
1704 cERROR(1, "Send error in read = %d", rc); 1700 cifs_dbg(VFS, "Send error in read = %d\n", rc);
1705 } else { 1701 } else {
1706 int data_length = le16_to_cpu(pSMBr->DataLengthHigh); 1702 int data_length = le16_to_cpu(pSMBr->DataLengthHigh);
1707 data_length = data_length << 16; 1703 data_length = data_length << 16;
@@ -1711,7 +1707,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1711 /*check that DataLength would not go beyond end of SMB */ 1707 /*check that DataLength would not go beyond end of SMB */
1712 if ((data_length > CIFSMaxBufSize) 1708 if ((data_length > CIFSMaxBufSize)
1713 || (data_length > count)) { 1709 || (data_length > count)) {
1714 cFYI(1, "bad length %d for count %d", 1710 cifs_dbg(FYI, "bad length %d for count %d\n",
1715 data_length, count); 1711 data_length, count);
1716 rc = -EIO; 1712 rc = -EIO;
1717 *nbytes = 0; 1713 *nbytes = 0;
@@ -1719,7 +1715,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1719 pReadData = (char *) (&pSMBr->hdr.Protocol) + 1715 pReadData = (char *) (&pSMBr->hdr.Protocol) +
1720 le16_to_cpu(pSMBr->DataOffset); 1716 le16_to_cpu(pSMBr->DataOffset);
1721/* if (rc = copy_to_user(buf, pReadData, data_length)) { 1717/* if (rc = copy_to_user(buf, pReadData, data_length)) {
1722 cERROR(1, "Faulting on read rc = %d",rc); 1718 cifs_dbg(VFS, "Faulting on read rc = %d\n",rc);
1723 rc = -EFAULT; 1719 rc = -EFAULT;
1724 }*/ /* can not use copy_to_user when using page cache*/ 1720 }*/ /* can not use copy_to_user when using page cache*/
1725 if (*buf) 1721 if (*buf)
@@ -1767,7 +1763,7 @@ CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
1767 1763
1768 *nbytes = 0; 1764 *nbytes = 0;
1769 1765
1770 /* cFYI(1, "write at %lld %d bytes", offset, count);*/ 1766 /* cifs_dbg(FYI, "write at %lld %d bytes\n", offset, count);*/
1771 if (tcon->ses == NULL) 1767 if (tcon->ses == NULL)
1772 return -ECONNABORTED; 1768 return -ECONNABORTED;
1773 1769
@@ -1852,7 +1848,7 @@ CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
1852 (struct smb_hdr *) pSMBr, &bytes_returned, long_op); 1848 (struct smb_hdr *) pSMBr, &bytes_returned, long_op);
1853 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes); 1849 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
1854 if (rc) { 1850 if (rc) {
1855 cFYI(1, "Send error in write = %d", rc); 1851 cifs_dbg(FYI, "Send error in write = %d\n", rc);
1856 } else { 1852 } else {
1857 *nbytes = le16_to_cpu(pSMBr->CountHigh); 1853 *nbytes = le16_to_cpu(pSMBr->CountHigh);
1858 *nbytes = (*nbytes) << 16; 1854 *nbytes = (*nbytes) << 16;
@@ -1959,7 +1955,7 @@ cifs_writedata_alloc(unsigned int nr_pages, work_func_t complete)
1959 1955
1960 /* this would overflow */ 1956 /* this would overflow */
1961 if (nr_pages == 0) { 1957 if (nr_pages == 0) {
1962 cERROR(1, "%s: called with nr_pages == 0!", __func__); 1958 cifs_dbg(VFS, "%s: called with nr_pages == 0!\n", __func__);
1963 return NULL; 1959 return NULL;
1964 } 1960 }
1965 1961
@@ -2075,7 +2071,8 @@ cifs_async_writev(struct cifs_writedata *wdata)
2075 rqst.rq_pagesz = wdata->pagesz; 2071 rqst.rq_pagesz = wdata->pagesz;
2076 rqst.rq_tailsz = wdata->tailsz; 2072 rqst.rq_tailsz = wdata->tailsz;
2077 2073
2078 cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); 2074 cifs_dbg(FYI, "async write at %llu %u bytes\n",
2075 wdata->offset, wdata->bytes);
2079 2076
2080 smb->DataLengthLow = cpu_to_le16(wdata->bytes & 0xFFFF); 2077 smb->DataLengthLow = cpu_to_le16(wdata->bytes & 0xFFFF);
2081 smb->DataLengthHigh = cpu_to_le16(wdata->bytes >> 16); 2078 smb->DataLengthHigh = cpu_to_le16(wdata->bytes >> 16);
@@ -2123,7 +2120,7 @@ CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
2123 2120
2124 *nbytes = 0; 2121 *nbytes = 0;
2125 2122
2126 cFYI(1, "write2 at %lld %d bytes", (long long)offset, count); 2123 cifs_dbg(FYI, "write2 at %lld %d bytes\n", (long long)offset, count);
2127 2124
2128 if (tcon->ses->capabilities & CAP_LARGE_FILES) { 2125 if (tcon->ses->capabilities & CAP_LARGE_FILES) {
2129 wct = 14; 2126 wct = 14;
@@ -2182,7 +2179,7 @@ CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
2182 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type, 0); 2179 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type, 0);
2183 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes); 2180 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
2184 if (rc) { 2181 if (rc) {
2185 cFYI(1, "Send error Write2 = %d", rc); 2182 cifs_dbg(FYI, "Send error Write2 = %d\n", rc);
2186 } else if (resp_buf_type == 0) { 2183 } else if (resp_buf_type == 0) {
2187 /* presumably this can not happen, but best to be safe */ 2184 /* presumably this can not happen, but best to be safe */
2188 rc = -EIO; 2185 rc = -EIO;
@@ -2223,7 +2220,8 @@ int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2223 int resp_buf_type; 2220 int resp_buf_type;
2224 __u16 count; 2221 __u16 count;
2225 2222
2226 cFYI(1, "cifs_lockv num lock %d num unlock %d", num_lock, num_unlock); 2223 cifs_dbg(FYI, "cifs_lockv num lock %d num unlock %d\n",
2224 num_lock, num_unlock);
2227 2225
2228 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); 2226 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB);
2229 if (rc) 2227 if (rc)
@@ -2249,7 +2247,7 @@ int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2249 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); 2247 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2250 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); 2248 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP);
2251 if (rc) 2249 if (rc)
2252 cFYI(1, "Send error in cifs_lockv = %d", rc); 2250 cifs_dbg(FYI, "Send error in cifs_lockv = %d\n", rc);
2253 2251
2254 return rc; 2252 return rc;
2255} 2253}
@@ -2268,7 +2266,8 @@ CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
2268 int flags = 0; 2266 int flags = 0;
2269 __u16 count; 2267 __u16 count;
2270 2268
2271 cFYI(1, "CIFSSMBLock timeout %d numLock %d", (int)waitFlag, numLock); 2269 cifs_dbg(FYI, "CIFSSMBLock timeout %d numLock %d\n",
2270 (int)waitFlag, numLock);
2272 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); 2271 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB);
2273 2272
2274 if (rc) 2273 if (rc)
@@ -2317,7 +2316,7 @@ CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
2317 } 2316 }
2318 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); 2317 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2319 if (rc) 2318 if (rc)
2320 cFYI(1, "Send error in Lock = %d", rc); 2319 cifs_dbg(FYI, "Send error in Lock = %d\n", rc);
2321 2320
2322 /* Note: On -EAGAIN error only caller can retry on handle based calls 2321 /* Note: On -EAGAIN error only caller can retry on handle based calls
2323 since file handle passed in no longer valid */ 2322 since file handle passed in no longer valid */
@@ -2341,7 +2340,7 @@ CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
2341 __u16 params, param_offset, offset, byte_count, count; 2340 __u16 params, param_offset, offset, byte_count, count;
2342 struct kvec iov[1]; 2341 struct kvec iov[1];
2343 2342
2344 cFYI(1, "Posix Lock"); 2343 cifs_dbg(FYI, "Posix Lock\n");
2345 2344
2346 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 2345 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
2347 2346
@@ -2408,7 +2407,7 @@ CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
2408 } 2407 }
2409 2408
2410 if (rc) { 2409 if (rc) {
2411 cFYI(1, "Send error in Posix Lock = %d", rc); 2410 cifs_dbg(FYI, "Send error in Posix Lock = %d\n", rc);
2412 } else if (pLockData) { 2411 } else if (pLockData) {
2413 /* lock structure can be returned on get */ 2412 /* lock structure can be returned on get */
2414 __u16 data_offset; 2413 __u16 data_offset;
@@ -2465,7 +2464,7 @@ CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2465{ 2464{
2466 int rc = 0; 2465 int rc = 0;
2467 CLOSE_REQ *pSMB = NULL; 2466 CLOSE_REQ *pSMB = NULL;
2468 cFYI(1, "In CIFSSMBClose"); 2467 cifs_dbg(FYI, "In CIFSSMBClose\n");
2469 2468
2470/* do not retry on dead session on close */ 2469/* do not retry on dead session on close */
2471 rc = small_smb_init(SMB_COM_CLOSE, 3, tcon, (void **) &pSMB); 2470 rc = small_smb_init(SMB_COM_CLOSE, 3, tcon, (void **) &pSMB);
@@ -2482,7 +2481,7 @@ CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2482 if (rc) { 2481 if (rc) {
2483 if (rc != -EINTR) { 2482 if (rc != -EINTR) {
2484 /* EINTR is expected when user ctl-c to kill app */ 2483 /* EINTR is expected when user ctl-c to kill app */
2485 cERROR(1, "Send error in Close = %d", rc); 2484 cifs_dbg(VFS, "Send error in Close = %d\n", rc);
2486 } 2485 }
2487 } 2486 }
2488 2487
@@ -2498,7 +2497,7 @@ CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2498{ 2497{
2499 int rc = 0; 2498 int rc = 0;
2500 FLUSH_REQ *pSMB = NULL; 2499 FLUSH_REQ *pSMB = NULL;
2501 cFYI(1, "In CIFSSMBFlush"); 2500 cifs_dbg(FYI, "In CIFSSMBFlush\n");
2502 2501
2503 rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB); 2502 rc = small_smb_init(SMB_COM_FLUSH, 1, tcon, (void **) &pSMB);
2504 if (rc) 2503 if (rc)
@@ -2509,7 +2508,7 @@ CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2509 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 2508 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
2510 cifs_stats_inc(&tcon->stats.cifs_stats.num_flushes); 2509 cifs_stats_inc(&tcon->stats.cifs_stats.num_flushes);
2511 if (rc) 2510 if (rc)
2512 cERROR(1, "Send error in Flush = %d", rc); 2511 cifs_dbg(VFS, "Send error in Flush = %d\n", rc);
2513 2512
2514 return rc; 2513 return rc;
2515} 2514}
@@ -2527,7 +2526,7 @@ CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
2527 __u16 count; 2526 __u16 count;
2528 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 2527 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
2529 2528
2530 cFYI(1, "In CIFSSMBRename"); 2529 cifs_dbg(FYI, "In CIFSSMBRename\n");
2531renameRetry: 2530renameRetry:
2532 rc = smb_init(SMB_COM_RENAME, 1, tcon, (void **) &pSMB, 2531 rc = smb_init(SMB_COM_RENAME, 1, tcon, (void **) &pSMB,
2533 (void **) &pSMBr); 2532 (void **) &pSMBr);
@@ -2574,7 +2573,7 @@ renameRetry:
2574 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2573 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2575 cifs_stats_inc(&tcon->stats.cifs_stats.num_renames); 2574 cifs_stats_inc(&tcon->stats.cifs_stats.num_renames);
2576 if (rc) 2575 if (rc)
2577 cFYI(1, "Send error in rename = %d", rc); 2576 cifs_dbg(FYI, "Send error in rename = %d\n", rc);
2578 2577
2579 cifs_buf_release(pSMB); 2578 cifs_buf_release(pSMB);
2580 2579
@@ -2598,7 +2597,7 @@ int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
2598 int len_of_str; 2597 int len_of_str;
2599 __u16 params, param_offset, offset, count, byte_count; 2598 __u16 params, param_offset, offset, count, byte_count;
2600 2599
2601 cFYI(1, "Rename to File by handle"); 2600 cifs_dbg(FYI, "Rename to File by handle\n");
2602 rc = smb_init(SMB_COM_TRANSACTION2, 15, pTcon, (void **) &pSMB, 2601 rc = smb_init(SMB_COM_TRANSACTION2, 15, pTcon, (void **) &pSMB,
2603 (void **) &pSMBr); 2602 (void **) &pSMBr);
2604 if (rc) 2603 if (rc)
@@ -2655,7 +2654,8 @@ int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
2655 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2654 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2656 cifs_stats_inc(&pTcon->stats.cifs_stats.num_t2renames); 2655 cifs_stats_inc(&pTcon->stats.cifs_stats.num_t2renames);
2657 if (rc) 2656 if (rc)
2658 cFYI(1, "Send error in Rename (by file handle) = %d", rc); 2657 cifs_dbg(FYI, "Send error in Rename (by file handle) = %d\n",
2658 rc);
2659 2659
2660 cifs_buf_release(pSMB); 2660 cifs_buf_release(pSMB);
2661 2661
@@ -2677,7 +2677,7 @@ CIFSSMBCopy(const unsigned int xid, struct cifs_tcon *tcon,
2677 int name_len, name_len2; 2677 int name_len, name_len2;
2678 __u16 count; 2678 __u16 count;
2679 2679
2680 cFYI(1, "In CIFSSMBCopy"); 2680 cifs_dbg(FYI, "In CIFSSMBCopy\n");
2681copyRetry: 2681copyRetry:
2682 rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB, 2682 rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB,
2683 (void **) &pSMBr); 2683 (void **) &pSMBr);
@@ -2722,8 +2722,8 @@ copyRetry:
2722 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2722 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2723 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2723 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2724 if (rc) { 2724 if (rc) {
2725 cFYI(1, "Send error in copy = %d with %d files copied", 2725 cifs_dbg(FYI, "Send error in copy = %d with %d files copied\n",
2726 rc, le16_to_cpu(pSMBr->CopyCount)); 2726 rc, le16_to_cpu(pSMBr->CopyCount));
2727 } 2727 }
2728 cifs_buf_release(pSMB); 2728 cifs_buf_release(pSMB);
2729 2729
@@ -2747,7 +2747,7 @@ CIFSUnixCreateSymLink(const unsigned int xid, struct cifs_tcon *tcon,
2747 int bytes_returned = 0; 2747 int bytes_returned = 0;
2748 __u16 params, param_offset, offset, byte_count; 2748 __u16 params, param_offset, offset, byte_count;
2749 2749
2750 cFYI(1, "In Symlink Unix style"); 2750 cifs_dbg(FYI, "In Symlink Unix style\n");
2751createSymLinkRetry: 2751createSymLinkRetry:
2752 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 2752 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
2753 (void **) &pSMBr); 2753 (void **) &pSMBr);
@@ -2812,7 +2812,8 @@ createSymLinkRetry:
2812 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2812 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2813 cifs_stats_inc(&tcon->stats.cifs_stats.num_symlinks); 2813 cifs_stats_inc(&tcon->stats.cifs_stats.num_symlinks);
2814 if (rc) 2814 if (rc)
2815 cFYI(1, "Send error in SetPathInfo create symlink = %d", rc); 2815 cifs_dbg(FYI, "Send error in SetPathInfo create symlink = %d\n",
2816 rc);
2816 2817
2817 cifs_buf_release(pSMB); 2818 cifs_buf_release(pSMB);
2818 2819
@@ -2836,7 +2837,7 @@ CIFSUnixCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2836 int bytes_returned = 0; 2837 int bytes_returned = 0;
2837 __u16 params, param_offset, offset, byte_count; 2838 __u16 params, param_offset, offset, byte_count;
2838 2839
2839 cFYI(1, "In Create Hard link Unix style"); 2840 cifs_dbg(FYI, "In Create Hard link Unix style\n");
2840createHardLinkRetry: 2841createHardLinkRetry:
2841 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 2842 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
2842 (void **) &pSMBr); 2843 (void **) &pSMBr);
@@ -2898,7 +2899,8 @@ createHardLinkRetry:
2898 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2899 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2899 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks); 2900 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks);
2900 if (rc) 2901 if (rc)
2901 cFYI(1, "Send error in SetPathInfo (hard link) = %d", rc); 2902 cifs_dbg(FYI, "Send error in SetPathInfo (hard link) = %d\n",
2903 rc);
2902 2904
2903 cifs_buf_release(pSMB); 2905 cifs_buf_release(pSMB);
2904 if (rc == -EAGAIN) 2906 if (rc == -EAGAIN)
@@ -2920,7 +2922,7 @@ CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2920 __u16 count; 2922 __u16 count;
2921 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; 2923 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
2922 2924
2923 cFYI(1, "In CIFSCreateHardLink"); 2925 cifs_dbg(FYI, "In CIFSCreateHardLink\n");
2924winCreateHardLinkRetry: 2926winCreateHardLinkRetry:
2925 2927
2926 rc = smb_init(SMB_COM_NT_RENAME, 4, tcon, (void **) &pSMB, 2928 rc = smb_init(SMB_COM_NT_RENAME, 4, tcon, (void **) &pSMB,
@@ -2972,7 +2974,7 @@ winCreateHardLinkRetry:
2972 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2974 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2973 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks); 2975 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks);
2974 if (rc) 2976 if (rc)
2975 cFYI(1, "Send error in hard link (NT rename) = %d", rc); 2977 cifs_dbg(FYI, "Send error in hard link (NT rename) = %d\n", rc);
2976 2978
2977 cifs_buf_release(pSMB); 2979 cifs_buf_release(pSMB);
2978 if (rc == -EAGAIN) 2980 if (rc == -EAGAIN)
@@ -2995,7 +2997,7 @@ CIFSSMBUnixQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,
2995 __u16 params, byte_count; 2997 __u16 params, byte_count;
2996 char *data_start; 2998 char *data_start;
2997 2999
2998 cFYI(1, "In QPathSymLinkInfo (Unix) for path %s", searchName); 3000 cifs_dbg(FYI, "In QPathSymLinkInfo (Unix) for path %s\n", searchName);
2999 3001
3000querySymLinkRetry: 3002querySymLinkRetry:
3001 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3003 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -3042,7 +3044,7 @@ querySymLinkRetry:
3042 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3044 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3043 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3045 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3044 if (rc) { 3046 if (rc) {
3045 cFYI(1, "Send error in QuerySymLinkInfo = %d", rc); 3047 cifs_dbg(FYI, "Send error in QuerySymLinkInfo = %d\n", rc);
3046 } else { 3048 } else {
3047 /* decode response */ 3049 /* decode response */
3048 3050
@@ -3097,7 +3099,8 @@ CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3097 struct smb_com_transaction_ioctl_req *pSMB; 3099 struct smb_com_transaction_ioctl_req *pSMB;
3098 struct smb_com_transaction_ioctl_rsp *pSMBr; 3100 struct smb_com_transaction_ioctl_rsp *pSMBr;
3099 3101
3100 cFYI(1, "In Windows reparse style QueryLink for path %s", searchName); 3102 cifs_dbg(FYI, "In Windows reparse style QueryLink for path %s\n",
3103 searchName);
3101 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, 3104 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB,
3102 (void **) &pSMBr); 3105 (void **) &pSMBr);
3103 if (rc) 3106 if (rc)
@@ -3125,7 +3128,7 @@ CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3125 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3128 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3126 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3129 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3127 if (rc) { 3130 if (rc) {
3128 cFYI(1, "Send error in QueryReparseLinkInfo = %d", rc); 3131 cifs_dbg(FYI, "Send error in QueryReparseLinkInfo = %d\n", rc);
3129 } else { /* decode response */ 3132 } else { /* decode response */
3130 __u32 data_offset = le32_to_cpu(pSMBr->DataOffset); 3133 __u32 data_offset = le32_to_cpu(pSMBr->DataOffset);
3131 __u32 data_count = le32_to_cpu(pSMBr->DataCount); 3134 __u32 data_count = le32_to_cpu(pSMBr->DataCount);
@@ -3149,7 +3152,7 @@ CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3149 if ((reparse_buf->LinkNamesBuf + 3152 if ((reparse_buf->LinkNamesBuf +
3150 reparse_buf->TargetNameOffset + 3153 reparse_buf->TargetNameOffset +
3151 reparse_buf->TargetNameLen) > end_of_smb) { 3154 reparse_buf->TargetNameLen) > end_of_smb) {
3152 cFYI(1, "reparse buf beyond SMB"); 3155 cifs_dbg(FYI, "reparse buf beyond SMB\n");
3153 rc = -EIO; 3156 rc = -EIO;
3154 goto qreparse_out; 3157 goto qreparse_out;
3155 } 3158 }
@@ -3170,12 +3173,11 @@ CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3170 } 3173 }
3171 } else { 3174 } else {
3172 rc = -EIO; 3175 rc = -EIO;
3173 cFYI(1, "Invalid return data count on " 3176 cifs_dbg(FYI, "Invalid return data count on get reparse info ioctl\n");
3174 "get reparse info ioctl");
3175 } 3177 }
3176 symlinkinfo[buflen] = 0; /* just in case so the caller 3178 symlinkinfo[buflen] = 0; /* just in case so the caller
3177 does not go off the end of the buffer */ 3179 does not go off the end of the buffer */
3178 cFYI(1, "readlink result - %s", symlinkinfo); 3180 cifs_dbg(FYI, "readlink result - %s\n", symlinkinfo);
3179 } 3181 }
3180 3182
3181qreparse_out: 3183qreparse_out:
@@ -3198,7 +3200,10 @@ static void cifs_convert_ace(posix_acl_xattr_entry *ace,
3198 ace->e_perm = cpu_to_le16(cifs_ace->cifs_e_perm); 3200 ace->e_perm = cpu_to_le16(cifs_ace->cifs_e_perm);
3199 ace->e_tag = cpu_to_le16(cifs_ace->cifs_e_tag); 3201 ace->e_tag = cpu_to_le16(cifs_ace->cifs_e_tag);
3200 ace->e_id = cpu_to_le32(le64_to_cpu(cifs_ace->cifs_uid)); 3202 ace->e_id = cpu_to_le32(le64_to_cpu(cifs_ace->cifs_uid));
3201 /* cFYI(1, "perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id); */ 3203/*
3204 cifs_dbg(FYI, "perm %d tag %d id %d\n",
3205 ace->e_perm, ace->e_tag, ace->e_id);
3206*/
3202 3207
3203 return; 3208 return;
3204} 3209}
@@ -3224,8 +3229,8 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen,
3224 size += sizeof(struct cifs_posix_ace) * count; 3229 size += sizeof(struct cifs_posix_ace) * count;
3225 /* check if we would go beyond end of SMB */ 3230 /* check if we would go beyond end of SMB */
3226 if (size_of_data_area < size) { 3231 if (size_of_data_area < size) {
3227 cFYI(1, "bad CIFS POSIX ACL size %d vs. %d", 3232 cifs_dbg(FYI, "bad CIFS POSIX ACL size %d vs. %d\n",
3228 size_of_data_area, size); 3233 size_of_data_area, size);
3229 return -EINVAL; 3234 return -EINVAL;
3230 } 3235 }
3231 } else if (acl_type & ACL_TYPE_DEFAULT) { 3236 } else if (acl_type & ACL_TYPE_DEFAULT) {
@@ -3272,7 +3277,10 @@ static __u16 convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace,
3272 cifs_ace->cifs_uid = cpu_to_le64(-1); 3277 cifs_ace->cifs_uid = cpu_to_le64(-1);
3273 } else 3278 } else
3274 cifs_ace->cifs_uid = cpu_to_le64(le32_to_cpu(local_ace->e_id)); 3279 cifs_ace->cifs_uid = cpu_to_le64(le32_to_cpu(local_ace->e_id));
3275 /*cFYI(1, "perm %d tag %d id %d",ace->e_perm,ace->e_tag,ace->e_id);*/ 3280/*
3281 cifs_dbg(FYI, "perm %d tag %d id %d\n",
3282 ace->e_perm, ace->e_tag, ace->e_id);
3283*/
3276 return rc; 3284 return rc;
3277} 3285}
3278 3286
@@ -3290,12 +3298,11 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
3290 return 0; 3298 return 0;
3291 3299
3292 count = posix_acl_xattr_count((size_t)buflen); 3300 count = posix_acl_xattr_count((size_t)buflen);
3293 cFYI(1, "setting acl with %d entries from buf of length %d and " 3301 cifs_dbg(FYI, "setting acl with %d entries from buf of length %d and version of %d\n",
3294 "version of %d", 3302 count, buflen, le32_to_cpu(local_acl->a_version));
3295 count, buflen, le32_to_cpu(local_acl->a_version));
3296 if (le32_to_cpu(local_acl->a_version) != 2) { 3303 if (le32_to_cpu(local_acl->a_version) != 2) {
3297 cFYI(1, "unknown POSIX ACL version %d", 3304 cifs_dbg(FYI, "unknown POSIX ACL version %d\n",
3298 le32_to_cpu(local_acl->a_version)); 3305 le32_to_cpu(local_acl->a_version));
3299 return 0; 3306 return 0;
3300 } 3307 }
3301 cifs_acl->version = cpu_to_le16(1); 3308 cifs_acl->version = cpu_to_le16(1);
@@ -3304,7 +3311,7 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
3304 else if (acl_type == ACL_TYPE_DEFAULT) 3311 else if (acl_type == ACL_TYPE_DEFAULT)
3305 cifs_acl->default_entry_count = cpu_to_le16(count); 3312 cifs_acl->default_entry_count = cpu_to_le16(count);
3306 else { 3313 else {
3307 cFYI(1, "unknown ACL type %d", acl_type); 3314 cifs_dbg(FYI, "unknown ACL type %d\n", acl_type);
3308 return 0; 3315 return 0;
3309 } 3316 }
3310 for (i = 0; i < count; i++) { 3317 for (i = 0; i < count; i++) {
@@ -3337,7 +3344,7 @@ CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
3337 int name_len; 3344 int name_len;
3338 __u16 params, byte_count; 3345 __u16 params, byte_count;
3339 3346
3340 cFYI(1, "In GetPosixACL (Unix) for path %s", searchName); 3347 cifs_dbg(FYI, "In GetPosixACL (Unix) for path %s\n", searchName);
3341 3348
3342queryAclRetry: 3349queryAclRetry:
3343 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3350 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -3390,7 +3397,7 @@ queryAclRetry:
3390 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3397 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3391 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get); 3398 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get);
3392 if (rc) { 3399 if (rc) {
3393 cFYI(1, "Send error in Query POSIX ACL = %d", rc); 3400 cifs_dbg(FYI, "Send error in Query POSIX ACL = %d\n", rc);
3394 } else { 3401 } else {
3395 /* decode response */ 3402 /* decode response */
3396 3403
@@ -3427,7 +3434,7 @@ CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
3427 int bytes_returned = 0; 3434 int bytes_returned = 0;
3428 __u16 params, byte_count, data_count, param_offset, offset; 3435 __u16 params, byte_count, data_count, param_offset, offset;
3429 3436
3430 cFYI(1, "In SetPosixACL (Unix) for path %s", fileName); 3437 cifs_dbg(FYI, "In SetPosixACL (Unix) for path %s\n", fileName);
3431setAclRetry: 3438setAclRetry:
3432 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3439 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3433 (void **) &pSMBr); 3440 (void **) &pSMBr);
@@ -3482,7 +3489,7 @@ setAclRetry:
3482 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3489 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3483 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3490 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3484 if (rc) 3491 if (rc)
3485 cFYI(1, "Set POSIX ACL returned %d", rc); 3492 cifs_dbg(FYI, "Set POSIX ACL returned %d\n", rc);
3486 3493
3487setACLerrorExit: 3494setACLerrorExit:
3488 cifs_buf_release(pSMB); 3495 cifs_buf_release(pSMB);
@@ -3502,7 +3509,7 @@ CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
3502 int bytes_returned; 3509 int bytes_returned;
3503 __u16 params, byte_count; 3510 __u16 params, byte_count;
3504 3511
3505 cFYI(1, "In GetExtAttr"); 3512 cifs_dbg(FYI, "In GetExtAttr\n");
3506 if (tcon == NULL) 3513 if (tcon == NULL)
3507 return -ENODEV; 3514 return -ENODEV;
3508 3515
@@ -3541,7 +3548,7 @@ GetExtAttrRetry:
3541 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3548 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3542 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3549 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3543 if (rc) { 3550 if (rc) {
3544 cFYI(1, "error %d in GetExtAttr", rc); 3551 cifs_dbg(FYI, "error %d in GetExtAttr\n", rc);
3545 } else { 3552 } else {
3546 /* decode response */ 3553 /* decode response */
3547 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 3554 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
@@ -3556,7 +3563,7 @@ GetExtAttrRetry:
3556 struct file_chattr_info *pfinfo; 3563 struct file_chattr_info *pfinfo;
3557 /* BB Do we need a cast or hash here ? */ 3564 /* BB Do we need a cast or hash here ? */
3558 if (count != 16) { 3565 if (count != 16) {
3559 cFYI(1, "Illegal size ret in GetExtAttr"); 3566 cifs_dbg(FYI, "Illegal size ret in GetExtAttr\n");
3560 rc = -EIO; 3567 rc = -EIO;
3561 goto GetExtAttrOut; 3568 goto GetExtAttrOut;
3562 } 3569 }
@@ -3644,21 +3651,21 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
3644 3651
3645 /* should we also check that parm and data areas do not overlap? */ 3652 /* should we also check that parm and data areas do not overlap? */
3646 if (*ppparm > end_of_smb) { 3653 if (*ppparm > end_of_smb) {
3647 cFYI(1, "parms start after end of smb"); 3654 cifs_dbg(FYI, "parms start after end of smb\n");
3648 return -EINVAL; 3655 return -EINVAL;
3649 } else if (parm_count + *ppparm > end_of_smb) { 3656 } else if (parm_count + *ppparm > end_of_smb) {
3650 cFYI(1, "parm end after end of smb"); 3657 cifs_dbg(FYI, "parm end after end of smb\n");
3651 return -EINVAL; 3658 return -EINVAL;
3652 } else if (*ppdata > end_of_smb) { 3659 } else if (*ppdata > end_of_smb) {
3653 cFYI(1, "data starts after end of smb"); 3660 cifs_dbg(FYI, "data starts after end of smb\n");
3654 return -EINVAL; 3661 return -EINVAL;
3655 } else if (data_count + *ppdata > end_of_smb) { 3662 } else if (data_count + *ppdata > end_of_smb) {
3656 cFYI(1, "data %p + count %d (%p) past smb end %p start %p", 3663 cifs_dbg(FYI, "data %p + count %d (%p) past smb end %p start %p\n",
3657 *ppdata, data_count, (data_count + *ppdata), 3664 *ppdata, data_count, (data_count + *ppdata),
3658 end_of_smb, pSMBr); 3665 end_of_smb, pSMBr);
3659 return -EINVAL; 3666 return -EINVAL;
3660 } else if (parm_count + data_count > bcc) { 3667 } else if (parm_count + data_count > bcc) {
3661 cFYI(1, "parm count and data count larger than SMB"); 3668 cifs_dbg(FYI, "parm count and data count larger than SMB\n");
3662 return -EINVAL; 3669 return -EINVAL;
3663 } 3670 }
3664 *pdatalen = data_count; 3671 *pdatalen = data_count;
@@ -3676,7 +3683,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3676 QUERY_SEC_DESC_REQ *pSMB; 3683 QUERY_SEC_DESC_REQ *pSMB;
3677 struct kvec iov[1]; 3684 struct kvec iov[1];
3678 3685
3679 cFYI(1, "GetCifsACL"); 3686 cifs_dbg(FYI, "GetCifsACL\n");
3680 3687
3681 *pbuflen = 0; 3688 *pbuflen = 0;
3682 *acl_inf = NULL; 3689 *acl_inf = NULL;
@@ -3701,7 +3708,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3701 0); 3708 0);
3702 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get); 3709 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get);
3703 if (rc) { 3710 if (rc) {
3704 cFYI(1, "Send error in QuerySecDesc = %d", rc); 3711 cifs_dbg(FYI, "Send error in QuerySecDesc = %d\n", rc);
3705 } else { /* decode response */ 3712 } else { /* decode response */
3706 __le32 *parm; 3713 __le32 *parm;
3707 __u32 parm_len; 3714 __u32 parm_len;
@@ -3716,7 +3723,8 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3716 goto qsec_out; 3723 goto qsec_out;
3717 pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base; 3724 pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base;
3718 3725
3719 cFYI(1, "smb %p parm %p data %p", pSMBr, parm, *acl_inf); 3726 cifs_dbg(FYI, "smb %p parm %p data %p\n",
3727 pSMBr, parm, *acl_inf);
3720 3728
3721 if (le32_to_cpu(pSMBr->ParameterCount) != 4) { 3729 if (le32_to_cpu(pSMBr->ParameterCount) != 4) {
3722 rc = -EIO; /* bad smb */ 3730 rc = -EIO; /* bad smb */
@@ -3728,8 +3736,8 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3728 3736
3729 acl_len = le32_to_cpu(*parm); 3737 acl_len = le32_to_cpu(*parm);
3730 if (acl_len != *pbuflen) { 3738 if (acl_len != *pbuflen) {
3731 cERROR(1, "acl length %d does not match %d", 3739 cifs_dbg(VFS, "acl length %d does not match %d\n",
3732 acl_len, *pbuflen); 3740 acl_len, *pbuflen);
3733 if (*pbuflen > acl_len) 3741 if (*pbuflen > acl_len)
3734 *pbuflen = acl_len; 3742 *pbuflen = acl_len;
3735 } 3743 }
@@ -3738,7 +3746,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3738 header followed by the smallest SID */ 3746 header followed by the smallest SID */
3739 if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) || 3747 if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) ||
3740 (*pbuflen >= 64 * 1024)) { 3748 (*pbuflen >= 64 * 1024)) {
3741 cERROR(1, "bad acl length %d", *pbuflen); 3749 cifs_dbg(VFS, "bad acl length %d\n", *pbuflen);
3742 rc = -EINVAL; 3750 rc = -EINVAL;
3743 *pbuflen = 0; 3751 *pbuflen = 0;
3744 } else { 3752 } else {
@@ -3808,9 +3816,10 @@ setCifsAclRetry:
3808 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3816 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3809 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3817 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3810 3818
3811 cFYI(1, "SetCIFSACL bytes_returned: %d, rc: %d", bytes_returned, rc); 3819 cifs_dbg(FYI, "SetCIFSACL bytes_returned: %d, rc: %d\n",
3820 bytes_returned, rc);
3812 if (rc) 3821 if (rc)
3813 cFYI(1, "Set CIFS ACL returned %d", rc); 3822 cifs_dbg(FYI, "Set CIFS ACL returned %d\n", rc);
3814 cifs_buf_release(pSMB); 3823 cifs_buf_release(pSMB);
3815 3824
3816 if (rc == -EAGAIN) 3825 if (rc == -EAGAIN)
@@ -3834,7 +3843,7 @@ SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
3834 int bytes_returned; 3843 int bytes_returned;
3835 int name_len; 3844 int name_len;
3836 3845
3837 cFYI(1, "In SMBQPath path %s", search_name); 3846 cifs_dbg(FYI, "In SMBQPath path %s\n", search_name);
3838QInfRetry: 3847QInfRetry:
3839 rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB, 3848 rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB,
3840 (void **) &pSMBr); 3849 (void **) &pSMBr);
@@ -3861,7 +3870,7 @@ QInfRetry:
3861 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3870 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3862 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3871 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3863 if (rc) { 3872 if (rc) {
3864 cFYI(1, "Send error in QueryInfo = %d", rc); 3873 cifs_dbg(FYI, "Send error in QueryInfo = %d\n", rc);
3865 } else if (data) { 3874 } else if (data) {
3866 struct timespec ts; 3875 struct timespec ts;
3867 __u32 time = le32_to_cpu(pSMBr->last_write_time); 3876 __u32 time = le32_to_cpu(pSMBr->last_write_time);
@@ -3935,7 +3944,7 @@ QFileInfoRetry:
3935 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3944 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3936 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3945 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3937 if (rc) { 3946 if (rc) {
3938 cFYI(1, "Send error in QPathInfo = %d", rc); 3947 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
3939 } else { /* decode response */ 3948 } else { /* decode response */
3940 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 3949 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3941 3950
@@ -3972,7 +3981,7 @@ CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
3972 int name_len; 3981 int name_len;
3973 __u16 params, byte_count; 3982 __u16 params, byte_count;
3974 3983
3975 /* cFYI(1, "In QPathInfo path %s", search_name); */ 3984 /* cifs_dbg(FYI, "In QPathInfo path %s\n", search_name); */
3976QPathInfoRetry: 3985QPathInfoRetry:
3977 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3986 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
3978 (void **) &pSMBr); 3987 (void **) &pSMBr);
@@ -4022,7 +4031,7 @@ QPathInfoRetry:
4022 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4031 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4023 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4032 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4024 if (rc) { 4033 if (rc) {
4025 cFYI(1, "Send error in QPathInfo = %d", rc); 4034 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
4026 } else { /* decode response */ 4035 } else { /* decode response */
4027 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4036 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4028 4037
@@ -4103,14 +4112,12 @@ UnixQFileInfoRetry:
4103 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4112 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4104 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4113 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4105 if (rc) { 4114 if (rc) {
4106 cFYI(1, "Send error in QPathInfo = %d", rc); 4115 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
4107 } else { /* decode response */ 4116 } else { /* decode response */
4108 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4117 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4109 4118
4110 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) { 4119 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) {
4111 cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response. " 4120 cifs_dbg(VFS, "Malformed FILE_UNIX_BASIC_INFO response. Unix Extensions can be disabled on mount by specifying the nosfu mount option.\n");
4112 "Unix Extensions can be disabled on mount "
4113 "by specifying the nosfu mount option.");
4114 rc = -EIO; /* bad smb */ 4121 rc = -EIO; /* bad smb */
4115 } else { 4122 } else {
4116 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); 4123 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
@@ -4142,7 +4149,7 @@ CIFSSMBUnixQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
4142 int name_len; 4149 int name_len;
4143 __u16 params, byte_count; 4150 __u16 params, byte_count;
4144 4151
4145 cFYI(1, "In QPathInfo (Unix) the path %s", searchName); 4152 cifs_dbg(FYI, "In QPathInfo (Unix) the path %s\n", searchName);
4146UnixQPathInfoRetry: 4153UnixQPathInfoRetry:
4147 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4154 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4148 (void **) &pSMBr); 4155 (void **) &pSMBr);
@@ -4189,14 +4196,12 @@ UnixQPathInfoRetry:
4189 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4196 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4190 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4197 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4191 if (rc) { 4198 if (rc) {
4192 cFYI(1, "Send error in QPathInfo = %d", rc); 4199 cifs_dbg(FYI, "Send error in QPathInfo = %d\n", rc);
4193 } else { /* decode response */ 4200 } else { /* decode response */
4194 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4201 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4195 4202
4196 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) { 4203 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) {
4197 cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response. " 4204 cifs_dbg(VFS, "Malformed FILE_UNIX_BASIC_INFO response. Unix Extensions can be disabled on mount by specifying the nosfu mount option.\n");
4198 "Unix Extensions can be disabled on mount "
4199 "by specifying the nosfu mount option.");
4200 rc = -EIO; /* bad smb */ 4205 rc = -EIO; /* bad smb */
4201 } else { 4206 } else {
4202 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); 4207 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
@@ -4230,7 +4235,7 @@ CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
4230 __u16 params, byte_count; 4235 __u16 params, byte_count;
4231 struct nls_table *nls_codepage; 4236 struct nls_table *nls_codepage;
4232 4237
4233 cFYI(1, "In FindFirst for %s", searchName); 4238 cifs_dbg(FYI, "In FindFirst for %s\n", searchName);
4234 4239
4235findFirstRetry: 4240findFirstRetry:
4236 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4241 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -4313,7 +4318,7 @@ findFirstRetry:
4313 if (rc) {/* BB add logic to retry regular search if Unix search 4318 if (rc) {/* BB add logic to retry regular search if Unix search
4314 rejected unexpectedly by server */ 4319 rejected unexpectedly by server */
4315 /* BB Add code to handle unsupported level rc */ 4320 /* BB Add code to handle unsupported level rc */
4316 cFYI(1, "Error in FindFirst = %d", rc); 4321 cifs_dbg(FYI, "Error in FindFirst = %d\n", rc);
4317 4322
4318 cifs_buf_release(pSMB); 4323 cifs_buf_release(pSMB);
4319 4324
@@ -4351,7 +4356,7 @@ findFirstRetry:
4351 psrch_inf->entries_in_buffer; 4356 psrch_inf->entries_in_buffer;
4352 lnoff = le16_to_cpu(parms->LastNameOffset); 4357 lnoff = le16_to_cpu(parms->LastNameOffset);
4353 if (CIFSMaxBufSize < lnoff) { 4358 if (CIFSMaxBufSize < lnoff) {
4354 cERROR(1, "ignoring corrupt resume name"); 4359 cifs_dbg(VFS, "ignoring corrupt resume name\n");
4355 psrch_inf->last_entry = NULL; 4360 psrch_inf->last_entry = NULL;
4356 return rc; 4361 return rc;
4357 } 4362 }
@@ -4382,7 +4387,7 @@ int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4382 unsigned int name_len; 4387 unsigned int name_len;
4383 __u16 params, byte_count; 4388 __u16 params, byte_count;
4384 4389
4385 cFYI(1, "In FindNext"); 4390 cifs_dbg(FYI, "In FindNext\n");
4386 4391
4387 if (psrch_inf->endOfSearch) 4392 if (psrch_inf->endOfSearch)
4388 return -ENOENT; 4393 return -ENOENT;
@@ -4443,7 +4448,7 @@ int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4443 cifs_buf_release(pSMB); 4448 cifs_buf_release(pSMB);
4444 rc = 0; /* search probably was closed at end of search*/ 4449 rc = 0; /* search probably was closed at end of search*/
4445 } else 4450 } else
4446 cFYI(1, "FindNext returned = %d", rc); 4451 cifs_dbg(FYI, "FindNext returned = %d\n", rc);
4447 } else { /* decode response */ 4452 } else { /* decode response */
4448 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4453 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4449 4454
@@ -4478,15 +4483,15 @@ int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4478 psrch_inf->entries_in_buffer; 4483 psrch_inf->entries_in_buffer;
4479 lnoff = le16_to_cpu(parms->LastNameOffset); 4484 lnoff = le16_to_cpu(parms->LastNameOffset);
4480 if (CIFSMaxBufSize < lnoff) { 4485 if (CIFSMaxBufSize < lnoff) {
4481 cERROR(1, "ignoring corrupt resume name"); 4486 cifs_dbg(VFS, "ignoring corrupt resume name\n");
4482 psrch_inf->last_entry = NULL; 4487 psrch_inf->last_entry = NULL;
4483 return rc; 4488 return rc;
4484 } else 4489 } else
4485 psrch_inf->last_entry = 4490 psrch_inf->last_entry =
4486 psrch_inf->srch_entries_start + lnoff; 4491 psrch_inf->srch_entries_start + lnoff;
4487 4492
4488/* cFYI(1, "fnxt2 entries in buf %d index_of_last %d", 4493/* cifs_dbg(FYI, "fnxt2 entries in buf %d index_of_last %d\n",
4489 psrch_inf->entries_in_buffer, psrch_inf->index_of_last_entry); */ 4494 psrch_inf->entries_in_buffer, psrch_inf->index_of_last_entry); */
4490 4495
4491 /* BB fixme add unlock here */ 4496 /* BB fixme add unlock here */
4492 } 4497 }
@@ -4511,7 +4516,7 @@ CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
4511 int rc = 0; 4516 int rc = 0;
4512 FINDCLOSE_REQ *pSMB = NULL; 4517 FINDCLOSE_REQ *pSMB = NULL;
4513 4518
4514 cFYI(1, "In CIFSSMBFindClose"); 4519 cifs_dbg(FYI, "In CIFSSMBFindClose\n");
4515 rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB); 4520 rc = small_smb_init(SMB_COM_FIND_CLOSE2, 1, tcon, (void **)&pSMB);
4516 4521
4517 /* no sense returning error if session restarted 4522 /* no sense returning error if session restarted
@@ -4525,7 +4530,7 @@ CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
4525 pSMB->ByteCount = 0; 4530 pSMB->ByteCount = 0;
4526 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 4531 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
4527 if (rc) 4532 if (rc)
4528 cERROR(1, "Send error in FindClose = %d", rc); 4533 cifs_dbg(VFS, "Send error in FindClose = %d\n", rc);
4529 4534
4530 cifs_stats_inc(&tcon->stats.cifs_stats.num_fclose); 4535 cifs_stats_inc(&tcon->stats.cifs_stats.num_fclose);
4531 4536
@@ -4547,7 +4552,7 @@ CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
4547 int name_len, bytes_returned; 4552 int name_len, bytes_returned;
4548 __u16 params, byte_count; 4553 __u16 params, byte_count;
4549 4554
4550 cFYI(1, "In GetSrvInodeNum for %s", search_name); 4555 cifs_dbg(FYI, "In GetSrvInodeNum for %s\n", search_name);
4551 if (tcon == NULL) 4556 if (tcon == NULL)
4552 return -ENODEV; 4557 return -ENODEV;
4553 4558
@@ -4598,7 +4603,7 @@ GetInodeNumberRetry:
4598 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4603 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4599 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4604 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4600 if (rc) { 4605 if (rc) {
4601 cFYI(1, "error %d in QueryInternalInfo", rc); 4606 cifs_dbg(FYI, "error %d in QueryInternalInfo\n", rc);
4602 } else { 4607 } else {
4603 /* decode response */ 4608 /* decode response */
4604 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4609 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
@@ -4613,7 +4618,7 @@ GetInodeNumberRetry:
4613 struct file_internal_info *pfinfo; 4618 struct file_internal_info *pfinfo;
4614 /* BB Do we need a cast or hash here ? */ 4619 /* BB Do we need a cast or hash here ? */
4615 if (count < 8) { 4620 if (count < 8) {
4616 cFYI(1, "Illegal size ret in QryIntrnlInf"); 4621 cifs_dbg(FYI, "Illegal size ret in QryIntrnlInf\n");
4617 rc = -EIO; 4622 rc = -EIO;
4618 goto GetInodeNumOut; 4623 goto GetInodeNumOut;
4619 } 4624 }
@@ -4654,16 +4659,16 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
4654 *num_of_nodes = le16_to_cpu(pSMBr->NumberOfReferrals); 4659 *num_of_nodes = le16_to_cpu(pSMBr->NumberOfReferrals);
4655 4660
4656 if (*num_of_nodes < 1) { 4661 if (*num_of_nodes < 1) {
4657 cERROR(1, "num_referrals: must be at least > 0," 4662 cifs_dbg(VFS, "num_referrals: must be at least > 0, but we get num_referrals = %d\n",
4658 "but we get num_referrals = %d", *num_of_nodes); 4663 *num_of_nodes);
4659 rc = -EINVAL; 4664 rc = -EINVAL;
4660 goto parse_DFS_referrals_exit; 4665 goto parse_DFS_referrals_exit;
4661 } 4666 }
4662 4667
4663 ref = (struct dfs_referral_level_3 *) &(pSMBr->referrals); 4668 ref = (struct dfs_referral_level_3 *) &(pSMBr->referrals);
4664 if (ref->VersionNumber != cpu_to_le16(3)) { 4669 if (ref->VersionNumber != cpu_to_le16(3)) {
4665 cERROR(1, "Referrals of V%d version are not supported," 4670 cifs_dbg(VFS, "Referrals of V%d version are not supported, should be V3\n",
4666 "should be V3", le16_to_cpu(ref->VersionNumber)); 4671 le16_to_cpu(ref->VersionNumber));
4667 rc = -EINVAL; 4672 rc = -EINVAL;
4668 goto parse_DFS_referrals_exit; 4673 goto parse_DFS_referrals_exit;
4669 } 4674 }
@@ -4672,14 +4677,12 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
4672 data_end = (char *)(&(pSMBr->PathConsumed)) + 4677 data_end = (char *)(&(pSMBr->PathConsumed)) +
4673 le16_to_cpu(pSMBr->t2.DataCount); 4678 le16_to_cpu(pSMBr->t2.DataCount);
4674 4679
4675 cFYI(1, "num_referrals: %d dfs flags: 0x%x ...", 4680 cifs_dbg(FYI, "num_referrals: %d dfs flags: 0x%x ...\n",
4676 *num_of_nodes, 4681 *num_of_nodes, le32_to_cpu(pSMBr->DFSFlags));
4677 le32_to_cpu(pSMBr->DFSFlags));
4678 4682
4679 *target_nodes = kzalloc(sizeof(struct dfs_info3_param) * 4683 *target_nodes = kcalloc(*num_of_nodes, sizeof(struct dfs_info3_param),
4680 *num_of_nodes, GFP_KERNEL); 4684 GFP_KERNEL);
4681 if (*target_nodes == NULL) { 4685 if (*target_nodes == NULL) {
4682 cERROR(1, "Failed to allocate buffer for target_nodes");
4683 rc = -ENOMEM; 4686 rc = -ENOMEM;
4684 goto parse_DFS_referrals_exit; 4687 goto parse_DFS_referrals_exit;
4685 } 4688 }
@@ -4758,7 +4761,7 @@ CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
4758 *num_of_nodes = 0; 4761 *num_of_nodes = 0;
4759 *target_nodes = NULL; 4762 *target_nodes = NULL;
4760 4763
4761 cFYI(1, "In GetDFSRefer the path %s", search_name); 4764 cifs_dbg(FYI, "In GetDFSRefer the path %s\n", search_name);
4762 if (ses == NULL) 4765 if (ses == NULL)
4763 return -ENODEV; 4766 return -ENODEV;
4764getDFSRetry: 4767getDFSRetry:
@@ -4826,7 +4829,7 @@ getDFSRetry:
4826 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB, 4829 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB,
4827 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4830 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4828 if (rc) { 4831 if (rc) {
4829 cFYI(1, "Send error in GetDFSRefer = %d", rc); 4832 cifs_dbg(FYI, "Send error in GetDFSRefer = %d\n", rc);
4830 goto GetDFSRefExit; 4833 goto GetDFSRefExit;
4831 } 4834 }
4832 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4835 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
@@ -4837,9 +4840,8 @@ getDFSRetry:
4837 goto GetDFSRefExit; 4840 goto GetDFSRefExit;
4838 } 4841 }
4839 4842
4840 cFYI(1, "Decoding GetDFSRefer response BCC: %d Offset %d", 4843 cifs_dbg(FYI, "Decoding GetDFSRefer response BCC: %d Offset %d\n",
4841 get_bcc(&pSMBr->hdr), 4844 get_bcc(&pSMBr->hdr), le16_to_cpu(pSMBr->t2.DataOffset));
4842 le16_to_cpu(pSMBr->t2.DataOffset));
4843 4845
4844 /* parse returned result into more usable form */ 4846 /* parse returned result into more usable form */
4845 rc = parse_DFS_referrals(pSMBr, num_of_nodes, 4847 rc = parse_DFS_referrals(pSMBr, num_of_nodes,
@@ -4868,7 +4870,7 @@ SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
4868 int bytes_returned = 0; 4870 int bytes_returned = 0;
4869 __u16 params, byte_count; 4871 __u16 params, byte_count;
4870 4872
4871 cFYI(1, "OldQFSInfo"); 4873 cifs_dbg(FYI, "OldQFSInfo\n");
4872oldQFSInfoRetry: 4874oldQFSInfoRetry:
4873 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4875 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4874 (void **) &pSMBr); 4876 (void **) &pSMBr);
@@ -4901,7 +4903,7 @@ oldQFSInfoRetry:
4901 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4903 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4902 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4904 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4903 if (rc) { 4905 if (rc) {
4904 cFYI(1, "Send error in QFSInfo = %d", rc); 4906 cifs_dbg(FYI, "Send error in QFSInfo = %d\n", rc);
4905 } else { /* decode response */ 4907 } else { /* decode response */
4906 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4908 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4907 4909
@@ -4909,7 +4911,7 @@ oldQFSInfoRetry:
4909 rc = -EIO; /* bad smb */ 4911 rc = -EIO; /* bad smb */
4910 else { 4912 else {
4911 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); 4913 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
4912 cFYI(1, "qfsinf resp BCC: %d Offset %d", 4914 cifs_dbg(FYI, "qfsinf resp BCC: %d Offset %d\n",
4913 get_bcc(&pSMBr->hdr), data_offset); 4915 get_bcc(&pSMBr->hdr), data_offset);
4914 4916
4915 response_data = (FILE_SYSTEM_ALLOC_INFO *) 4917 response_data = (FILE_SYSTEM_ALLOC_INFO *)
@@ -4922,10 +4924,10 @@ oldQFSInfoRetry:
4922 le32_to_cpu(response_data->TotalAllocationUnits); 4924 le32_to_cpu(response_data->TotalAllocationUnits);
4923 FSData->f_bfree = FSData->f_bavail = 4925 FSData->f_bfree = FSData->f_bavail =
4924 le32_to_cpu(response_data->FreeAllocationUnits); 4926 le32_to_cpu(response_data->FreeAllocationUnits);
4925 cFYI(1, "Blocks: %lld Free: %lld Block size %ld", 4927 cifs_dbg(FYI, "Blocks: %lld Free: %lld Block size %ld\n",
4926 (unsigned long long)FSData->f_blocks, 4928 (unsigned long long)FSData->f_blocks,
4927 (unsigned long long)FSData->f_bfree, 4929 (unsigned long long)FSData->f_bfree,
4928 FSData->f_bsize); 4930 FSData->f_bsize);
4929 } 4931 }
4930 } 4932 }
4931 cifs_buf_release(pSMB); 4933 cifs_buf_release(pSMB);
@@ -4948,7 +4950,7 @@ CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
4948 int bytes_returned = 0; 4950 int bytes_returned = 0;
4949 __u16 params, byte_count; 4951 __u16 params, byte_count;
4950 4952
4951 cFYI(1, "In QFSInfo"); 4953 cifs_dbg(FYI, "In QFSInfo\n");
4952QFSInfoRetry: 4954QFSInfoRetry:
4953 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4955 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4954 (void **) &pSMBr); 4956 (void **) &pSMBr);
@@ -4981,7 +4983,7 @@ QFSInfoRetry:
4981 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4983 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4982 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4984 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4983 if (rc) { 4985 if (rc) {
4984 cFYI(1, "Send error in QFSInfo = %d", rc); 4986 cifs_dbg(FYI, "Send error in QFSInfo = %d\n", rc);
4985 } else { /* decode response */ 4987 } else { /* decode response */
4986 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4988 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4987 4989
@@ -5002,10 +5004,10 @@ QFSInfoRetry:
5002 le64_to_cpu(response_data->TotalAllocationUnits); 5004 le64_to_cpu(response_data->TotalAllocationUnits);
5003 FSData->f_bfree = FSData->f_bavail = 5005 FSData->f_bfree = FSData->f_bavail =
5004 le64_to_cpu(response_data->FreeAllocationUnits); 5006 le64_to_cpu(response_data->FreeAllocationUnits);
5005 cFYI(1, "Blocks: %lld Free: %lld Block size %ld", 5007 cifs_dbg(FYI, "Blocks: %lld Free: %lld Block size %ld\n",
5006 (unsigned long long)FSData->f_blocks, 5008 (unsigned long long)FSData->f_blocks,
5007 (unsigned long long)FSData->f_bfree, 5009 (unsigned long long)FSData->f_bfree,
5008 FSData->f_bsize); 5010 FSData->f_bsize);
5009 } 5011 }
5010 } 5012 }
5011 cifs_buf_release(pSMB); 5013 cifs_buf_release(pSMB);
@@ -5027,7 +5029,7 @@ CIFSSMBQFSAttributeInfo(const unsigned int xid, struct cifs_tcon *tcon)
5027 int bytes_returned = 0; 5029 int bytes_returned = 0;
5028 __u16 params, byte_count; 5030 __u16 params, byte_count;
5029 5031
5030 cFYI(1, "In QFSAttributeInfo"); 5032 cifs_dbg(FYI, "In QFSAttributeInfo\n");
5031QFSAttributeRetry: 5033QFSAttributeRetry:
5032 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5034 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5033 (void **) &pSMBr); 5035 (void **) &pSMBr);
@@ -5061,7 +5063,7 @@ QFSAttributeRetry:
5061 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5063 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5062 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5064 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5063 if (rc) { 5065 if (rc) {
5064 cERROR(1, "Send error in QFSAttributeInfo = %d", rc); 5066 cifs_dbg(VFS, "Send error in QFSAttributeInfo = %d\n", rc);
5065 } else { /* decode response */ 5067 } else { /* decode response */
5066 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5068 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5067 5069
@@ -5097,7 +5099,7 @@ CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon)
5097 int bytes_returned = 0; 5099 int bytes_returned = 0;
5098 __u16 params, byte_count; 5100 __u16 params, byte_count;
5099 5101
5100 cFYI(1, "In QFSDeviceInfo"); 5102 cifs_dbg(FYI, "In QFSDeviceInfo\n");
5101QFSDeviceRetry: 5103QFSDeviceRetry:
5102 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5104 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5103 (void **) &pSMBr); 5105 (void **) &pSMBr);
@@ -5132,7 +5134,7 @@ QFSDeviceRetry:
5132 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5134 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5133 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5135 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5134 if (rc) { 5136 if (rc) {
5135 cFYI(1, "Send error in QFSDeviceInfo = %d", rc); 5137 cifs_dbg(FYI, "Send error in QFSDeviceInfo = %d\n", rc);
5136 } else { /* decode response */ 5138 } else { /* decode response */
5137 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5139 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5138 5140
@@ -5168,7 +5170,7 @@ CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon)
5168 int bytes_returned = 0; 5170 int bytes_returned = 0;
5169 __u16 params, byte_count; 5171 __u16 params, byte_count;
5170 5172
5171 cFYI(1, "In QFSUnixInfo"); 5173 cifs_dbg(FYI, "In QFSUnixInfo\n");
5172QFSUnixRetry: 5174QFSUnixRetry:
5173 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, 5175 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,
5174 (void **) &pSMB, (void **) &pSMBr); 5176 (void **) &pSMB, (void **) &pSMBr);
@@ -5202,7 +5204,7 @@ QFSUnixRetry:
5202 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5204 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5203 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5205 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5204 if (rc) { 5206 if (rc) {
5205 cERROR(1, "Send error in QFSUnixInfo = %d", rc); 5207 cifs_dbg(VFS, "Send error in QFSUnixInfo = %d\n", rc);
5206 } else { /* decode response */ 5208 } else { /* decode response */
5207 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5209 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5208 5210
@@ -5237,7 +5239,7 @@ CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon, __u64 cap)
5237 int bytes_returned = 0; 5239 int bytes_returned = 0;
5238 __u16 params, param_offset, offset, byte_count; 5240 __u16 params, param_offset, offset, byte_count;
5239 5241
5240 cFYI(1, "In SETFSUnixInfo"); 5242 cifs_dbg(FYI, "In SETFSUnixInfo\n");
5241SETFSUnixRetry: 5243SETFSUnixRetry:
5242 /* BB switch to small buf init to save memory */ 5244 /* BB switch to small buf init to save memory */
5243 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon, 5245 rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,
@@ -5285,7 +5287,7 @@ SETFSUnixRetry:
5285 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5287 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5286 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5288 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5287 if (rc) { 5289 if (rc) {
5288 cERROR(1, "Send error in SETFSUnixInfo = %d", rc); 5290 cifs_dbg(VFS, "Send error in SETFSUnixInfo = %d\n", rc);
5289 } else { /* decode response */ 5291 } else { /* decode response */
5290 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5292 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5291 if (rc) 5293 if (rc)
@@ -5313,7 +5315,7 @@ CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
5313 int bytes_returned = 0; 5315 int bytes_returned = 0;
5314 __u16 params, byte_count; 5316 __u16 params, byte_count;
5315 5317
5316 cFYI(1, "In QFSPosixInfo"); 5318 cifs_dbg(FYI, "In QFSPosixInfo\n");
5317QFSPosixRetry: 5319QFSPosixRetry:
5318 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5320 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5319 (void **) &pSMBr); 5321 (void **) &pSMBr);
@@ -5347,7 +5349,7 @@ QFSPosixRetry:
5347 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5349 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5348 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5350 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5349 if (rc) { 5351 if (rc) {
5350 cFYI(1, "Send error in QFSUnixInfo = %d", rc); 5352 cifs_dbg(FYI, "Send error in QFSUnixInfo = %d\n", rc);
5351 } else { /* decode response */ 5353 } else { /* decode response */
5352 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 5354 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
5353 5355
@@ -5409,7 +5411,7 @@ CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
5409 5411
5410 __u16 params, byte_count, data_count, param_offset, offset; 5412 __u16 params, byte_count, data_count, param_offset, offset;
5411 5413
5412 cFYI(1, "In SetEOF"); 5414 cifs_dbg(FYI, "In SetEOF\n");
5413SetEOFRetry: 5415SetEOFRetry:
5414 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5416 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5415 (void **) &pSMBr); 5417 (void **) &pSMBr);
@@ -5475,7 +5477,7 @@ SetEOFRetry:
5475 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5477 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5476 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5478 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5477 if (rc) 5479 if (rc)
5478 cFYI(1, "SetPathInfo (file size) returned %d", rc); 5480 cifs_dbg(FYI, "SetPathInfo (file size) returned %d\n", rc);
5479 5481
5480 cifs_buf_release(pSMB); 5482 cifs_buf_release(pSMB);
5481 5483
@@ -5494,8 +5496,8 @@ CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
5494 int rc = 0; 5496 int rc = 0;
5495 __u16 params, param_offset, offset, byte_count, count; 5497 __u16 params, param_offset, offset, byte_count, count;
5496 5498
5497 cFYI(1, "SetFileSize (via SetFileInfo) %lld", 5499 cifs_dbg(FYI, "SetFileSize (via SetFileInfo) %lld\n",
5498 (long long)size); 5500 (long long)size);
5499 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 5501 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5500 5502
5501 if (rc) 5503 if (rc)
@@ -5552,7 +5554,8 @@ CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
5552 pSMB->ByteCount = cpu_to_le16(byte_count); 5554 pSMB->ByteCount = cpu_to_le16(byte_count);
5553 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 5555 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5554 if (rc) { 5556 if (rc) {
5555 cFYI(1, "Send error in SetFileInfo (SetFileSize) = %d", rc); 5557 cifs_dbg(FYI, "Send error in SetFileInfo (SetFileSize) = %d\n",
5558 rc);
5556 } 5559 }
5557 5560
5558 /* Note: On -EAGAIN error only caller can retry on handle based calls 5561 /* Note: On -EAGAIN error only caller can retry on handle based calls
@@ -5576,7 +5579,7 @@ CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5576 int rc = 0; 5579 int rc = 0;
5577 __u16 params, param_offset, offset, byte_count, count; 5580 __u16 params, param_offset, offset, byte_count, count;
5578 5581
5579 cFYI(1, "Set Times (via SetFileInfo)"); 5582 cifs_dbg(FYI, "Set Times (via SetFileInfo)\n");
5580 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 5583 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5581 5584
5582 if (rc) 5585 if (rc)
@@ -5622,7 +5625,8 @@ CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5622 memcpy(data_offset, data, sizeof(FILE_BASIC_INFO)); 5625 memcpy(data_offset, data, sizeof(FILE_BASIC_INFO));
5623 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 5626 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5624 if (rc) 5627 if (rc)
5625 cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); 5628 cifs_dbg(FYI, "Send error in Set Time (SetFileInfo) = %d\n",
5629 rc);
5626 5630
5627 /* Note: On -EAGAIN error only caller can retry on handle based calls 5631 /* Note: On -EAGAIN error only caller can retry on handle based calls
5628 since file handle passed in no longer valid */ 5632 since file handle passed in no longer valid */
@@ -5639,7 +5643,7 @@ CIFSSMBSetFileDisposition(const unsigned int xid, struct cifs_tcon *tcon,
5639 int rc = 0; 5643 int rc = 0;
5640 __u16 params, param_offset, offset, byte_count, count; 5644 __u16 params, param_offset, offset, byte_count, count;
5641 5645
5642 cFYI(1, "Set File Disposition (via SetFileInfo)"); 5646 cifs_dbg(FYI, "Set File Disposition (via SetFileInfo)\n");
5643 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 5647 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5644 5648
5645 if (rc) 5649 if (rc)
@@ -5681,7 +5685,7 @@ CIFSSMBSetFileDisposition(const unsigned int xid, struct cifs_tcon *tcon,
5681 *data_offset = delete_file ? 1 : 0; 5685 *data_offset = delete_file ? 1 : 0;
5682 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 5686 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5683 if (rc) 5687 if (rc)
5684 cFYI(1, "Send error in SetFileDisposition = %d", rc); 5688 cifs_dbg(FYI, "Send error in SetFileDisposition = %d\n", rc);
5685 5689
5686 return rc; 5690 return rc;
5687} 5691}
@@ -5699,7 +5703,7 @@ CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5699 char *data_offset; 5703 char *data_offset;
5700 __u16 params, param_offset, offset, byte_count, count; 5704 __u16 params, param_offset, offset, byte_count, count;
5701 5705
5702 cFYI(1, "In SetTimes"); 5706 cifs_dbg(FYI, "In SetTimes\n");
5703 5707
5704SetTimesRetry: 5708SetTimesRetry:
5705 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5709 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -5755,7 +5759,7 @@ SetTimesRetry:
5755 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5759 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5756 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5760 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5757 if (rc) 5761 if (rc)
5758 cFYI(1, "SetPathInfo (times) returned %d", rc); 5762 cifs_dbg(FYI, "SetPathInfo (times) returned %d\n", rc);
5759 5763
5760 cifs_buf_release(pSMB); 5764 cifs_buf_release(pSMB);
5761 5765
@@ -5780,7 +5784,7 @@ CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon, char *fileName,
5780 int bytes_returned; 5784 int bytes_returned;
5781 int name_len; 5785 int name_len;
5782 5786
5783 cFYI(1, "In SetAttrLegacy"); 5787 cifs_dbg(FYI, "In SetAttrLegacy\n");
5784 5788
5785SetAttrLgcyRetry: 5789SetAttrLgcyRetry:
5786 rc = smb_init(SMB_COM_SETATTR, 8, tcon, (void **) &pSMB, 5790 rc = smb_init(SMB_COM_SETATTR, 8, tcon, (void **) &pSMB,
@@ -5806,7 +5810,7 @@ SetAttrLgcyRetry:
5806 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5810 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5807 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5811 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
5808 if (rc) 5812 if (rc)
5809 cFYI(1, "Error in LegacySetAttr = %d", rc); 5813 cifs_dbg(FYI, "Error in LegacySetAttr = %d\n", rc);
5810 5814
5811 cifs_buf_release(pSMB); 5815 cifs_buf_release(pSMB);
5812 5816
@@ -5874,7 +5878,7 @@ CIFSSMBUnixSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5874 int rc = 0; 5878 int rc = 0;
5875 u16 params, param_offset, offset, byte_count, count; 5879 u16 params, param_offset, offset, byte_count, count;
5876 5880
5877 cFYI(1, "Set Unix Info (via SetFileInfo)"); 5881 cifs_dbg(FYI, "Set Unix Info (via SetFileInfo)\n");
5878 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 5882 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
5879 5883
5880 if (rc) 5884 if (rc)
@@ -5920,7 +5924,8 @@ CIFSSMBUnixSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5920 5924
5921 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 5925 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
5922 if (rc) 5926 if (rc)
5923 cFYI(1, "Send error in Set Time (SetFileInfo) = %d", rc); 5927 cifs_dbg(FYI, "Send error in Set Time (SetFileInfo) = %d\n",
5928 rc);
5924 5929
5925 /* Note: On -EAGAIN error only caller can retry on handle based calls 5930 /* Note: On -EAGAIN error only caller can retry on handle based calls
5926 since file handle passed in no longer valid */ 5931 since file handle passed in no longer valid */
@@ -5942,7 +5947,7 @@ CIFSSMBUnixSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5942 FILE_UNIX_BASIC_INFO *data_offset; 5947 FILE_UNIX_BASIC_INFO *data_offset;
5943 __u16 params, param_offset, offset, count, byte_count; 5948 __u16 params, param_offset, offset, count, byte_count;
5944 5949
5945 cFYI(1, "In SetUID/GID/Mode"); 5950 cifs_dbg(FYI, "In SetUID/GID/Mode\n");
5946setPermsRetry: 5951setPermsRetry:
5947 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 5952 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
5948 (void **) &pSMBr); 5953 (void **) &pSMBr);
@@ -5998,7 +6003,7 @@ setPermsRetry:
5998 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 6003 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5999 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 6004 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
6000 if (rc) 6005 if (rc)
6001 cFYI(1, "SetPathInfo (perms) returned %d", rc); 6006 cifs_dbg(FYI, "SetPathInfo (perms) returned %d\n", rc);
6002 6007
6003 cifs_buf_release(pSMB); 6008 cifs_buf_release(pSMB);
6004 if (rc == -EAGAIN) 6009 if (rc == -EAGAIN)
@@ -6035,7 +6040,7 @@ CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
6035 __u16 params, byte_count, data_offset; 6040 __u16 params, byte_count, data_offset;
6036 unsigned int ea_name_len = ea_name ? strlen(ea_name) : 0; 6041 unsigned int ea_name_len = ea_name ? strlen(ea_name) : 0;
6037 6042
6038 cFYI(1, "In Query All EAs path %s", searchName); 6043 cifs_dbg(FYI, "In Query All EAs path %s\n", searchName);
6039QAllEAsRetry: 6044QAllEAsRetry:
6040 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 6045 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
6041 (void **) &pSMBr); 6046 (void **) &pSMBr);
@@ -6082,7 +6087,7 @@ QAllEAsRetry:
6082 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 6087 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
6083 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 6088 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
6084 if (rc) { 6089 if (rc) {
6085 cFYI(1, "Send error in QueryAllEAs = %d", rc); 6090 cifs_dbg(FYI, "Send error in QueryAllEAs = %d\n", rc);
6086 goto QAllEAsOut; 6091 goto QAllEAsOut;
6087 } 6092 }
6088 6093
@@ -6110,16 +6115,16 @@ QAllEAsRetry:
6110 (((char *) &pSMBr->hdr.Protocol) + data_offset); 6115 (((char *) &pSMBr->hdr.Protocol) + data_offset);
6111 6116
6112 list_len = le32_to_cpu(ea_response_data->list_len); 6117 list_len = le32_to_cpu(ea_response_data->list_len);
6113 cFYI(1, "ea length %d", list_len); 6118 cifs_dbg(FYI, "ea length %d\n", list_len);
6114 if (list_len <= 8) { 6119 if (list_len <= 8) {
6115 cFYI(1, "empty EA list returned from server"); 6120 cifs_dbg(FYI, "empty EA list returned from server\n");
6116 goto QAllEAsOut; 6121 goto QAllEAsOut;
6117 } 6122 }
6118 6123
6119 /* make sure list_len doesn't go past end of SMB */ 6124 /* make sure list_len doesn't go past end of SMB */
6120 end_of_smb = (char *)pByteArea(&pSMBr->hdr) + get_bcc(&pSMBr->hdr); 6125 end_of_smb = (char *)pByteArea(&pSMBr->hdr) + get_bcc(&pSMBr->hdr);
6121 if ((char *)ea_response_data + list_len > end_of_smb) { 6126 if ((char *)ea_response_data + list_len > end_of_smb) {
6122 cFYI(1, "EA list appears to go beyond SMB"); 6127 cifs_dbg(FYI, "EA list appears to go beyond SMB\n");
6123 rc = -EIO; 6128 rc = -EIO;
6124 goto QAllEAsOut; 6129 goto QAllEAsOut;
6125 } 6130 }
@@ -6136,7 +6141,7 @@ QAllEAsRetry:
6136 temp_ptr += 4; 6141 temp_ptr += 4;
6137 /* make sure we can read name_len and value_len */ 6142 /* make sure we can read name_len and value_len */
6138 if (list_len < 0) { 6143 if (list_len < 0) {
6139 cFYI(1, "EA entry goes beyond length of list"); 6144 cifs_dbg(FYI, "EA entry goes beyond length of list\n");
6140 rc = -EIO; 6145 rc = -EIO;
6141 goto QAllEAsOut; 6146 goto QAllEAsOut;
6142 } 6147 }
@@ -6145,7 +6150,7 @@ QAllEAsRetry:
6145 value_len = le16_to_cpu(temp_fea->value_len); 6150 value_len = le16_to_cpu(temp_fea->value_len);
6146 list_len -= name_len + 1 + value_len; 6151 list_len -= name_len + 1 + value_len;
6147 if (list_len < 0) { 6152 if (list_len < 0) {
6148 cFYI(1, "EA entry goes beyond length of list"); 6153 cifs_dbg(FYI, "EA entry goes beyond length of list\n");
6149 rc = -EIO; 6154 rc = -EIO;
6150 goto QAllEAsOut; 6155 goto QAllEAsOut;
6151 } 6156 }
@@ -6213,7 +6218,7 @@ CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
6213 int bytes_returned = 0; 6218 int bytes_returned = 0;
6214 __u16 params, param_offset, byte_count, offset, count; 6219 __u16 params, param_offset, byte_count, offset, count;
6215 6220
6216 cFYI(1, "In SetEA"); 6221 cifs_dbg(FYI, "In SetEA\n");
6217SetEARetry: 6222SetEARetry:
6218 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 6223 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
6219 (void **) &pSMBr); 6224 (void **) &pSMBr);
@@ -6295,7 +6300,7 @@ SetEARetry:
6295 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 6300 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
6296 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 6301 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
6297 if (rc) 6302 if (rc)
6298 cFYI(1, "SetPathInfo (EA) returned %d", rc); 6303 cifs_dbg(FYI, "SetPathInfo (EA) returned %d\n", rc);
6299 6304
6300 cifs_buf_release(pSMB); 6305 cifs_buf_release(pSMB);
6301 6306
@@ -6338,7 +6343,7 @@ int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
6338 struct dir_notify_req *dnotify_req; 6343 struct dir_notify_req *dnotify_req;
6339 int bytes_returned; 6344 int bytes_returned;
6340 6345
6341 cFYI(1, "In CIFSSMBNotify for file handle %d", (int)netfid); 6346 cifs_dbg(FYI, "In CIFSSMBNotify for file handle %d\n", (int)netfid);
6342 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB, 6347 rc = smb_init(SMB_COM_NT_TRANSACT, 23, tcon, (void **) &pSMB,
6343 (void **) &pSMBr); 6348 (void **) &pSMBr);
6344 if (rc) 6349 if (rc)
@@ -6367,7 +6372,7 @@ int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
6367 (struct smb_hdr *)pSMBr, &bytes_returned, 6372 (struct smb_hdr *)pSMBr, &bytes_returned,
6368 CIFS_ASYNC_OP); 6373 CIFS_ASYNC_OP);
6369 if (rc) { 6374 if (rc) {
6370 cFYI(1, "Error in Notify = %d", rc); 6375 cifs_dbg(FYI, "Error in Notify = %d\n", rc);
6371 } else { 6376 } else {
6372 /* Add file to outstanding requests */ 6377 /* Add file to outstanding requests */
6373 /* BB change to kmem cache alloc */ 6378 /* BB change to kmem cache alloc */
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 06394f5478a2..9535abe3d24c 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -316,11 +316,12 @@ cifs_reconnect(struct TCP_Server_Info *server)
316 server->max_read = 0; 316 server->max_read = 0;
317#endif 317#endif
318 318
319 cFYI(1, "Reconnecting tcp session"); 319 cifs_dbg(FYI, "Reconnecting tcp session\n");
320 320
321 /* before reconnecting the tcp session, mark the smb session (uid) 321 /* before reconnecting the tcp session, mark the smb session (uid)
322 and the tid bad so they are not used until reconnected */ 322 and the tid bad so they are not used until reconnected */
323 cFYI(1, "%s: marking sessions and tcons for reconnect", __func__); 323 cifs_dbg(FYI, "%s: marking sessions and tcons for reconnect\n",
324 __func__);
324 spin_lock(&cifs_tcp_ses_lock); 325 spin_lock(&cifs_tcp_ses_lock);
325 list_for_each(tmp, &server->smb_ses_list) { 326 list_for_each(tmp, &server->smb_ses_list) {
326 ses = list_entry(tmp, struct cifs_ses, smb_ses_list); 327 ses = list_entry(tmp, struct cifs_ses, smb_ses_list);
@@ -334,15 +335,14 @@ cifs_reconnect(struct TCP_Server_Info *server)
334 spin_unlock(&cifs_tcp_ses_lock); 335 spin_unlock(&cifs_tcp_ses_lock);
335 336
336 /* do not want to be sending data on a socket we are freeing */ 337 /* do not want to be sending data on a socket we are freeing */
337 cFYI(1, "%s: tearing down socket", __func__); 338 cifs_dbg(FYI, "%s: tearing down socket\n", __func__);
338 mutex_lock(&server->srv_mutex); 339 mutex_lock(&server->srv_mutex);
339 if (server->ssocket) { 340 if (server->ssocket) {
340 cFYI(1, "State: 0x%x Flags: 0x%lx", server->ssocket->state, 341 cifs_dbg(FYI, "State: 0x%x Flags: 0x%lx\n",
341 server->ssocket->flags); 342 server->ssocket->state, server->ssocket->flags);
342 kernel_sock_shutdown(server->ssocket, SHUT_WR); 343 kernel_sock_shutdown(server->ssocket, SHUT_WR);
343 cFYI(1, "Post shutdown state: 0x%x Flags: 0x%lx", 344 cifs_dbg(FYI, "Post shutdown state: 0x%x Flags: 0x%lx\n",
344 server->ssocket->state, 345 server->ssocket->state, server->ssocket->flags);
345 server->ssocket->flags);
346 sock_release(server->ssocket); 346 sock_release(server->ssocket);
347 server->ssocket = NULL; 347 server->ssocket = NULL;
348 } 348 }
@@ -356,7 +356,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
356 356
357 /* mark submitted MIDs for retry and issue callback */ 357 /* mark submitted MIDs for retry and issue callback */
358 INIT_LIST_HEAD(&retry_list); 358 INIT_LIST_HEAD(&retry_list);
359 cFYI(1, "%s: moving mids to private list", __func__); 359 cifs_dbg(FYI, "%s: moving mids to private list\n", __func__);
360 spin_lock(&GlobalMid_Lock); 360 spin_lock(&GlobalMid_Lock);
361 list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { 361 list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
362 mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 362 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
@@ -366,7 +366,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
366 } 366 }
367 spin_unlock(&GlobalMid_Lock); 367 spin_unlock(&GlobalMid_Lock);
368 368
369 cFYI(1, "%s: issuing mid callbacks", __func__); 369 cifs_dbg(FYI, "%s: issuing mid callbacks\n", __func__);
370 list_for_each_safe(tmp, tmp2, &retry_list) { 370 list_for_each_safe(tmp, tmp2, &retry_list) {
371 mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 371 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
372 list_del_init(&mid_entry->qhead); 372 list_del_init(&mid_entry->qhead);
@@ -379,7 +379,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
379 /* we should try only the port we connected to before */ 379 /* we should try only the port we connected to before */
380 rc = generic_ip_connect(server); 380 rc = generic_ip_connect(server);
381 if (rc) { 381 if (rc) {
382 cFYI(1, "reconnect error %d", rc); 382 cifs_dbg(FYI, "reconnect error %d\n", rc);
383 msleep(3000); 383 msleep(3000);
384 } else { 384 } else {
385 atomic_inc(&tcpSesReconnectCount); 385 atomic_inc(&tcpSesReconnectCount);
@@ -413,8 +413,8 @@ cifs_echo_request(struct work_struct *work)
413 413
414 rc = server->ops->echo ? server->ops->echo(server) : -ENOSYS; 414 rc = server->ops->echo ? server->ops->echo(server) : -ENOSYS;
415 if (rc) 415 if (rc)
416 cFYI(1, "Unable to send echo request to server: %s", 416 cifs_dbg(FYI, "Unable to send echo request to server: %s\n",
417 server->hostname); 417 server->hostname);
418 418
419requeue_echo: 419requeue_echo:
420 queue_delayed_work(cifsiod_wq, &server->echo, SMB_ECHO_INTERVAL); 420 queue_delayed_work(cifsiod_wq, &server->echo, SMB_ECHO_INTERVAL);
@@ -426,7 +426,7 @@ allocate_buffers(struct TCP_Server_Info *server)
426 if (!server->bigbuf) { 426 if (!server->bigbuf) {
427 server->bigbuf = (char *)cifs_buf_get(); 427 server->bigbuf = (char *)cifs_buf_get();
428 if (!server->bigbuf) { 428 if (!server->bigbuf) {
429 cERROR(1, "No memory for large SMB response"); 429 cifs_dbg(VFS, "No memory for large SMB response\n");
430 msleep(3000); 430 msleep(3000);
431 /* retry will check if exiting */ 431 /* retry will check if exiting */
432 return false; 432 return false;
@@ -439,7 +439,7 @@ allocate_buffers(struct TCP_Server_Info *server)
439 if (!server->smallbuf) { 439 if (!server->smallbuf) {
440 server->smallbuf = (char *)cifs_small_buf_get(); 440 server->smallbuf = (char *)cifs_small_buf_get();
441 if (!server->smallbuf) { 441 if (!server->smallbuf) {
442 cERROR(1, "No memory for SMB response"); 442 cifs_dbg(VFS, "No memory for SMB response\n");
443 msleep(1000); 443 msleep(1000);
444 /* retry will check if exiting */ 444 /* retry will check if exiting */
445 return false; 445 return false;
@@ -469,9 +469,8 @@ server_unresponsive(struct TCP_Server_Info *server)
469 */ 469 */
470 if (server->tcpStatus == CifsGood && 470 if (server->tcpStatus == CifsGood &&
471 time_after(jiffies, server->lstrp + 2 * SMB_ECHO_INTERVAL)) { 471 time_after(jiffies, server->lstrp + 2 * SMB_ECHO_INTERVAL)) {
472 cERROR(1, "Server %s has not responded in %d seconds. " 472 cifs_dbg(VFS, "Server %s has not responded in %d seconds. Reconnecting...\n",
473 "Reconnecting...", server->hostname, 473 server->hostname, (2 * SMB_ECHO_INTERVAL) / HZ);
474 (2 * SMB_ECHO_INTERVAL) / HZ);
475 cifs_reconnect(server); 474 cifs_reconnect(server);
476 wake_up(&server->response_q); 475 wake_up(&server->response_q);
477 return true; 476 return true;
@@ -582,8 +581,8 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct kvec *iov_orig,
582 length = 0; 581 length = 0;
583 continue; 582 continue;
584 } else if (length <= 0) { 583 } else if (length <= 0) {
585 cFYI(1, "Received no data or error: expecting %d " 584 cifs_dbg(FYI, "Received no data or error: expecting %d\n"
586 "got %d", to_read, length); 585 "got %d", to_read, length);
587 cifs_reconnect(server); 586 cifs_reconnect(server);
588 total_read = -EAGAIN; 587 total_read = -EAGAIN;
589 break; 588 break;
@@ -617,17 +616,17 @@ is_smb_response(struct TCP_Server_Info *server, unsigned char type)
617 /* Regular SMB response */ 616 /* Regular SMB response */
618 return true; 617 return true;
619 case RFC1002_SESSION_KEEP_ALIVE: 618 case RFC1002_SESSION_KEEP_ALIVE:
620 cFYI(1, "RFC 1002 session keep alive"); 619 cifs_dbg(FYI, "RFC 1002 session keep alive\n");
621 break; 620 break;
622 case RFC1002_POSITIVE_SESSION_RESPONSE: 621 case RFC1002_POSITIVE_SESSION_RESPONSE:
623 cFYI(1, "RFC 1002 positive session response"); 622 cifs_dbg(FYI, "RFC 1002 positive session response\n");
624 break; 623 break;
625 case RFC1002_NEGATIVE_SESSION_RESPONSE: 624 case RFC1002_NEGATIVE_SESSION_RESPONSE:
626 /* 625 /*
627 * We get this from Windows 98 instead of an error on 626 * We get this from Windows 98 instead of an error on
628 * SMB negprot response. 627 * SMB negprot response.
629 */ 628 */
630 cFYI(1, "RFC 1002 negative session response"); 629 cifs_dbg(FYI, "RFC 1002 negative session response\n");
631 /* give server a second to clean up */ 630 /* give server a second to clean up */
632 msleep(1000); 631 msleep(1000);
633 /* 632 /*
@@ -641,7 +640,7 @@ is_smb_response(struct TCP_Server_Info *server, unsigned char type)
641 wake_up(&server->response_q); 640 wake_up(&server->response_q);
642 break; 641 break;
643 default: 642 default:
644 cERROR(1, "RFC 1002 unknown response type 0x%x", type); 643 cifs_dbg(VFS, "RFC 1002 unknown response type 0x%x\n", type);
645 cifs_reconnect(server); 644 cifs_reconnect(server);
646 } 645 }
647 646
@@ -727,7 +726,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
727 spin_lock(&GlobalMid_Lock); 726 spin_lock(&GlobalMid_Lock);
728 list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { 727 list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
729 mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 728 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
730 cFYI(1, "Clearing mid 0x%llx", mid_entry->mid); 729 cifs_dbg(FYI, "Clearing mid 0x%llx\n", mid_entry->mid);
731 mid_entry->mid_state = MID_SHUTDOWN; 730 mid_entry->mid_state = MID_SHUTDOWN;
732 list_move(&mid_entry->qhead, &dispose_list); 731 list_move(&mid_entry->qhead, &dispose_list);
733 } 732 }
@@ -736,7 +735,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
736 /* now walk dispose list and issue callbacks */ 735 /* now walk dispose list and issue callbacks */
737 list_for_each_safe(tmp, tmp2, &dispose_list) { 736 list_for_each_safe(tmp, tmp2, &dispose_list) {
738 mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 737 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
739 cFYI(1, "Callback mid 0x%llx", mid_entry->mid); 738 cifs_dbg(FYI, "Callback mid 0x%llx\n", mid_entry->mid);
740 list_del_init(&mid_entry->qhead); 739 list_del_init(&mid_entry->qhead);
741 mid_entry->callback(mid_entry); 740 mid_entry->callback(mid_entry);
742 } 741 }
@@ -753,7 +752,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
753 * least 45 seconds before giving up on a request getting a 752 * least 45 seconds before giving up on a request getting a
754 * response and going ahead and killing cifsd. 753 * response and going ahead and killing cifsd.
755 */ 754 */
756 cFYI(1, "Wait for exit from demultiplex thread"); 755 cifs_dbg(FYI, "Wait for exit from demultiplex thread\n");
757 msleep(46000); 756 msleep(46000);
758 /* 757 /*
759 * If threads still have not exited they are probably never 758 * If threads still have not exited they are probably never
@@ -780,8 +779,7 @@ standard_receive3(struct TCP_Server_Info *server, struct mid_q_entry *mid)
780 779
781 /* make sure this will fit in a large buffer */ 780 /* make sure this will fit in a large buffer */
782 if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server) - 4) { 781 if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server) - 4) {
783 cERROR(1, "SMB response too long (%u bytes)", 782 cifs_dbg(VFS, "SMB response too long (%u bytes)\n", pdu_length);
784 pdu_length);
785 cifs_reconnect(server); 783 cifs_reconnect(server);
786 wake_up(&server->response_q); 784 wake_up(&server->response_q);
787 return -EAGAIN; 785 return -EAGAIN;
@@ -839,7 +837,7 @@ cifs_demultiplex_thread(void *p)
839 struct mid_q_entry *mid_entry; 837 struct mid_q_entry *mid_entry;
840 838
841 current->flags |= PF_MEMALLOC; 839 current->flags |= PF_MEMALLOC;
842 cFYI(1, "Demultiplex PID: %d", task_pid_nr(current)); 840 cifs_dbg(FYI, "Demultiplex PID: %d\n", task_pid_nr(current));
843 841
844 length = atomic_inc_return(&tcpSesAllocCount); 842 length = atomic_inc_return(&tcpSesAllocCount);
845 if (length > 1) 843 if (length > 1)
@@ -869,14 +867,14 @@ cifs_demultiplex_thread(void *p)
869 */ 867 */
870 pdu_length = get_rfc1002_length(buf); 868 pdu_length = get_rfc1002_length(buf);
871 869
872 cFYI(1, "RFC1002 header 0x%x", pdu_length); 870 cifs_dbg(FYI, "RFC1002 header 0x%x\n", pdu_length);
873 if (!is_smb_response(server, buf[0])) 871 if (!is_smb_response(server, buf[0]))
874 continue; 872 continue;
875 873
876 /* make sure we have enough to get to the MID */ 874 /* make sure we have enough to get to the MID */
877 if (pdu_length < HEADER_SIZE(server) - 1 - 4) { 875 if (pdu_length < HEADER_SIZE(server) - 1 - 4) {
878 cERROR(1, "SMB response too short (%u bytes)", 876 cifs_dbg(VFS, "SMB response too short (%u bytes)\n",
879 pdu_length); 877 pdu_length);
880 cifs_reconnect(server); 878 cifs_reconnect(server);
881 wake_up(&server->response_q); 879 wake_up(&server->response_q);
882 continue; 880 continue;
@@ -908,8 +906,8 @@ cifs_demultiplex_thread(void *p)
908 mid_entry->callback(mid_entry); 906 mid_entry->callback(mid_entry);
909 } else if (!server->ops->is_oplock_break || 907 } else if (!server->ops->is_oplock_break ||
910 !server->ops->is_oplock_break(buf, server)) { 908 !server->ops->is_oplock_break(buf, server)) {
911 cERROR(1, "No task to wake, unknown frame received! " 909 cifs_dbg(VFS, "No task to wake, unknown frame received! NumMids %d\n",
912 "NumMids %d", atomic_read(&midCount)); 910 atomic_read(&midCount));
913 cifs_dump_mem("Received Data is: ", buf, 911 cifs_dump_mem("Received Data is: ", buf,
914 HEADER_SIZE(server)); 912 HEADER_SIZE(server));
915#ifdef CONFIG_CIFS_DEBUG2 913#ifdef CONFIG_CIFS_DEBUG2
@@ -1035,7 +1033,7 @@ static int cifs_parse_security_flavors(char *value,
1035 break; 1033 break;
1036 case Opt_sec_krb5p: 1034 case Opt_sec_krb5p:
1037 /* vol->secFlg |= CIFSSEC_MUST_SEAL | CIFSSEC_MAY_KRB5; */ 1035 /* vol->secFlg |= CIFSSEC_MUST_SEAL | CIFSSEC_MAY_KRB5; */
1038 cERROR(1, "Krb5 cifs privacy not supported"); 1036 cifs_dbg(VFS, "Krb5 cifs privacy not supported\n");
1039 break; 1037 break;
1040 case Opt_sec_ntlmssp: 1038 case Opt_sec_ntlmssp:
1041 vol->secFlg |= CIFSSEC_MAY_NTLMSSP; 1039 vol->secFlg |= CIFSSEC_MAY_NTLMSSP;
@@ -1065,7 +1063,7 @@ static int cifs_parse_security_flavors(char *value,
1065 vol->nullauth = 1; 1063 vol->nullauth = 1;
1066 break; 1064 break;
1067 default: 1065 default:
1068 cERROR(1, "bad security option: %s", value); 1066 cifs_dbg(VFS, "bad security option: %s\n", value);
1069 return 1; 1067 return 1;
1070 } 1068 }
1071 1069
@@ -1091,7 +1089,7 @@ cifs_parse_cache_flavor(char *value, struct smb_vol *vol)
1091 vol->strict_io = false; 1089 vol->strict_io = false;
1092 break; 1090 break;
1093 default: 1091 default:
1094 cERROR(1, "bad cache= option: %s", value); 1092 cifs_dbg(VFS, "bad cache= option: %s\n", value);
1095 return 1; 1093 return 1;
1096 } 1094 }
1097 return 0; 1095 return 0;
@@ -1122,7 +1120,7 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol)
1122 break; 1120 break;
1123#endif 1121#endif
1124 default: 1122 default:
1125 cERROR(1, "Unknown vers= option specified: %s", value); 1123 cifs_dbg(VFS, "Unknown vers= option specified: %s\n", value);
1126 return 1; 1124 return 1;
1127 } 1125 }
1128 return 0; 1126 return 0;
@@ -1253,7 +1251,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1253 separator[0] = options[4]; 1251 separator[0] = options[4];
1254 options += 5; 1252 options += 5;
1255 } else { 1253 } else {
1256 cFYI(1, "Null separator not allowed"); 1254 cifs_dbg(FYI, "Null separator not allowed\n");
1257 } 1255 }
1258 } 1256 }
1259 vol->backupuid_specified = false; /* no backup intent for a user */ 1257 vol->backupuid_specified = false; /* no backup intent for a user */
@@ -1438,8 +1436,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1438 break; 1436 break;
1439 case Opt_fsc: 1437 case Opt_fsc:
1440#ifndef CONFIG_CIFS_FSCACHE 1438#ifndef CONFIG_CIFS_FSCACHE
1441 cERROR(1, "FS-Cache support needs CONFIG_CIFS_FSCACHE " 1439 cifs_dbg(VFS, "FS-Cache support needs CONFIG_CIFS_FSCACHE kernel config option set\n");
1442 "kernel config option set");
1443 goto cifs_parse_mount_err; 1440 goto cifs_parse_mount_err;
1444#endif 1441#endif
1445 vol->fsc = true; 1442 vol->fsc = true;
@@ -1457,55 +1454,55 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1457 /* Numeric Values */ 1454 /* Numeric Values */
1458 case Opt_backupuid: 1455 case Opt_backupuid:
1459 if (get_option_uid(args, &vol->backupuid)) { 1456 if (get_option_uid(args, &vol->backupuid)) {
1460 cERROR(1, "%s: Invalid backupuid value", 1457 cifs_dbg(VFS, "%s: Invalid backupuid value\n",
1461 __func__); 1458 __func__);
1462 goto cifs_parse_mount_err; 1459 goto cifs_parse_mount_err;
1463 } 1460 }
1464 vol->backupuid_specified = true; 1461 vol->backupuid_specified = true;
1465 break; 1462 break;
1466 case Opt_backupgid: 1463 case Opt_backupgid:
1467 if (get_option_gid(args, &vol->backupgid)) { 1464 if (get_option_gid(args, &vol->backupgid)) {
1468 cERROR(1, "%s: Invalid backupgid value", 1465 cifs_dbg(VFS, "%s: Invalid backupgid value\n",
1469 __func__); 1466 __func__);
1470 goto cifs_parse_mount_err; 1467 goto cifs_parse_mount_err;
1471 } 1468 }
1472 vol->backupgid_specified = true; 1469 vol->backupgid_specified = true;
1473 break; 1470 break;
1474 case Opt_uid: 1471 case Opt_uid:
1475 if (get_option_uid(args, &vol->linux_uid)) { 1472 if (get_option_uid(args, &vol->linux_uid)) {
1476 cERROR(1, "%s: Invalid uid value", 1473 cifs_dbg(VFS, "%s: Invalid uid value\n",
1477 __func__); 1474 __func__);
1478 goto cifs_parse_mount_err; 1475 goto cifs_parse_mount_err;
1479 } 1476 }
1480 uid_specified = true; 1477 uid_specified = true;
1481 break; 1478 break;
1482 case Opt_cruid: 1479 case Opt_cruid:
1483 if (get_option_uid(args, &vol->cred_uid)) { 1480 if (get_option_uid(args, &vol->cred_uid)) {
1484 cERROR(1, "%s: Invalid cruid value", 1481 cifs_dbg(VFS, "%s: Invalid cruid value\n",
1485 __func__); 1482 __func__);
1486 goto cifs_parse_mount_err; 1483 goto cifs_parse_mount_err;
1487 } 1484 }
1488 break; 1485 break;
1489 case Opt_gid: 1486 case Opt_gid:
1490 if (get_option_gid(args, &vol->linux_gid)) { 1487 if (get_option_gid(args, &vol->linux_gid)) {
1491 cERROR(1, "%s: Invalid gid value", 1488 cifs_dbg(VFS, "%s: Invalid gid value\n",
1492 __func__); 1489 __func__);
1493 goto cifs_parse_mount_err; 1490 goto cifs_parse_mount_err;
1494 } 1491 }
1495 gid_specified = true; 1492 gid_specified = true;
1496 break; 1493 break;
1497 case Opt_file_mode: 1494 case Opt_file_mode:
1498 if (get_option_ul(args, &option)) { 1495 if (get_option_ul(args, &option)) {
1499 cERROR(1, "%s: Invalid file_mode value", 1496 cifs_dbg(VFS, "%s: Invalid file_mode value\n",
1500 __func__); 1497 __func__);
1501 goto cifs_parse_mount_err; 1498 goto cifs_parse_mount_err;
1502 } 1499 }
1503 vol->file_mode = option; 1500 vol->file_mode = option;
1504 break; 1501 break;
1505 case Opt_dirmode: 1502 case Opt_dirmode:
1506 if (get_option_ul(args, &option)) { 1503 if (get_option_ul(args, &option)) {
1507 cERROR(1, "%s: Invalid dir_mode value", 1504 cifs_dbg(VFS, "%s: Invalid dir_mode value\n",
1508 __func__); 1505 __func__);
1509 goto cifs_parse_mount_err; 1506 goto cifs_parse_mount_err;
1510 } 1507 }
1511 vol->dir_mode = option; 1508 vol->dir_mode = option;
@@ -1513,37 +1510,37 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1513 case Opt_port: 1510 case Opt_port:
1514 if (get_option_ul(args, &option) || 1511 if (get_option_ul(args, &option) ||
1515 option > USHRT_MAX) { 1512 option > USHRT_MAX) {
1516 cERROR(1, "%s: Invalid port value", __func__); 1513 cifs_dbg(VFS, "%s: Invalid port value\n",
1514 __func__);
1517 goto cifs_parse_mount_err; 1515 goto cifs_parse_mount_err;
1518 } 1516 }
1519 port = (unsigned short)option; 1517 port = (unsigned short)option;
1520 break; 1518 break;
1521 case Opt_rsize: 1519 case Opt_rsize:
1522 if (get_option_ul(args, &option)) { 1520 if (get_option_ul(args, &option)) {
1523 cERROR(1, "%s: Invalid rsize value", 1521 cifs_dbg(VFS, "%s: Invalid rsize value\n",
1524 __func__); 1522 __func__);
1525 goto cifs_parse_mount_err; 1523 goto cifs_parse_mount_err;
1526 } 1524 }
1527 vol->rsize = option; 1525 vol->rsize = option;
1528 break; 1526 break;
1529 case Opt_wsize: 1527 case Opt_wsize:
1530 if (get_option_ul(args, &option)) { 1528 if (get_option_ul(args, &option)) {
1531 cERROR(1, "%s: Invalid wsize value", 1529 cifs_dbg(VFS, "%s: Invalid wsize value\n",
1532 __func__); 1530 __func__);
1533 goto cifs_parse_mount_err; 1531 goto cifs_parse_mount_err;
1534 } 1532 }
1535 vol->wsize = option; 1533 vol->wsize = option;
1536 break; 1534 break;
1537 case Opt_actimeo: 1535 case Opt_actimeo:
1538 if (get_option_ul(args, &option)) { 1536 if (get_option_ul(args, &option)) {
1539 cERROR(1, "%s: Invalid actimeo value", 1537 cifs_dbg(VFS, "%s: Invalid actimeo value\n",
1540 __func__); 1538 __func__);
1541 goto cifs_parse_mount_err; 1539 goto cifs_parse_mount_err;
1542 } 1540 }
1543 vol->actimeo = HZ * option; 1541 vol->actimeo = HZ * option;
1544 if (vol->actimeo > CIFS_MAX_ACTIMEO) { 1542 if (vol->actimeo > CIFS_MAX_ACTIMEO) {
1545 cERROR(1, "CIFS: attribute cache" 1543 cifs_dbg(VFS, "attribute cache timeout too large\n");
1546 "timeout too large");
1547 goto cifs_parse_mount_err; 1544 goto cifs_parse_mount_err;
1548 } 1545 }
1549 break; 1546 break;
@@ -1566,11 +1563,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1566 goto cifs_parse_mount_err; 1563 goto cifs_parse_mount_err;
1567 } 1564 }
1568 vol->username = kstrdup(string, GFP_KERNEL); 1565 vol->username = kstrdup(string, GFP_KERNEL);
1569 if (!vol->username) { 1566 if (!vol->username)
1570 printk(KERN_WARNING "CIFS: no memory "
1571 "for username\n");
1572 goto cifs_parse_mount_err; 1567 goto cifs_parse_mount_err;
1573 }
1574 break; 1568 break;
1575 case Opt_blank_pass: 1569 case Opt_blank_pass:
1576 /* passwords have to be handled differently 1570 /* passwords have to be handled differently
@@ -1675,7 +1669,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1675 "for domainname\n"); 1669 "for domainname\n");
1676 goto cifs_parse_mount_err; 1670 goto cifs_parse_mount_err;
1677 } 1671 }
1678 cFYI(1, "Domain name set"); 1672 cifs_dbg(FYI, "Domain name set\n");
1679 break; 1673 break;
1680 case Opt_srcaddr: 1674 case Opt_srcaddr:
1681 string = match_strdup(args); 1675 string = match_strdup(args);
@@ -1713,7 +1707,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1713 /* if iocharset not set then load_nls_default 1707 /* if iocharset not set then load_nls_default
1714 * is used by caller 1708 * is used by caller
1715 */ 1709 */
1716 cFYI(1, "iocharset set to %s", string); 1710 cifs_dbg(FYI, "iocharset set to %s\n", string);
1717 break; 1711 break;
1718 case Opt_netbiosname: 1712 case Opt_netbiosname:
1719 string = match_strdup(args); 1713 string = match_strdup(args);
@@ -1827,20 +1821,18 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1827#ifndef CONFIG_KEYS 1821#ifndef CONFIG_KEYS
1828 /* Muliuser mounts require CONFIG_KEYS support */ 1822 /* Muliuser mounts require CONFIG_KEYS support */
1829 if (vol->multiuser) { 1823 if (vol->multiuser) {
1830 cERROR(1, "Multiuser mounts require kernels with " 1824 cifs_dbg(VFS, "Multiuser mounts require kernels with CONFIG_KEYS enabled\n");
1831 "CONFIG_KEYS enabled.");
1832 goto cifs_parse_mount_err; 1825 goto cifs_parse_mount_err;
1833 } 1826 }
1834#endif 1827#endif
1835 if (!vol->UNC) { 1828 if (!vol->UNC) {
1836 cERROR(1, "CIFS mount error: No usable UNC path provided in " 1829 cifs_dbg(VFS, "CIFS mount error: No usable UNC path provided in device string or in unc= option!\n");
1837 "device string or in unc= option!");
1838 goto cifs_parse_mount_err; 1830 goto cifs_parse_mount_err;
1839 } 1831 }
1840 1832
1841 /* make sure UNC has a share name */ 1833 /* make sure UNC has a share name */
1842 if (!strchr(vol->UNC + 3, '\\')) { 1834 if (!strchr(vol->UNC + 3, '\\')) {
1843 cERROR(1, "Malformed UNC. Unable to find share name."); 1835 cifs_dbg(VFS, "Malformed UNC. Unable to find share name.\n");
1844 goto cifs_parse_mount_err; 1836 goto cifs_parse_mount_err;
1845 } 1837 }
1846 1838
@@ -2061,7 +2053,7 @@ cifs_find_tcp_session(struct smb_vol *vol)
2061 2053
2062 ++server->srv_count; 2054 ++server->srv_count;
2063 spin_unlock(&cifs_tcp_ses_lock); 2055 spin_unlock(&cifs_tcp_ses_lock);
2064 cFYI(1, "Existing tcp session with server found"); 2056 cifs_dbg(FYI, "Existing tcp session with server found\n");
2065 return server; 2057 return server;
2066 } 2058 }
2067 spin_unlock(&cifs_tcp_ses_lock); 2059 spin_unlock(&cifs_tcp_ses_lock);
@@ -2108,7 +2100,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
2108 struct TCP_Server_Info *tcp_ses = NULL; 2100 struct TCP_Server_Info *tcp_ses = NULL;
2109 int rc; 2101 int rc;
2110 2102
2111 cFYI(1, "UNC: %s", volume_info->UNC); 2103 cifs_dbg(FYI, "UNC: %s\n", volume_info->UNC);
2112 2104
2113 /* see if we already have a matching tcp_ses */ 2105 /* see if we already have a matching tcp_ses */
2114 tcp_ses = cifs_find_tcp_session(volume_info); 2106 tcp_ses = cifs_find_tcp_session(volume_info);
@@ -2123,7 +2115,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
2123 2115
2124 rc = cifs_crypto_shash_allocate(tcp_ses); 2116 rc = cifs_crypto_shash_allocate(tcp_ses);
2125 if (rc) { 2117 if (rc) {
2126 cERROR(1, "could not setup hash structures rc %d", rc); 2118 cifs_dbg(VFS, "could not setup hash structures rc %d\n", rc);
2127 goto out_err; 2119 goto out_err;
2128 } 2120 }
2129 2121
@@ -2170,7 +2162,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
2170 2162
2171 rc = ip_connect(tcp_ses); 2163 rc = ip_connect(tcp_ses);
2172 if (rc < 0) { 2164 if (rc < 0) {
2173 cERROR(1, "Error connecting to socket. Aborting operation"); 2165 cifs_dbg(VFS, "Error connecting to socket. Aborting operation.\n");
2174 goto out_err_crypto_release; 2166 goto out_err_crypto_release;
2175 } 2167 }
2176 2168
@@ -2183,7 +2175,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
2183 tcp_ses, "cifsd"); 2175 tcp_ses, "cifsd");
2184 if (IS_ERR(tcp_ses->tsk)) { 2176 if (IS_ERR(tcp_ses->tsk)) {
2185 rc = PTR_ERR(tcp_ses->tsk); 2177 rc = PTR_ERR(tcp_ses->tsk);
2186 cERROR(1, "error %d create cifsd thread", rc); 2178 cifs_dbg(VFS, "error %d create cifsd thread\n", rc);
2187 module_put(THIS_MODULE); 2179 module_put(THIS_MODULE);
2188 goto out_err_crypto_release; 2180 goto out_err_crypto_release;
2189 } 2181 }
@@ -2270,7 +2262,7 @@ cifs_put_smb_ses(struct cifs_ses *ses)
2270 unsigned int xid; 2262 unsigned int xid;
2271 struct TCP_Server_Info *server = ses->server; 2263 struct TCP_Server_Info *server = ses->server;
2272 2264
2273 cFYI(1, "%s: ses_count=%d", __func__, ses->ses_count); 2265 cifs_dbg(FYI, "%s: ses_count=%d\n", __func__, ses->ses_count);
2274 spin_lock(&cifs_tcp_ses_lock); 2266 spin_lock(&cifs_tcp_ses_lock);
2275 if (--ses->ses_count > 0) { 2267 if (--ses->ses_count > 0) {
2276 spin_unlock(&cifs_tcp_ses_lock); 2268 spin_unlock(&cifs_tcp_ses_lock);
@@ -2322,23 +2314,24 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
2322 sprintf(desc, "cifs:a:%pI6c", &sa6->sin6_addr.s6_addr); 2314 sprintf(desc, "cifs:a:%pI6c", &sa6->sin6_addr.s6_addr);
2323 break; 2315 break;
2324 default: 2316 default:
2325 cFYI(1, "Bad ss_family (%hu)", server->dstaddr.ss_family); 2317 cifs_dbg(FYI, "Bad ss_family (%hu)\n",
2318 server->dstaddr.ss_family);
2326 rc = -EINVAL; 2319 rc = -EINVAL;
2327 goto out_err; 2320 goto out_err;
2328 } 2321 }
2329 2322
2330 cFYI(1, "%s: desc=%s", __func__, desc); 2323 cifs_dbg(FYI, "%s: desc=%s\n", __func__, desc);
2331 key = request_key(&key_type_logon, desc, ""); 2324 key = request_key(&key_type_logon, desc, "");
2332 if (IS_ERR(key)) { 2325 if (IS_ERR(key)) {
2333 if (!ses->domainName) { 2326 if (!ses->domainName) {
2334 cFYI(1, "domainName is NULL"); 2327 cifs_dbg(FYI, "domainName is NULL\n");
2335 rc = PTR_ERR(key); 2328 rc = PTR_ERR(key);
2336 goto out_err; 2329 goto out_err;
2337 } 2330 }
2338 2331
2339 /* didn't work, try to find a domain key */ 2332 /* didn't work, try to find a domain key */
2340 sprintf(desc, "cifs:d:%s", ses->domainName); 2333 sprintf(desc, "cifs:d:%s", ses->domainName);
2341 cFYI(1, "%s: desc=%s", __func__, desc); 2334 cifs_dbg(FYI, "%s: desc=%s\n", __func__, desc);
2342 key = request_key(&key_type_logon, desc, ""); 2335 key = request_key(&key_type_logon, desc, "");
2343 if (IS_ERR(key)) { 2336 if (IS_ERR(key)) {
2344 rc = PTR_ERR(key); 2337 rc = PTR_ERR(key);
@@ -2356,32 +2349,34 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
2356 /* find first : in payload */ 2349 /* find first : in payload */
2357 payload = (char *)upayload->data; 2350 payload = (char *)upayload->data;
2358 delim = strnchr(payload, upayload->datalen, ':'); 2351 delim = strnchr(payload, upayload->datalen, ':');
2359 cFYI(1, "payload=%s", payload); 2352 cifs_dbg(FYI, "payload=%s\n", payload);
2360 if (!delim) { 2353 if (!delim) {
2361 cFYI(1, "Unable to find ':' in payload (datalen=%d)", 2354 cifs_dbg(FYI, "Unable to find ':' in payload (datalen=%d)\n",
2362 upayload->datalen); 2355 upayload->datalen);
2363 rc = -EINVAL; 2356 rc = -EINVAL;
2364 goto out_key_put; 2357 goto out_key_put;
2365 } 2358 }
2366 2359
2367 len = delim - payload; 2360 len = delim - payload;
2368 if (len > MAX_USERNAME_SIZE || len <= 0) { 2361 if (len > MAX_USERNAME_SIZE || len <= 0) {
2369 cFYI(1, "Bad value from username search (len=%zd)", len); 2362 cifs_dbg(FYI, "Bad value from username search (len=%zd)\n",
2363 len);
2370 rc = -EINVAL; 2364 rc = -EINVAL;
2371 goto out_key_put; 2365 goto out_key_put;
2372 } 2366 }
2373 2367
2374 vol->username = kstrndup(payload, len, GFP_KERNEL); 2368 vol->username = kstrndup(payload, len, GFP_KERNEL);
2375 if (!vol->username) { 2369 if (!vol->username) {
2376 cFYI(1, "Unable to allocate %zd bytes for username", len); 2370 cifs_dbg(FYI, "Unable to allocate %zd bytes for username\n",
2371 len);
2377 rc = -ENOMEM; 2372 rc = -ENOMEM;
2378 goto out_key_put; 2373 goto out_key_put;
2379 } 2374 }
2380 cFYI(1, "%s: username=%s", __func__, vol->username); 2375 cifs_dbg(FYI, "%s: username=%s\n", __func__, vol->username);
2381 2376
2382 len = key->datalen - (len + 1); 2377 len = key->datalen - (len + 1);
2383 if (len > MAX_PASSWORD_SIZE || len <= 0) { 2378 if (len > MAX_PASSWORD_SIZE || len <= 0) {
2384 cFYI(1, "Bad len for password search (len=%zd)", len); 2379 cifs_dbg(FYI, "Bad len for password search (len=%zd)\n", len);
2385 rc = -EINVAL; 2380 rc = -EINVAL;
2386 kfree(vol->username); 2381 kfree(vol->username);
2387 vol->username = NULL; 2382 vol->username = NULL;
@@ -2391,7 +2386,8 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
2391 ++delim; 2386 ++delim;
2392 vol->password = kstrndup(delim, len, GFP_KERNEL); 2387 vol->password = kstrndup(delim, len, GFP_KERNEL);
2393 if (!vol->password) { 2388 if (!vol->password) {
2394 cFYI(1, "Unable to allocate %zd bytes for password", len); 2389 cifs_dbg(FYI, "Unable to allocate %zd bytes for password\n",
2390 len);
2395 rc = -ENOMEM; 2391 rc = -ENOMEM;
2396 kfree(vol->username); 2392 kfree(vol->username);
2397 vol->username = NULL; 2393 vol->username = NULL;
@@ -2403,7 +2399,7 @@ out_key_put:
2403 key_put(key); 2399 key_put(key);
2404out_err: 2400out_err:
2405 kfree(desc); 2401 kfree(desc);
2406 cFYI(1, "%s: returning %d", __func__, rc); 2402 cifs_dbg(FYI, "%s: returning %d\n", __func__, rc);
2407 return rc; 2403 return rc;
2408} 2404}
2409#else /* ! CONFIG_KEYS */ 2405#else /* ! CONFIG_KEYS */
@@ -2428,7 +2424,8 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2428 2424
2429 ses = cifs_find_smb_ses(server, volume_info); 2425 ses = cifs_find_smb_ses(server, volume_info);
2430 if (ses) { 2426 if (ses) {
2431 cFYI(1, "Existing smb sess found (status=%d)", ses->status); 2427 cifs_dbg(FYI, "Existing smb sess found (status=%d)\n",
2428 ses->status);
2432 2429
2433 mutex_lock(&ses->session_mutex); 2430 mutex_lock(&ses->session_mutex);
2434 rc = cifs_negotiate_protocol(xid, ses); 2431 rc = cifs_negotiate_protocol(xid, ses);
@@ -2440,7 +2437,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2440 return ERR_PTR(rc); 2437 return ERR_PTR(rc);
2441 } 2438 }
2442 if (ses->need_reconnect) { 2439 if (ses->need_reconnect) {
2443 cFYI(1, "Session needs reconnect"); 2440 cifs_dbg(FYI, "Session needs reconnect\n");
2444 rc = cifs_setup_session(xid, ses, 2441 rc = cifs_setup_session(xid, ses,
2445 volume_info->local_nls); 2442 volume_info->local_nls);
2446 if (rc) { 2443 if (rc) {
@@ -2459,7 +2456,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2459 return ses; 2456 return ses;
2460 } 2457 }
2461 2458
2462 cFYI(1, "Existing smb sess not found"); 2459 cifs_dbg(FYI, "Existing smb sess not found\n");
2463 ses = sesInfoAlloc(); 2460 ses = sesInfoAlloc();
2464 if (ses == NULL) 2461 if (ses == NULL)
2465 goto get_ses_fail; 2462 goto get_ses_fail;
@@ -2549,7 +2546,7 @@ cifs_put_tcon(struct cifs_tcon *tcon)
2549 unsigned int xid; 2546 unsigned int xid;
2550 struct cifs_ses *ses = tcon->ses; 2547 struct cifs_ses *ses = tcon->ses;
2551 2548
2552 cFYI(1, "%s: tc_count=%d", __func__, tcon->tc_count); 2549 cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count);
2553 spin_lock(&cifs_tcp_ses_lock); 2550 spin_lock(&cifs_tcp_ses_lock);
2554 if (--tcon->tc_count > 0) { 2551 if (--tcon->tc_count > 0) {
2555 spin_unlock(&cifs_tcp_ses_lock); 2552 spin_unlock(&cifs_tcp_ses_lock);
@@ -2577,12 +2574,11 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
2577 2574
2578 tcon = cifs_find_tcon(ses, volume_info->UNC); 2575 tcon = cifs_find_tcon(ses, volume_info->UNC);
2579 if (tcon) { 2576 if (tcon) {
2580 cFYI(1, "Found match on UNC path"); 2577 cifs_dbg(FYI, "Found match on UNC path\n");
2581 /* existing tcon already has a reference */ 2578 /* existing tcon already has a reference */
2582 cifs_put_smb_ses(ses); 2579 cifs_put_smb_ses(ses);
2583 if (tcon->seal != volume_info->seal) 2580 if (tcon->seal != volume_info->seal)
2584 cERROR(1, "transport encryption setting " 2581 cifs_dbg(VFS, "transport encryption setting conflicts with existing tid\n");
2585 "conflicts with existing tid");
2586 return tcon; 2582 return tcon;
2587 } 2583 }
2588 2584
@@ -2614,13 +2610,13 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
2614 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, 2610 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon,
2615 volume_info->local_nls); 2611 volume_info->local_nls);
2616 free_xid(xid); 2612 free_xid(xid);
2617 cFYI(1, "Tcon rc = %d", rc); 2613 cifs_dbg(FYI, "Tcon rc = %d\n", rc);
2618 if (rc) 2614 if (rc)
2619 goto out_fail; 2615 goto out_fail;
2620 2616
2621 if (volume_info->nodfs) { 2617 if (volume_info->nodfs) {
2622 tcon->Flags &= ~SMB_SHARE_IS_IN_DFS; 2618 tcon->Flags &= ~SMB_SHARE_IS_IN_DFS;
2623 cFYI(1, "DFS disabled (%d)", tcon->Flags); 2619 cifs_dbg(FYI, "DFS disabled (%d)\n", tcon->Flags);
2624 } 2620 }
2625 tcon->seal = volume_info->seal; 2621 tcon->seal = volume_info->seal;
2626 /* 2622 /*
@@ -2774,7 +2770,7 @@ get_dfs_path(const unsigned int xid, struct cifs_ses *ses, const char *old_path,
2774 strcpy(temp_unc + 2 + strlen(ses->serverName), "\\IPC$"); 2770 strcpy(temp_unc + 2 + strlen(ses->serverName), "\\IPC$");
2775 rc = ses->server->ops->tree_connect(xid, ses, temp_unc, NULL, 2771 rc = ses->server->ops->tree_connect(xid, ses, temp_unc, NULL,
2776 nls_codepage); 2772 nls_codepage);
2777 cFYI(1, "Tcon rc = %d ipc_tid = %d", rc, ses->ipc_tid); 2773 cifs_dbg(FYI, "Tcon rc = %d ipc_tid = %d\n", rc, ses->ipc_tid);
2778 kfree(temp_unc); 2774 kfree(temp_unc);
2779 } 2775 }
2780 if (rc == 0) 2776 if (rc == 0)
@@ -2852,13 +2848,11 @@ bind_socket(struct TCP_Server_Info *server)
2852 saddr4 = (struct sockaddr_in *)&server->srcaddr; 2848 saddr4 = (struct sockaddr_in *)&server->srcaddr;
2853 saddr6 = (struct sockaddr_in6 *)&server->srcaddr; 2849 saddr6 = (struct sockaddr_in6 *)&server->srcaddr;
2854 if (saddr6->sin6_family == AF_INET6) 2850 if (saddr6->sin6_family == AF_INET6)
2855 cERROR(1, "cifs: " 2851 cifs_dbg(VFS, "Failed to bind to: %pI6c, error: %d\n",
2856 "Failed to bind to: %pI6c, error: %d", 2852 &saddr6->sin6_addr, rc);
2857 &saddr6->sin6_addr, rc);
2858 else 2853 else
2859 cERROR(1, "cifs: " 2854 cifs_dbg(VFS, "Failed to bind to: %pI4, error: %d\n",
2860 "Failed to bind to: %pI4, error: %d", 2855 &saddr4->sin_addr.s_addr, rc);
2861 &saddr4->sin_addr.s_addr, rc);
2862 } 2856 }
2863 } 2857 }
2864 return rc; 2858 return rc;
@@ -2963,13 +2957,13 @@ generic_ip_connect(struct TCP_Server_Info *server)
2963 rc = __sock_create(cifs_net_ns(server), sfamily, SOCK_STREAM, 2957 rc = __sock_create(cifs_net_ns(server), sfamily, SOCK_STREAM,
2964 IPPROTO_TCP, &socket, 1); 2958 IPPROTO_TCP, &socket, 1);
2965 if (rc < 0) { 2959 if (rc < 0) {
2966 cERROR(1, "Error %d creating socket", rc); 2960 cifs_dbg(VFS, "Error %d creating socket\n", rc);
2967 server->ssocket = NULL; 2961 server->ssocket = NULL;
2968 return rc; 2962 return rc;
2969 } 2963 }
2970 2964
2971 /* BB other socket options to set KEEPALIVE, NODELAY? */ 2965 /* BB other socket options to set KEEPALIVE, NODELAY? */
2972 cFYI(1, "Socket created"); 2966 cifs_dbg(FYI, "Socket created\n");
2973 server->ssocket = socket; 2967 server->ssocket = socket;
2974 socket->sk->sk_allocation = GFP_NOFS; 2968 socket->sk->sk_allocation = GFP_NOFS;
2975 if (sfamily == AF_INET6) 2969 if (sfamily == AF_INET6)
@@ -3003,16 +2997,17 @@ generic_ip_connect(struct TCP_Server_Info *server)
3003 rc = kernel_setsockopt(socket, SOL_TCP, TCP_NODELAY, 2997 rc = kernel_setsockopt(socket, SOL_TCP, TCP_NODELAY,
3004 (char *)&val, sizeof(val)); 2998 (char *)&val, sizeof(val));
3005 if (rc) 2999 if (rc)
3006 cFYI(1, "set TCP_NODELAY socket option error %d", rc); 3000 cifs_dbg(FYI, "set TCP_NODELAY socket option error %d\n",
3001 rc);
3007 } 3002 }
3008 3003
3009 cFYI(1, "sndbuf %d rcvbuf %d rcvtimeo 0x%lx", 3004 cifs_dbg(FYI, "sndbuf %d rcvbuf %d rcvtimeo 0x%lx\n",
3010 socket->sk->sk_sndbuf, 3005 socket->sk->sk_sndbuf,
3011 socket->sk->sk_rcvbuf, socket->sk->sk_rcvtimeo); 3006 socket->sk->sk_rcvbuf, socket->sk->sk_rcvtimeo);
3012 3007
3013 rc = socket->ops->connect(socket, saddr, slen, 0); 3008 rc = socket->ops->connect(socket, saddr, slen, 0);
3014 if (rc < 0) { 3009 if (rc < 0) {
3015 cFYI(1, "Error %d connecting to server", rc); 3010 cifs_dbg(FYI, "Error %d connecting to server\n", rc);
3016 sock_release(socket); 3011 sock_release(socket);
3017 server->ssocket = NULL; 3012 server->ssocket = NULL;
3018 return rc; 3013 return rc;
@@ -3070,19 +3065,19 @@ void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
3070 if (vol_info && vol_info->no_linux_ext) { 3065 if (vol_info && vol_info->no_linux_ext) {
3071 tcon->fsUnixInfo.Capability = 0; 3066 tcon->fsUnixInfo.Capability = 0;
3072 tcon->unix_ext = 0; /* Unix Extensions disabled */ 3067 tcon->unix_ext = 0; /* Unix Extensions disabled */
3073 cFYI(1, "Linux protocol extensions disabled"); 3068 cifs_dbg(FYI, "Linux protocol extensions disabled\n");
3074 return; 3069 return;
3075 } else if (vol_info) 3070 } else if (vol_info)
3076 tcon->unix_ext = 1; /* Unix Extensions supported */ 3071 tcon->unix_ext = 1; /* Unix Extensions supported */
3077 3072
3078 if (tcon->unix_ext == 0) { 3073 if (tcon->unix_ext == 0) {
3079 cFYI(1, "Unix extensions disabled so not set on reconnect"); 3074 cifs_dbg(FYI, "Unix extensions disabled so not set on reconnect\n");
3080 return; 3075 return;
3081 } 3076 }
3082 3077
3083 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { 3078 if (!CIFSSMBQFSUnixInfo(xid, tcon)) {
3084 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); 3079 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability);
3085 cFYI(1, "unix caps which server supports %lld", cap); 3080 cifs_dbg(FYI, "unix caps which server supports %lld\n", cap);
3086 /* check for reconnect case in which we do not 3081 /* check for reconnect case in which we do not
3087 want to change the mount behavior if we can avoid it */ 3082 want to change the mount behavior if we can avoid it */
3088 if (vol_info == NULL) { 3083 if (vol_info == NULL) {
@@ -3092,22 +3087,22 @@ void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
3092 cap &= ~CIFS_UNIX_POSIX_ACL_CAP; 3087 cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
3093 if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) { 3088 if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) {
3094 if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) 3089 if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP)
3095 cERROR(1, "POSIXPATH support change"); 3090 cifs_dbg(VFS, "POSIXPATH support change\n");
3096 cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP; 3091 cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
3097 } else if ((cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) { 3092 } else if ((cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) {
3098 cERROR(1, "possible reconnect error"); 3093 cifs_dbg(VFS, "possible reconnect error\n");
3099 cERROR(1, "server disabled POSIX path support"); 3094 cifs_dbg(VFS, "server disabled POSIX path support\n");
3100 } 3095 }
3101 } 3096 }
3102 3097
3103 if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP) 3098 if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)
3104 cERROR(1, "per-share encryption not supported yet"); 3099 cifs_dbg(VFS, "per-share encryption not supported yet\n");
3105 3100
3106 cap &= CIFS_UNIX_CAP_MASK; 3101 cap &= CIFS_UNIX_CAP_MASK;
3107 if (vol_info && vol_info->no_psx_acl) 3102 if (vol_info && vol_info->no_psx_acl)
3108 cap &= ~CIFS_UNIX_POSIX_ACL_CAP; 3103 cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
3109 else if (CIFS_UNIX_POSIX_ACL_CAP & cap) { 3104 else if (CIFS_UNIX_POSIX_ACL_CAP & cap) {
3110 cFYI(1, "negotiated posix acl support"); 3105 cifs_dbg(FYI, "negotiated posix acl support\n");
3111 if (cifs_sb) 3106 if (cifs_sb)
3112 cifs_sb->mnt_cifs_flags |= 3107 cifs_sb->mnt_cifs_flags |=
3113 CIFS_MOUNT_POSIXACL; 3108 CIFS_MOUNT_POSIXACL;
@@ -3116,43 +3111,38 @@ void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
3116 if (vol_info && vol_info->posix_paths == 0) 3111 if (vol_info && vol_info->posix_paths == 0)
3117 cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP; 3112 cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
3118 else if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) { 3113 else if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
3119 cFYI(1, "negotiate posix pathnames"); 3114 cifs_dbg(FYI, "negotiate posix pathnames\n");
3120 if (cifs_sb) 3115 if (cifs_sb)
3121 cifs_sb->mnt_cifs_flags |= 3116 cifs_sb->mnt_cifs_flags |=
3122 CIFS_MOUNT_POSIX_PATHS; 3117 CIFS_MOUNT_POSIX_PATHS;
3123 } 3118 }
3124 3119
3125 cFYI(1, "Negotiate caps 0x%x", (int)cap); 3120 cifs_dbg(FYI, "Negotiate caps 0x%x\n", (int)cap);
3126#ifdef CONFIG_CIFS_DEBUG2 3121#ifdef CONFIG_CIFS_DEBUG2
3127 if (cap & CIFS_UNIX_FCNTL_CAP) 3122 if (cap & CIFS_UNIX_FCNTL_CAP)
3128 cFYI(1, "FCNTL cap"); 3123 cifs_dbg(FYI, "FCNTL cap\n");
3129 if (cap & CIFS_UNIX_EXTATTR_CAP) 3124 if (cap & CIFS_UNIX_EXTATTR_CAP)
3130 cFYI(1, "EXTATTR cap"); 3125 cifs_dbg(FYI, "EXTATTR cap\n");
3131 if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) 3126 if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP)
3132 cFYI(1, "POSIX path cap"); 3127 cifs_dbg(FYI, "POSIX path cap\n");
3133 if (cap & CIFS_UNIX_XATTR_CAP) 3128 if (cap & CIFS_UNIX_XATTR_CAP)
3134 cFYI(1, "XATTR cap"); 3129 cifs_dbg(FYI, "XATTR cap\n");
3135 if (cap & CIFS_UNIX_POSIX_ACL_CAP) 3130 if (cap & CIFS_UNIX_POSIX_ACL_CAP)
3136 cFYI(1, "POSIX ACL cap"); 3131 cifs_dbg(FYI, "POSIX ACL cap\n");
3137 if (cap & CIFS_UNIX_LARGE_READ_CAP) 3132 if (cap & CIFS_UNIX_LARGE_READ_CAP)
3138 cFYI(1, "very large read cap"); 3133 cifs_dbg(FYI, "very large read cap\n");
3139 if (cap & CIFS_UNIX_LARGE_WRITE_CAP) 3134 if (cap & CIFS_UNIX_LARGE_WRITE_CAP)
3140 cFYI(1, "very large write cap"); 3135 cifs_dbg(FYI, "very large write cap\n");
3141 if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP) 3136 if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP)
3142 cFYI(1, "transport encryption cap"); 3137 cifs_dbg(FYI, "transport encryption cap\n");
3143 if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP) 3138 if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)
3144 cFYI(1, "mandatory transport encryption cap"); 3139 cifs_dbg(FYI, "mandatory transport encryption cap\n");
3145#endif /* CIFS_DEBUG2 */ 3140#endif /* CIFS_DEBUG2 */
3146 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { 3141 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
3147 if (vol_info == NULL) { 3142 if (vol_info == NULL) {
3148 cFYI(1, "resetting capabilities failed"); 3143 cifs_dbg(FYI, "resetting capabilities failed\n");
3149 } else 3144 } else
3150 cERROR(1, "Negotiating Unix capabilities " 3145 cifs_dbg(VFS, "Negotiating Unix capabilities with the server failed. Consider mounting with the Unix Extensions disabled if problems are found by specifying the nounix mount option.\n");
3151 "with the server failed. Consider "
3152 "mounting with the Unix Extensions "
3153 "disabled if problems are found "
3154 "by specifying the nounix mount "
3155 "option.");
3156 3146
3157 } 3147 }
3158 } 3148 }
@@ -3177,8 +3167,8 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
3177 cifs_sb->mnt_gid = pvolume_info->linux_gid; 3167 cifs_sb->mnt_gid = pvolume_info->linux_gid;
3178 cifs_sb->mnt_file_mode = pvolume_info->file_mode; 3168 cifs_sb->mnt_file_mode = pvolume_info->file_mode;
3179 cifs_sb->mnt_dir_mode = pvolume_info->dir_mode; 3169 cifs_sb->mnt_dir_mode = pvolume_info->dir_mode;
3180 cFYI(1, "file mode: 0x%hx dir mode: 0x%hx", 3170 cifs_dbg(FYI, "file mode: 0x%hx dir mode: 0x%hx\n",
3181 cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode); 3171 cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode);
3182 3172
3183 cifs_sb->actimeo = pvolume_info->actimeo; 3173 cifs_sb->actimeo = pvolume_info->actimeo;
3184 cifs_sb->local_nls = pvolume_info->local_nls; 3174 cifs_sb->local_nls = pvolume_info->local_nls;
@@ -3227,21 +3217,19 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
3227 if (pvolume_info->strict_io) 3217 if (pvolume_info->strict_io)
3228 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_STRICT_IO; 3218 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_STRICT_IO;
3229 if (pvolume_info->direct_io) { 3219 if (pvolume_info->direct_io) {
3230 cFYI(1, "mounting share using direct i/o"); 3220 cifs_dbg(FYI, "mounting share using direct i/o\n");
3231 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; 3221 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;
3232 } 3222 }
3233 if (pvolume_info->mfsymlinks) { 3223 if (pvolume_info->mfsymlinks) {
3234 if (pvolume_info->sfu_emul) { 3224 if (pvolume_info->sfu_emul) {
3235 cERROR(1, "mount option mfsymlinks ignored if sfu " 3225 cifs_dbg(VFS, "mount option mfsymlinks ignored if sfu mount option is used\n");
3236 "mount option is used");
3237 } else { 3226 } else {
3238 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MF_SYMLINKS; 3227 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MF_SYMLINKS;
3239 } 3228 }
3240 } 3229 }
3241 3230
3242 if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm)) 3231 if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm))
3243 cERROR(1, "mount option dynperm ignored if cifsacl " 3232 cifs_dbg(VFS, "mount option dynperm ignored if cifsacl mount option supported\n");
3244 "mount option supported");
3245} 3233}
3246 3234
3247static void 3235static void
@@ -3293,7 +3281,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
3293 3281
3294 *pos = '\0'; /* add trailing null */ 3282 *pos = '\0'; /* add trailing null */
3295 convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb)); 3283 convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb));
3296 cFYI(1, "%s: full_path=%s", __func__, full_path); 3284 cifs_dbg(FYI, "%s: full_path=%s\n", __func__, full_path);
3297 return full_path; 3285 return full_path;
3298} 3286}
3299 3287
@@ -3364,14 +3352,14 @@ cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
3364 return -EINVAL; 3352 return -EINVAL;
3365 3353
3366 if (volume_info->nullauth) { 3354 if (volume_info->nullauth) {
3367 cFYI(1, "Anonymous login"); 3355 cifs_dbg(FYI, "Anonymous login\n");
3368 kfree(volume_info->username); 3356 kfree(volume_info->username);
3369 volume_info->username = NULL; 3357 volume_info->username = NULL;
3370 } else if (volume_info->username) { 3358 } else if (volume_info->username) {
3371 /* BB fixme parse for domain name here */ 3359 /* BB fixme parse for domain name here */
3372 cFYI(1, "Username: %s", volume_info->username); 3360 cifs_dbg(FYI, "Username: %s\n", volume_info->username);
3373 } else { 3361 } else {
3374 cifserror("No username specified"); 3362 cifs_dbg(VFS, "No username specified\n");
3375 /* In userspace mount helper we can get user name from alternate 3363 /* In userspace mount helper we can get user name from alternate
3376 locations such as env variables and files on disk */ 3364 locations such as env variables and files on disk */
3377 return -EINVAL; 3365 return -EINVAL;
@@ -3384,7 +3372,7 @@ cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
3384 } else { 3372 } else {
3385 volume_info->local_nls = load_nls(volume_info->iocharset); 3373 volume_info->local_nls = load_nls(volume_info->iocharset);
3386 if (volume_info->local_nls == NULL) { 3374 if (volume_info->local_nls == NULL) {
3387 cERROR(1, "CIFS mount error: iocharset %s not found", 3375 cifs_dbg(VFS, "CIFS mount error: iocharset %s not found\n",
3388 volume_info->iocharset); 3376 volume_info->iocharset);
3389 return -ELIBACC; 3377 return -ELIBACC;
3390 } 3378 }
@@ -3734,13 +3722,13 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
3734 if (length == 3) { 3722 if (length == 3) {
3735 if ((bcc_ptr[0] == 'I') && (bcc_ptr[1] == 'P') && 3723 if ((bcc_ptr[0] == 'I') && (bcc_ptr[1] == 'P') &&
3736 (bcc_ptr[2] == 'C')) { 3724 (bcc_ptr[2] == 'C')) {
3737 cFYI(1, "IPC connection"); 3725 cifs_dbg(FYI, "IPC connection\n");
3738 tcon->ipc = 1; 3726 tcon->ipc = 1;
3739 } 3727 }
3740 } else if (length == 2) { 3728 } else if (length == 2) {
3741 if ((bcc_ptr[0] == 'A') && (bcc_ptr[1] == ':')) { 3729 if ((bcc_ptr[0] == 'A') && (bcc_ptr[1] == ':')) {
3742 /* the most common case */ 3730 /* the most common case */
3743 cFYI(1, "disk share connection"); 3731 cifs_dbg(FYI, "disk share connection\n");
3744 } 3732 }
3745 } 3733 }
3746 bcc_ptr += length + 1; 3734 bcc_ptr += length + 1;
@@ -3753,7 +3741,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
3753 bytes_left, is_unicode, 3741 bytes_left, is_unicode,
3754 nls_codepage); 3742 nls_codepage);
3755 3743
3756 cFYI(1, "nativeFileSystem=%s", tcon->nativeFileSystem); 3744 cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem);
3757 3745
3758 if ((smb_buffer_response->WordCount == 3) || 3746 if ((smb_buffer_response->WordCount == 3) ||
3759 (smb_buffer_response->WordCount == 7)) 3747 (smb_buffer_response->WordCount == 7))
@@ -3761,7 +3749,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
3761 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); 3749 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport);
3762 else 3750 else
3763 tcon->Flags = 0; 3751 tcon->Flags = 0;
3764 cFYI(1, "Tcon flags: 0x%x ", tcon->Flags); 3752 cifs_dbg(FYI, "Tcon flags: 0x%x\n", tcon->Flags);
3765 } else if ((rc == 0) && tcon == NULL) { 3753 } else if ((rc == 0) && tcon == NULL) {
3766 /* all we need to save for IPC$ connection */ 3754 /* all we need to save for IPC$ connection */
3767 ses->ipc_tid = smb_buffer_response->Tid; 3755 ses->ipc_tid = smb_buffer_response->Tid;
@@ -3839,14 +3827,14 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
3839 if (linuxExtEnabled == 0) 3827 if (linuxExtEnabled == 0)
3840 ses->capabilities &= (~server->vals->cap_unix); 3828 ses->capabilities &= (~server->vals->cap_unix);
3841 3829
3842 cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d", 3830 cifs_dbg(FYI, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d\n",
3843 server->sec_mode, server->capabilities, server->timeAdj); 3831 server->sec_mode, server->capabilities, server->timeAdj);
3844 3832
3845 if (server->ops->sess_setup) 3833 if (server->ops->sess_setup)
3846 rc = server->ops->sess_setup(xid, ses, nls_info); 3834 rc = server->ops->sess_setup(xid, ses, nls_info);
3847 3835
3848 if (rc) { 3836 if (rc) {
3849 cERROR(1, "Send error in SessSetup = %d", rc); 3837 cifs_dbg(VFS, "Send error in SessSetup = %d\n", rc);
3850 } else { 3838 } else {
3851 mutex_lock(&ses->server->srv_mutex); 3839 mutex_lock(&ses->server->srv_mutex);
3852 if (!server->session_estab) { 3840 if (!server->session_estab) {
@@ -3858,7 +3846,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
3858 } 3846 }
3859 mutex_unlock(&server->srv_mutex); 3847 mutex_unlock(&server->srv_mutex);
3860 3848
3861 cFYI(1, "CIFS Session Established successfully"); 3849 cifs_dbg(FYI, "CIFS Session Established successfully\n");
3862 spin_lock(&GlobalMid_Lock); 3850 spin_lock(&GlobalMid_Lock);
3863 ses->status = CifsGood; 3851 ses->status = CifsGood;
3864 ses->need_reconnect = false; 3852 ses->need_reconnect = false;
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 1cd016217448..46e455ece573 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -102,7 +102,7 @@ cifs_bp_rename_retry:
102 namelen += (1 + temp->d_name.len); 102 namelen += (1 + temp->d_name.len);
103 temp = temp->d_parent; 103 temp = temp->d_parent;
104 if (temp == NULL) { 104 if (temp == NULL) {
105 cERROR(1, "corrupt dentry"); 105 cifs_dbg(VFS, "corrupt dentry\n");
106 rcu_read_unlock(); 106 rcu_read_unlock();
107 return NULL; 107 return NULL;
108 } 108 }
@@ -124,12 +124,12 @@ cifs_bp_rename_retry:
124 full_path[namelen] = dirsep; 124 full_path[namelen] = dirsep;
125 strncpy(full_path + namelen + 1, temp->d_name.name, 125 strncpy(full_path + namelen + 1, temp->d_name.name,
126 temp->d_name.len); 126 temp->d_name.len);
127 cFYI(0, "name: %s", full_path + namelen); 127 cifs_dbg(FYI, "name: %s\n", full_path + namelen);
128 } 128 }
129 spin_unlock(&temp->d_lock); 129 spin_unlock(&temp->d_lock);
130 temp = temp->d_parent; 130 temp = temp->d_parent;
131 if (temp == NULL) { 131 if (temp == NULL) {
132 cERROR(1, "corrupt dentry"); 132 cifs_dbg(VFS, "corrupt dentry\n");
133 rcu_read_unlock(); 133 rcu_read_unlock();
134 kfree(full_path); 134 kfree(full_path);
135 return NULL; 135 return NULL;
@@ -137,8 +137,8 @@ cifs_bp_rename_retry:
137 } 137 }
138 rcu_read_unlock(); 138 rcu_read_unlock();
139 if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) { 139 if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) {
140 cFYI(1, "did not end path lookup where expected. namelen=%d " 140 cifs_dbg(FYI, "did not end path lookup where expected. namelen=%ddfsplen=%d\n",
141 "dfsplen=%d", namelen, dfsplen); 141 namelen, dfsplen);
142 /* presumably this is only possible if racing with a rename 142 /* presumably this is only possible if racing with a rename
143 of one of the parent directories (we can not lock the dentries 143 of one of the parent directories (we can not lock the dentries
144 above us to prevent this, but retrying should be harmless) */ 144 above us to prevent this, but retrying should be harmless) */
@@ -178,7 +178,7 @@ check_name(struct dentry *direntry)
178 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) { 178 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
179 for (i = 0; i < direntry->d_name.len; i++) { 179 for (i = 0; i < direntry->d_name.len; i++) {
180 if (direntry->d_name.name[i] == '\\') { 180 if (direntry->d_name.name[i] == '\\') {
181 cFYI(1, "Invalid file name"); 181 cifs_dbg(FYI, "Invalid file name\n");
182 return -EINVAL; 182 return -EINVAL;
183 } 183 }
184 } 184 }
@@ -291,7 +291,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
291 else if ((oflags & O_CREAT) == O_CREAT) 291 else if ((oflags & O_CREAT) == O_CREAT)
292 disposition = FILE_OPEN_IF; 292 disposition = FILE_OPEN_IF;
293 else 293 else
294 cFYI(1, "Create flag not set in create function"); 294 cifs_dbg(FYI, "Create flag not set in create function\n");
295 295
296 /* 296 /*
297 * BB add processing to set equivalent of mode - e.g. via CreateX with 297 * BB add processing to set equivalent of mode - e.g. via CreateX with
@@ -323,7 +323,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
323 desired_access, create_options, fid, oplock, 323 desired_access, create_options, fid, oplock,
324 buf, cifs_sb); 324 buf, cifs_sb);
325 if (rc) { 325 if (rc) {
326 cFYI(1, "cifs_create returned 0x%x", rc); 326 cifs_dbg(FYI, "cifs_create returned 0x%x\n", rc);
327 goto out; 327 goto out;
328 } 328 }
329 329
@@ -389,7 +389,8 @@ cifs_create_get_file_info:
389 389
390cifs_create_set_dentry: 390cifs_create_set_dentry:
391 if (rc != 0) { 391 if (rc != 0) {
392 cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); 392 cifs_dbg(FYI, "Create worked, get_inode_info failed rc = %d\n",
393 rc);
393 if (server->ops->close) 394 if (server->ops->close)
394 server->ops->close(xid, tcon, fid); 395 server->ops->close(xid, tcon, fid);
395 goto out; 396 goto out;
@@ -452,8 +453,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
452 453
453 xid = get_xid(); 454 xid = get_xid();
454 455
455 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 456 cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
456 inode, direntry->d_name.name, direntry); 457 inode, direntry->d_name.name, direntry);
457 458
458 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 459 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
459 if (IS_ERR(tlink)) 460 if (IS_ERR(tlink))
@@ -518,8 +519,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
518 __u32 oplock; 519 __u32 oplock;
519 int created = FILE_CREATED; 520 int created = FILE_CREATED;
520 521
521 cFYI(1, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p", 522 cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n",
522 inode, direntry->d_name.name, direntry); 523 inode, direntry->d_name.name, direntry);
523 524
524 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 525 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
525 rc = PTR_ERR(tlink); 526 rc = PTR_ERR(tlink);
@@ -613,7 +614,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
613 goto mknod_out; 614 goto mknod_out;
614 615
615 616
616 cFYI(1, "sfu compat create special file"); 617 cifs_dbg(FYI, "sfu compat create special file\n");
617 618
618 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); 619 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
619 if (buf == NULL) { 620 if (buf == NULL) {
@@ -688,8 +689,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
688 689
689 xid = get_xid(); 690 xid = get_xid();
690 691
691 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 692 cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
692 parent_dir_inode, direntry->d_name.name, direntry); 693 parent_dir_inode, direntry->d_name.name, direntry);
693 694
694 /* check whether path exists */ 695 /* check whether path exists */
695 696
@@ -715,11 +716,12 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
715 } 716 }
716 717
717 if (direntry->d_inode != NULL) { 718 if (direntry->d_inode != NULL) {
718 cFYI(1, "non-NULL inode in lookup"); 719 cifs_dbg(FYI, "non-NULL inode in lookup\n");
719 } else { 720 } else {
720 cFYI(1, "NULL inode in lookup"); 721 cifs_dbg(FYI, "NULL inode in lookup\n");
721 } 722 }
722 cFYI(1, "Full path: %s inode = 0x%p", full_path, direntry->d_inode); 723 cifs_dbg(FYI, "Full path: %s inode = 0x%p\n",
724 full_path, direntry->d_inode);
723 725
724 if (pTcon->unix_ext) { 726 if (pTcon->unix_ext) {
725 rc = cifs_get_inode_info_unix(&newInode, full_path, 727 rc = cifs_get_inode_info_unix(&newInode, full_path,
@@ -742,7 +744,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
742 /* if it was once a directory (but how can we tell?) we could do 744 /* if it was once a directory (but how can we tell?) we could do
743 shrink_dcache_parent(direntry); */ 745 shrink_dcache_parent(direntry); */
744 } else if (rc != -EACCES) { 746 } else if (rc != -EACCES) {
745 cERROR(1, "Unexpected lookup error %d", rc); 747 cifs_dbg(VFS, "Unexpected lookup error %d\n", rc);
746 /* We special case check for Access Denied - since that 748 /* We special case check for Access Denied - since that
747 is a common return code */ 749 is a common return code */
748 } 750 }
@@ -807,7 +809,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
807{ 809{
808 int rc = 0; 810 int rc = 0;
809 811
810 cFYI(1, "In cifs d_delete, name = %s", direntry->d_name.name); 812 cifs_dbg(FYI, "In cifs d_delete, name = %s\n", direntry->d_name.name);
811 813
812 return rc; 814 return rc;
813} */ 815} */
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c
index 1d2d91d9bf65..e7512e497611 100644
--- a/fs/cifs/dns_resolve.c
+++ b/fs/cifs/dns_resolve.c
@@ -55,7 +55,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
55 55
56 len = strlen(unc); 56 len = strlen(unc);
57 if (len < 3) { 57 if (len < 3) {
58 cFYI(1, "%s: unc is too short: %s", __func__, unc); 58 cifs_dbg(FYI, "%s: unc is too short: %s\n", __func__, unc);
59 return -EINVAL; 59 return -EINVAL;
60 } 60 }
61 61
@@ -68,8 +68,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
68 if (sep) 68 if (sep)
69 len = sep - hostname; 69 len = sep - hostname;
70 else 70 else
71 cFYI(1, "%s: probably server name is whole unc: %s", 71 cifs_dbg(FYI, "%s: probably server name is whole unc: %s\n",
72 __func__, unc); 72 __func__, unc);
73 73
74 /* Try to interpret hostname as an IPv4 or IPv6 address */ 74 /* Try to interpret hostname as an IPv4 or IPv6 address */
75 rc = cifs_convert_address((struct sockaddr *)&ss, hostname, len); 75 rc = cifs_convert_address((struct sockaddr *)&ss, hostname, len);
@@ -79,11 +79,11 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
79 /* Perform the upcall */ 79 /* Perform the upcall */
80 rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL); 80 rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL);
81 if (rc < 0) 81 if (rc < 0)
82 cFYI(1, "%s: unable to resolve: %*.*s", 82 cifs_dbg(FYI, "%s: unable to resolve: %*.*s\n",
83 __func__, len, len, hostname); 83 __func__, len, len, hostname);
84 else 84 else
85 cFYI(1, "%s: resolved: %*.*s to %s", 85 cifs_dbg(FYI, "%s: resolved: %*.*s to %s\n",
86 __func__, len, len, hostname, *ip_addr); 86 __func__, len, len, hostname, *ip_addr);
87 return rc; 87 return rc;
88 88
89name_is_IP_address: 89name_is_IP_address:
@@ -92,7 +92,8 @@ name_is_IP_address:
92 return -ENOMEM; 92 return -ENOMEM;
93 memcpy(name, hostname, len); 93 memcpy(name, hostname, len);
94 name[len] = 0; 94 name[len] = 0;
95 cFYI(1, "%s: unc is IP, skipping dns upcall: %s", __func__, name); 95 cifs_dbg(FYI, "%s: unc is IP, skipping dns upcall: %s\n",
96 __func__, name);
96 *ip_addr = name; 97 *ip_addr = name;
97 return 0; 98 return 0;
98} 99}
diff --git a/fs/cifs/export.c b/fs/cifs/export.c
index 9c7ecdccf2f3..ce8b7f677c58 100644
--- a/fs/cifs/export.c
+++ b/fs/cifs/export.c
@@ -49,7 +49,7 @@
49static struct dentry *cifs_get_parent(struct dentry *dentry) 49static struct dentry *cifs_get_parent(struct dentry *dentry)
50{ 50{
51 /* BB need to add code here eventually to enable export via NFSD */ 51 /* BB need to add code here eventually to enable export via NFSD */
52 cFYI(1, "get parent for %p", dentry); 52 cifs_dbg(FYI, "get parent for %p\n", dentry);
53 return ERR_PTR(-EACCES); 53 return ERR_PTR(-EACCES);
54} 54}
55 55
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 2d4a231dd70b..48b29d24c9f4 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -78,9 +78,8 @@ static u32 cifs_posix_convert_flags(unsigned int flags)
78 if (flags & O_EXCL) 78 if (flags & O_EXCL)
79 posix_flags |= SMB_O_EXCL; 79 posix_flags |= SMB_O_EXCL;
80 } else if (flags & O_EXCL) 80 } else if (flags & O_EXCL)
81 cFYI(1, "Application %s pid %d has incorrectly set O_EXCL flag" 81 cifs_dbg(FYI, "Application %s pid %d has incorrectly set O_EXCL flag but not O_CREAT on file open. Ignoring O_EXCL\n",
82 "but not O_CREAT on file open. Ignoring O_EXCL", 82 current->comm, current->tgid);
83 current->comm, current->tgid);
84 83
85 if (flags & O_TRUNC) 84 if (flags & O_TRUNC)
86 posix_flags |= SMB_O_TRUNC; 85 posix_flags |= SMB_O_TRUNC;
@@ -123,7 +122,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
123 struct tcon_link *tlink; 122 struct tcon_link *tlink;
124 struct cifs_tcon *tcon; 123 struct cifs_tcon *tcon;
125 124
126 cFYI(1, "posix open %s", full_path); 125 cifs_dbg(FYI, "posix open %s\n", full_path);
127 126
128 presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); 127 presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL);
129 if (presp_data == NULL) 128 if (presp_data == NULL)
@@ -308,7 +307,7 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
308 */ 307 */
309 if (oplock == server->vals->oplock_read && 308 if (oplock == server->vals->oplock_read &&
310 cifs_has_mand_locks(cinode)) { 309 cifs_has_mand_locks(cinode)) {
311 cFYI(1, "Reset oplock val from read to None due to mand locks"); 310 cifs_dbg(FYI, "Reset oplock val from read to None due to mand locks\n");
312 oplock = 0; 311 oplock = 0;
313 } 312 }
314 313
@@ -374,8 +373,8 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
374 list_del(&cifs_file->tlist); 373 list_del(&cifs_file->tlist);
375 374
376 if (list_empty(&cifsi->openFileList)) { 375 if (list_empty(&cifsi->openFileList)) {
377 cFYI(1, "closing last open instance for inode %p", 376 cifs_dbg(FYI, "closing last open instance for inode %p\n",
378 cifs_file->dentry->d_inode); 377 cifs_file->dentry->d_inode);
379 /* 378 /*
380 * In strict cache mode we need invalidate mapping on the last 379 * In strict cache mode we need invalidate mapping on the last
381 * close because it may cause a error when we open this file 380 * close because it may cause a error when we open this file
@@ -454,7 +453,7 @@ int cifs_open(struct inode *inode, struct file *file)
454 goto out; 453 goto out;
455 } 454 }
456 455
457 cFYI(1, "inode = 0x%p file flags are 0x%x for %s", 456 cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
458 inode, file->f_flags, full_path); 457 inode, file->f_flags, full_path);
459 458
460 if (server->oplocks) 459 if (server->oplocks)
@@ -470,16 +469,13 @@ int cifs_open(struct inode *inode, struct file *file)
470 cifs_sb->mnt_file_mode /* ignored */, 469 cifs_sb->mnt_file_mode /* ignored */,
471 file->f_flags, &oplock, &fid.netfid, xid); 470 file->f_flags, &oplock, &fid.netfid, xid);
472 if (rc == 0) { 471 if (rc == 0) {
473 cFYI(1, "posix open succeeded"); 472 cifs_dbg(FYI, "posix open succeeded\n");
474 posix_open_ok = true; 473 posix_open_ok = true;
475 } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { 474 } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
476 if (tcon->ses->serverNOS) 475 if (tcon->ses->serverNOS)
477 cERROR(1, "server %s of type %s returned" 476 cifs_dbg(VFS, "server %s of type %s returned unexpected error on SMB posix open, disabling posix open support. Check if server update available.\n",
478 " unexpected error on SMB posix open" 477 tcon->ses->serverName,
479 ", disabling posix open support." 478 tcon->ses->serverNOS);
480 " Check if server update available.",
481 tcon->ses->serverName,
482 tcon->ses->serverNOS);
483 tcon->broken_posix_open = true; 479 tcon->broken_posix_open = true;
484 } else if ((rc != -EIO) && (rc != -EREMOTE) && 480 } else if ((rc != -EIO) && (rc != -EREMOTE) &&
485 (rc != -EOPNOTSUPP)) /* path not found or net err */ 481 (rc != -EOPNOTSUPP)) /* path not found or net err */
@@ -621,8 +617,8 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
621 return rc; 617 return rc;
622 } 618 }
623 619
624 cFYI(1, "inode = 0x%p file flags 0x%x for %s", inode, cfile->f_flags, 620 cifs_dbg(FYI, "inode = 0x%p file flags 0x%x for %s\n",
625 full_path); 621 inode, cfile->f_flags, full_path);
626 622
627 if (tcon->ses->server->oplocks) 623 if (tcon->ses->server->oplocks)
628 oplock = REQ_OPLOCK; 624 oplock = REQ_OPLOCK;
@@ -643,7 +639,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
643 cifs_sb->mnt_file_mode /* ignored */, 639 cifs_sb->mnt_file_mode /* ignored */,
644 oflags, &oplock, &fid.netfid, xid); 640 oflags, &oplock, &fid.netfid, xid);
645 if (rc == 0) { 641 if (rc == 0) {
646 cFYI(1, "posix reopen succeeded"); 642 cifs_dbg(FYI, "posix reopen succeeded\n");
647 goto reopen_success; 643 goto reopen_success;
648 } 644 }
649 /* 645 /*
@@ -672,8 +668,8 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
672 NULL, cifs_sb); 668 NULL, cifs_sb);
673 if (rc) { 669 if (rc) {
674 mutex_unlock(&cfile->fh_mutex); 670 mutex_unlock(&cfile->fh_mutex);
675 cFYI(1, "cifs_reopen returned 0x%x", rc); 671 cifs_dbg(FYI, "cifs_reopen returned 0x%x\n", rc);
676 cFYI(1, "oplock: %d", oplock); 672 cifs_dbg(FYI, "oplock: %d\n", oplock);
677 goto reopen_error_exit; 673 goto reopen_error_exit;
678 } 674 }
679 675
@@ -729,7 +725,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
729 struct TCP_Server_Info *server; 725 struct TCP_Server_Info *server;
730 char *buf; 726 char *buf;
731 727
732 cFYI(1, "Closedir inode = 0x%p", inode); 728 cifs_dbg(FYI, "Closedir inode = 0x%p\n", inode);
733 729
734 if (cfile == NULL) 730 if (cfile == NULL)
735 return rc; 731 return rc;
@@ -738,7 +734,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
738 tcon = tlink_tcon(cfile->tlink); 734 tcon = tlink_tcon(cfile->tlink);
739 server = tcon->ses->server; 735 server = tcon->ses->server;
740 736
741 cFYI(1, "Freeing private data in close dir"); 737 cifs_dbg(FYI, "Freeing private data in close dir\n");
742 spin_lock(&cifs_file_list_lock); 738 spin_lock(&cifs_file_list_lock);
743 if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) { 739 if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) {
744 cfile->invalidHandle = true; 740 cfile->invalidHandle = true;
@@ -747,7 +743,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
747 rc = server->ops->close_dir(xid, tcon, &cfile->fid); 743 rc = server->ops->close_dir(xid, tcon, &cfile->fid);
748 else 744 else
749 rc = -ENOSYS; 745 rc = -ENOSYS;
750 cFYI(1, "Closing uncompleted readdir with rc %d", rc); 746 cifs_dbg(FYI, "Closing uncompleted readdir with rc %d\n", rc);
751 /* not much we can do if it fails anyway, ignore rc */ 747 /* not much we can do if it fails anyway, ignore rc */
752 rc = 0; 748 rc = 0;
753 } else 749 } else
@@ -755,7 +751,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
755 751
756 buf = cfile->srch_inf.ntwrk_buf_start; 752 buf = cfile->srch_inf.ntwrk_buf_start;
757 if (buf) { 753 if (buf) {
758 cFYI(1, "closedir free smb buf in srch struct"); 754 cifs_dbg(FYI, "closedir free smb buf in srch struct\n");
759 cfile->srch_inf.ntwrk_buf_start = NULL; 755 cfile->srch_inf.ntwrk_buf_start = NULL;
760 if (cfile->srch_inf.smallBuf) 756 if (cfile->srch_inf.smallBuf)
761 cifs_small_buf_release(buf); 757 cifs_small_buf_release(buf);
@@ -1140,7 +1136,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
1140 * The list ended. We don't have enough allocated 1136 * The list ended. We don't have enough allocated
1141 * structures - something is really wrong. 1137 * structures - something is really wrong.
1142 */ 1138 */
1143 cERROR(1, "Can't push all brlocks!"); 1139 cifs_dbg(VFS, "Can't push all brlocks!\n");
1144 break; 1140 break;
1145 } 1141 }
1146 length = 1 + flock->fl_end - flock->fl_start; 1142 length = 1 + flock->fl_end - flock->fl_start;
@@ -1213,47 +1209,46 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
1213 bool *wait_flag, struct TCP_Server_Info *server) 1209 bool *wait_flag, struct TCP_Server_Info *server)
1214{ 1210{
1215 if (flock->fl_flags & FL_POSIX) 1211 if (flock->fl_flags & FL_POSIX)
1216 cFYI(1, "Posix"); 1212 cifs_dbg(FYI, "Posix\n");
1217 if (flock->fl_flags & FL_FLOCK) 1213 if (flock->fl_flags & FL_FLOCK)
1218 cFYI(1, "Flock"); 1214 cifs_dbg(FYI, "Flock\n");
1219 if (flock->fl_flags & FL_SLEEP) { 1215 if (flock->fl_flags & FL_SLEEP) {
1220 cFYI(1, "Blocking lock"); 1216 cifs_dbg(FYI, "Blocking lock\n");
1221 *wait_flag = true; 1217 *wait_flag = true;
1222 } 1218 }
1223 if (flock->fl_flags & FL_ACCESS) 1219 if (flock->fl_flags & FL_ACCESS)
1224 cFYI(1, "Process suspended by mandatory locking - " 1220 cifs_dbg(FYI, "Process suspended by mandatory locking - not implemented yet\n");
1225 "not implemented yet");
1226 if (flock->fl_flags & FL_LEASE) 1221 if (flock->fl_flags & FL_LEASE)
1227 cFYI(1, "Lease on file - not implemented yet"); 1222 cifs_dbg(FYI, "Lease on file - not implemented yet\n");
1228 if (flock->fl_flags & 1223 if (flock->fl_flags &
1229 (~(FL_POSIX | FL_FLOCK | FL_SLEEP | 1224 (~(FL_POSIX | FL_FLOCK | FL_SLEEP |
1230 FL_ACCESS | FL_LEASE | FL_CLOSE))) 1225 FL_ACCESS | FL_LEASE | FL_CLOSE)))
1231 cFYI(1, "Unknown lock flags 0x%x", flock->fl_flags); 1226 cifs_dbg(FYI, "Unknown lock flags 0x%x\n", flock->fl_flags);
1232 1227
1233 *type = server->vals->large_lock_type; 1228 *type = server->vals->large_lock_type;
1234 if (flock->fl_type == F_WRLCK) { 1229 if (flock->fl_type == F_WRLCK) {
1235 cFYI(1, "F_WRLCK "); 1230 cifs_dbg(FYI, "F_WRLCK\n");
1236 *type |= server->vals->exclusive_lock_type; 1231 *type |= server->vals->exclusive_lock_type;
1237 *lock = 1; 1232 *lock = 1;
1238 } else if (flock->fl_type == F_UNLCK) { 1233 } else if (flock->fl_type == F_UNLCK) {
1239 cFYI(1, "F_UNLCK"); 1234 cifs_dbg(FYI, "F_UNLCK\n");
1240 *type |= server->vals->unlock_lock_type; 1235 *type |= server->vals->unlock_lock_type;
1241 *unlock = 1; 1236 *unlock = 1;
1242 /* Check if unlock includes more than one lock range */ 1237 /* Check if unlock includes more than one lock range */
1243 } else if (flock->fl_type == F_RDLCK) { 1238 } else if (flock->fl_type == F_RDLCK) {
1244 cFYI(1, "F_RDLCK"); 1239 cifs_dbg(FYI, "F_RDLCK\n");
1245 *type |= server->vals->shared_lock_type; 1240 *type |= server->vals->shared_lock_type;
1246 *lock = 1; 1241 *lock = 1;
1247 } else if (flock->fl_type == F_EXLCK) { 1242 } else if (flock->fl_type == F_EXLCK) {
1248 cFYI(1, "F_EXLCK"); 1243 cifs_dbg(FYI, "F_EXLCK\n");
1249 *type |= server->vals->exclusive_lock_type; 1244 *type |= server->vals->exclusive_lock_type;
1250 *lock = 1; 1245 *lock = 1;
1251 } else if (flock->fl_type == F_SHLCK) { 1246 } else if (flock->fl_type == F_SHLCK) {
1252 cFYI(1, "F_SHLCK"); 1247 cifs_dbg(FYI, "F_SHLCK\n");
1253 *type |= server->vals->shared_lock_type; 1248 *type |= server->vals->shared_lock_type;
1254 *lock = 1; 1249 *lock = 1;
1255 } else 1250 } else
1256 cFYI(1, "Unknown type of lock"); 1251 cifs_dbg(FYI, "Unknown type of lock\n");
1257} 1252}
1258 1253
1259static int 1254static int
@@ -1296,8 +1291,8 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
1296 type, 0, 1, false); 1291 type, 0, 1, false);
1297 flock->fl_type = F_UNLCK; 1292 flock->fl_type = F_UNLCK;
1298 if (rc != 0) 1293 if (rc != 0)
1299 cERROR(1, "Error unlocking previously locked " 1294 cifs_dbg(VFS, "Error unlocking previously locked range %d during test of lock\n",
1300 "range %d during test of lock", rc); 1295 rc);
1301 return 0; 1296 return 0;
1302 } 1297 }
1303 1298
@@ -1316,8 +1311,8 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
1316 type | server->vals->shared_lock_type, 0, 1, false); 1311 type | server->vals->shared_lock_type, 0, 1, false);
1317 flock->fl_type = F_RDLCK; 1312 flock->fl_type = F_RDLCK;
1318 if (rc != 0) 1313 if (rc != 0)
1319 cERROR(1, "Error unlocking previously locked " 1314 cifs_dbg(VFS, "Error unlocking previously locked range %d during test of lock\n",
1320 "range %d during test of lock", rc); 1315 rc);
1321 } else 1316 } else
1322 flock->fl_type = F_WRLCK; 1317 flock->fl_type = F_WRLCK;
1323 1318
@@ -1508,8 +1503,8 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1508 if (!CIFS_I(inode)->clientCanCacheAll && 1503 if (!CIFS_I(inode)->clientCanCacheAll &&
1509 CIFS_I(inode)->clientCanCacheRead) { 1504 CIFS_I(inode)->clientCanCacheRead) {
1510 cifs_invalidate_mapping(inode); 1505 cifs_invalidate_mapping(inode);
1511 cFYI(1, "Set no oplock for inode=%p due to mand locks", 1506 cifs_dbg(FYI, "Set no oplock for inode=%p due to mand locks\n",
1512 inode); 1507 inode);
1513 CIFS_I(inode)->clientCanCacheRead = false; 1508 CIFS_I(inode)->clientCanCacheRead = false;
1514 } 1509 }
1515 1510
@@ -1546,9 +1541,9 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1546 rc = -EACCES; 1541 rc = -EACCES;
1547 xid = get_xid(); 1542 xid = get_xid();
1548 1543
1549 cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld " 1544 cifs_dbg(FYI, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld end: %lld\n",
1550 "end: %lld", cmd, flock->fl_flags, flock->fl_type, 1545 cmd, flock->fl_flags, flock->fl_type,
1551 flock->fl_start, flock->fl_end); 1546 flock->fl_start, flock->fl_end);
1552 1547
1553 cfile = (struct cifsFileInfo *)file->private_data; 1548 cfile = (struct cifsFileInfo *)file->private_data;
1554 tcon = tlink_tcon(cfile->tlink); 1549 tcon = tlink_tcon(cfile->tlink);
@@ -1620,8 +1615,8 @@ cifs_write(struct cifsFileInfo *open_file, __u32 pid, const char *write_data,
1620 1615
1621 cifs_sb = CIFS_SB(dentry->d_sb); 1616 cifs_sb = CIFS_SB(dentry->d_sb);
1622 1617
1623 cFYI(1, "write %zd bytes to offset %lld of %s", write_size, 1618 cifs_dbg(FYI, "write %zd bytes to offset %lld of %s\n",
1624 *offset, dentry->d_name.name); 1619 write_size, *offset, dentry->d_name.name);
1625 1620
1626 tcon = tlink_tcon(open_file->tlink); 1621 tcon = tlink_tcon(open_file->tlink);
1627 server = tcon->ses->server; 1622 server = tcon->ses->server;
@@ -1736,7 +1731,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
1736 it being zero) during stress testcases so we need to check for it */ 1731 it being zero) during stress testcases so we need to check for it */
1737 1732
1738 if (cifs_inode == NULL) { 1733 if (cifs_inode == NULL) {
1739 cERROR(1, "Null inode passed to cifs_writeable_file"); 1734 cifs_dbg(VFS, "Null inode passed to cifs_writeable_file\n");
1740 dump_stack(); 1735 dump_stack();
1741 return NULL; 1736 return NULL;
1742 } 1737 }
@@ -1848,7 +1843,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to)
1848 else if (bytes_written < 0) 1843 else if (bytes_written < 0)
1849 rc = bytes_written; 1844 rc = bytes_written;
1850 } else { 1845 } else {
1851 cFYI(1, "No writeable filehandles for inode"); 1846 cifs_dbg(FYI, "No writeable filehandles for inode\n");
1852 rc = -EIO; 1847 rc = -EIO;
1853 } 1848 }
1854 1849
@@ -2015,7 +2010,7 @@ retry:
2015 wdata->cfile = find_writable_file(CIFS_I(mapping->host), 2010 wdata->cfile = find_writable_file(CIFS_I(mapping->host),
2016 false); 2011 false);
2017 if (!wdata->cfile) { 2012 if (!wdata->cfile) {
2018 cERROR(1, "No writable handles for inode"); 2013 cifs_dbg(VFS, "No writable handles for inode\n");
2019 rc = -EBADF; 2014 rc = -EBADF;
2020 break; 2015 break;
2021 } 2016 }
@@ -2076,7 +2071,7 @@ cifs_writepage_locked(struct page *page, struct writeback_control *wbc)
2076/* BB add check for wbc flags */ 2071/* BB add check for wbc flags */
2077 page_cache_get(page); 2072 page_cache_get(page);
2078 if (!PageUptodate(page)) 2073 if (!PageUptodate(page))
2079 cFYI(1, "ppw - page not up to date"); 2074 cifs_dbg(FYI, "ppw - page not up to date\n");
2080 2075
2081 /* 2076 /*
2082 * Set the "writeback" flag, and clear "dirty" in the radix tree. 2077 * Set the "writeback" flag, and clear "dirty" in the radix tree.
@@ -2127,7 +2122,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
2127 else 2122 else
2128 pid = current->tgid; 2123 pid = current->tgid;
2129 2124
2130 cFYI(1, "write_end for page %p from pos %lld with %d bytes", 2125 cifs_dbg(FYI, "write_end for page %p from pos %lld with %d bytes\n",
2131 page, pos, copied); 2126 page, pos, copied);
2132 2127
2133 if (PageChecked(page)) { 2128 if (PageChecked(page)) {
@@ -2191,13 +2186,13 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2191 2186
2192 xid = get_xid(); 2187 xid = get_xid();
2193 2188
2194 cFYI(1, "Sync file - name: %s datasync: 0x%x", 2189 cifs_dbg(FYI, "Sync file - name: %s datasync: 0x%x\n",
2195 file->f_path.dentry->d_name.name, datasync); 2190 file->f_path.dentry->d_name.name, datasync);
2196 2191
2197 if (!CIFS_I(inode)->clientCanCacheRead) { 2192 if (!CIFS_I(inode)->clientCanCacheRead) {
2198 rc = cifs_invalidate_mapping(inode); 2193 rc = cifs_invalidate_mapping(inode);
2199 if (rc) { 2194 if (rc) {
2200 cFYI(1, "rc: %d during invalidate phase", rc); 2195 cifs_dbg(FYI, "rc: %d during invalidate phase\n", rc);
2201 rc = 0; /* don't care about it in fsync */ 2196 rc = 0; /* don't care about it in fsync */
2202 } 2197 }
2203 } 2198 }
@@ -2233,8 +2228,8 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2233 2228
2234 xid = get_xid(); 2229 xid = get_xid();
2235 2230
2236 cFYI(1, "Sync file - name: %s datasync: 0x%x", 2231 cifs_dbg(FYI, "Sync file - name: %s datasync: 0x%x\n",
2237 file->f_path.dentry->d_name.name, datasync); 2232 file->f_path.dentry->d_name.name, datasync);
2238 2233
2239 tcon = tlink_tcon(smbfile->tlink); 2234 tcon = tlink_tcon(smbfile->tlink);
2240 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) { 2235 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) {
@@ -2262,7 +2257,7 @@ int cifs_flush(struct file *file, fl_owner_t id)
2262 if (file->f_mode & FMODE_WRITE) 2257 if (file->f_mode & FMODE_WRITE)
2263 rc = filemap_write_and_wait(inode->i_mapping); 2258 rc = filemap_write_and_wait(inode->i_mapping);
2264 2259
2265 cFYI(1, "Flush inode %p file %p rc %d", inode, file, rc); 2260 cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
2266 2261
2267 return rc; 2262 return rc;
2268} 2263}
@@ -2579,8 +2574,8 @@ cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov,
2579 * an old data. 2574 * an old data.
2580 */ 2575 */
2581 cifs_invalidate_mapping(inode); 2576 cifs_invalidate_mapping(inode);
2582 cFYI(1, "Set no oplock for inode=%p after a write operation", 2577 cifs_dbg(FYI, "Set no oplock for inode=%p after a write operation\n",
2583 inode); 2578 inode);
2584 cinode->clientCanCacheRead = false; 2579 cinode->clientCanCacheRead = false;
2585 } 2580 }
2586 return written; 2581 return written;
@@ -2756,15 +2751,15 @@ cifs_uncached_read_into_pages(struct TCP_Server_Info *server,
2756 /* enough data to fill the page */ 2751 /* enough data to fill the page */
2757 iov.iov_base = kmap(page); 2752 iov.iov_base = kmap(page);
2758 iov.iov_len = PAGE_SIZE; 2753 iov.iov_len = PAGE_SIZE;
2759 cFYI(1, "%u: iov_base=%p iov_len=%zu", 2754 cifs_dbg(FYI, "%u: iov_base=%p iov_len=%zu\n",
2760 i, iov.iov_base, iov.iov_len); 2755 i, iov.iov_base, iov.iov_len);
2761 len -= PAGE_SIZE; 2756 len -= PAGE_SIZE;
2762 } else if (len > 0) { 2757 } else if (len > 0) {
2763 /* enough for partial page, fill and zero the rest */ 2758 /* enough for partial page, fill and zero the rest */
2764 iov.iov_base = kmap(page); 2759 iov.iov_base = kmap(page);
2765 iov.iov_len = len; 2760 iov.iov_len = len;
2766 cFYI(1, "%u: iov_base=%p iov_len=%zu", 2761 cifs_dbg(FYI, "%u: iov_base=%p iov_len=%zu\n",
2767 i, iov.iov_base, iov.iov_len); 2762 i, iov.iov_base, iov.iov_len);
2768 memset(iov.iov_base + len, '\0', PAGE_SIZE - len); 2763 memset(iov.iov_base + len, '\0', PAGE_SIZE - len);
2769 rdata->tailsz = len; 2764 rdata->tailsz = len;
2770 len = 0; 2765 len = 0;
@@ -2824,7 +2819,7 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
2824 pid = current->tgid; 2819 pid = current->tgid;
2825 2820
2826 if ((file->f_flags & O_ACCMODE) == O_WRONLY) 2821 if ((file->f_flags & O_ACCMODE) == O_WRONLY)
2827 cFYI(1, "attempting read on write only file instance"); 2822 cifs_dbg(FYI, "attempting read on write only file instance\n");
2828 2823
2829 do { 2824 do {
2830 cur_len = min_t(const size_t, len - total_read, cifs_sb->rsize); 2825 cur_len = min_t(const size_t, len - total_read, cifs_sb->rsize);
@@ -3003,7 +2998,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
3003 pid = current->tgid; 2998 pid = current->tgid;
3004 2999
3005 if ((file->f_flags & O_ACCMODE) == O_WRONLY) 3000 if ((file->f_flags & O_ACCMODE) == O_WRONLY)
3006 cFYI(1, "attempting read on write only file instance"); 3001 cifs_dbg(FYI, "attempting read on write only file instance\n");
3007 3002
3008 for (total_read = 0, cur_offset = read_data; read_size > total_read; 3003 for (total_read = 0, cur_offset = read_data; read_size > total_read;
3009 total_read += bytes_read, cur_offset += bytes_read) { 3004 total_read += bytes_read, cur_offset += bytes_read) {
@@ -3094,7 +3089,8 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
3094 xid = get_xid(); 3089 xid = get_xid();
3095 rc = cifs_revalidate_file(file); 3090 rc = cifs_revalidate_file(file);
3096 if (rc) { 3091 if (rc) {
3097 cFYI(1, "Validation prior to mmap failed, error=%d", rc); 3092 cifs_dbg(FYI, "Validation prior to mmap failed, error=%d\n",
3093 rc);
3098 free_xid(xid); 3094 free_xid(xid);
3099 return rc; 3095 return rc;
3100 } 3096 }
@@ -3147,7 +3143,7 @@ cifs_readpages_read_into_pages(struct TCP_Server_Info *server,
3147 /* determine the eof that the server (probably) has */ 3143 /* determine the eof that the server (probably) has */
3148 eof = CIFS_I(rdata->mapping->host)->server_eof; 3144 eof = CIFS_I(rdata->mapping->host)->server_eof;
3149 eof_index = eof ? (eof - 1) >> PAGE_CACHE_SHIFT : 0; 3145 eof_index = eof ? (eof - 1) >> PAGE_CACHE_SHIFT : 0;
3150 cFYI(1, "eof=%llu eof_index=%lu", eof, eof_index); 3146 cifs_dbg(FYI, "eof=%llu eof_index=%lu\n", eof, eof_index);
3151 3147
3152 rdata->tailsz = PAGE_CACHE_SIZE; 3148 rdata->tailsz = PAGE_CACHE_SIZE;
3153 for (i = 0; i < nr_pages; i++) { 3149 for (i = 0; i < nr_pages; i++) {
@@ -3157,15 +3153,15 @@ cifs_readpages_read_into_pages(struct TCP_Server_Info *server,
3157 /* enough data to fill the page */ 3153 /* enough data to fill the page */
3158 iov.iov_base = kmap(page); 3154 iov.iov_base = kmap(page);
3159 iov.iov_len = PAGE_CACHE_SIZE; 3155 iov.iov_len = PAGE_CACHE_SIZE;
3160 cFYI(1, "%u: idx=%lu iov_base=%p iov_len=%zu", 3156 cifs_dbg(FYI, "%u: idx=%lu iov_base=%p iov_len=%zu\n",
3161 i, page->index, iov.iov_base, iov.iov_len); 3157 i, page->index, iov.iov_base, iov.iov_len);
3162 len -= PAGE_CACHE_SIZE; 3158 len -= PAGE_CACHE_SIZE;
3163 } else if (len > 0) { 3159 } else if (len > 0) {
3164 /* enough for partial page, fill and zero the rest */ 3160 /* enough for partial page, fill and zero the rest */
3165 iov.iov_base = kmap(page); 3161 iov.iov_base = kmap(page);
3166 iov.iov_len = len; 3162 iov.iov_len = len;
3167 cFYI(1, "%u: idx=%lu iov_base=%p iov_len=%zu", 3163 cifs_dbg(FYI, "%u: idx=%lu iov_base=%p iov_len=%zu\n",
3168 i, page->index, iov.iov_base, iov.iov_len); 3164 i, page->index, iov.iov_base, iov.iov_len);
3169 memset(iov.iov_base + len, 3165 memset(iov.iov_base + len,
3170 '\0', PAGE_CACHE_SIZE - len); 3166 '\0', PAGE_CACHE_SIZE - len);
3171 rdata->tailsz = len; 3167 rdata->tailsz = len;
@@ -3245,8 +3241,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
3245 rc = 0; 3241 rc = 0;
3246 INIT_LIST_HEAD(&tmplist); 3242 INIT_LIST_HEAD(&tmplist);
3247 3243
3248 cFYI(1, "%s: file=%p mapping=%p num_pages=%u", __func__, file, 3244 cifs_dbg(FYI, "%s: file=%p mapping=%p num_pages=%u\n",
3249 mapping, num_pages); 3245 __func__, file, mapping, num_pages);
3250 3246
3251 /* 3247 /*
3252 * Start with the page at end of list and move it to private 3248 * Start with the page at end of list and move it to private
@@ -3376,7 +3372,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
3376 if (rc < 0) 3372 if (rc < 0)
3377 goto io_error; 3373 goto io_error;
3378 else 3374 else
3379 cFYI(1, "Bytes read %d", rc); 3375 cifs_dbg(FYI, "Bytes read %d\n", rc);
3380 3376
3381 file_inode(file)->i_atime = 3377 file_inode(file)->i_atime =
3382 current_fs_time(file_inode(file)->i_sb); 3378 current_fs_time(file_inode(file)->i_sb);
@@ -3414,7 +3410,7 @@ static int cifs_readpage(struct file *file, struct page *page)
3414 return rc; 3410 return rc;
3415 } 3411 }
3416 3412
3417 cFYI(1, "readpage %p at offset %d 0x%x", 3413 cifs_dbg(FYI, "readpage %p at offset %d 0x%x\n",
3418 page, (int)offset, (int)offset); 3414 page, (int)offset, (int)offset);
3419 3415
3420 rc = cifs_readpage_worker(file, page, &offset); 3416 rc = cifs_readpage_worker(file, page, &offset);
@@ -3481,7 +3477,7 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping,
3481 struct page *page; 3477 struct page *page;
3482 int rc = 0; 3478 int rc = 0;
3483 3479
3484 cFYI(1, "write_begin from %lld len %d", (long long)pos, len); 3480 cifs_dbg(FYI, "write_begin from %lld len %d\n", (long long)pos, len);
3485 3481
3486 page = grab_cache_page_write_begin(mapping, index, flags); 3482 page = grab_cache_page_write_begin(mapping, index, flags);
3487 if (!page) { 3483 if (!page) {
@@ -3570,7 +3566,7 @@ static int cifs_launder_page(struct page *page)
3570 .range_end = range_end, 3566 .range_end = range_end,
3571 }; 3567 };
3572 3568
3573 cFYI(1, "Launder page: %p", page); 3569 cifs_dbg(FYI, "Launder page: %p\n", page);
3574 3570
3575 if (clear_page_dirty_for_io(page)) 3571 if (clear_page_dirty_for_io(page))
3576 rc = cifs_writepage_locked(page, &wbc); 3572 rc = cifs_writepage_locked(page, &wbc);
@@ -3590,8 +3586,8 @@ void cifs_oplock_break(struct work_struct *work)
3590 3586
3591 if (!cinode->clientCanCacheAll && cinode->clientCanCacheRead && 3587 if (!cinode->clientCanCacheAll && cinode->clientCanCacheRead &&
3592 cifs_has_mand_locks(cinode)) { 3588 cifs_has_mand_locks(cinode)) {
3593 cFYI(1, "Reset oplock to None for inode=%p due to mand locks", 3589 cifs_dbg(FYI, "Reset oplock to None for inode=%p due to mand locks\n",
3594 inode); 3590 inode);
3595 cinode->clientCanCacheRead = false; 3591 cinode->clientCanCacheRead = false;
3596 } 3592 }
3597 3593
@@ -3606,12 +3602,12 @@ void cifs_oplock_break(struct work_struct *work)
3606 mapping_set_error(inode->i_mapping, rc); 3602 mapping_set_error(inode->i_mapping, rc);
3607 cifs_invalidate_mapping(inode); 3603 cifs_invalidate_mapping(inode);
3608 } 3604 }
3609 cFYI(1, "Oplock flush inode %p rc %d", inode, rc); 3605 cifs_dbg(FYI, "Oplock flush inode %p rc %d\n", inode, rc);
3610 } 3606 }
3611 3607
3612 rc = cifs_push_locks(cfile); 3608 rc = cifs_push_locks(cfile);
3613 if (rc) 3609 if (rc)
3614 cERROR(1, "Push locks rc = %d", rc); 3610 cifs_dbg(VFS, "Push locks rc = %d\n", rc);
3615 3611
3616 /* 3612 /*
3617 * releasing stale oplock after recent reconnect of smb session using 3613 * releasing stale oplock after recent reconnect of smb session using
@@ -3622,7 +3618,7 @@ void cifs_oplock_break(struct work_struct *work)
3622 if (!cfile->oplock_break_cancelled) { 3618 if (!cfile->oplock_break_cancelled) {
3623 rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid, 3619 rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid,
3624 cinode); 3620 cinode);
3625 cFYI(1, "Oplock release rc = %d", rc); 3621 cifs_dbg(FYI, "Oplock release rc = %d\n", rc);
3626 } 3622 }
3627} 3623}
3628 3624
diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c
index 42e5363b4102..2f4bc5a58054 100644
--- a/fs/cifs/fscache.c
+++ b/fs/cifs/fscache.c
@@ -28,14 +28,14 @@ void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server)
28 server->fscache = 28 server->fscache =
29 fscache_acquire_cookie(cifs_fscache_netfs.primary_index, 29 fscache_acquire_cookie(cifs_fscache_netfs.primary_index,
30 &cifs_fscache_server_index_def, server); 30 &cifs_fscache_server_index_def, server);
31 cFYI(1, "%s: (0x%p/0x%p)", __func__, server, 31 cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
32 server->fscache); 32 __func__, server, server->fscache);
33} 33}
34 34
35void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) 35void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server)
36{ 36{
37 cFYI(1, "%s: (0x%p/0x%p)", __func__, server, 37 cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
38 server->fscache); 38 __func__, server, server->fscache);
39 fscache_relinquish_cookie(server->fscache, 0); 39 fscache_relinquish_cookie(server->fscache, 0);
40 server->fscache = NULL; 40 server->fscache = NULL;
41} 41}
@@ -47,13 +47,13 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
47 tcon->fscache = 47 tcon->fscache =
48 fscache_acquire_cookie(server->fscache, 48 fscache_acquire_cookie(server->fscache,
49 &cifs_fscache_super_index_def, tcon); 49 &cifs_fscache_super_index_def, tcon);
50 cFYI(1, "%s: (0x%p/0x%p)", __func__, server->fscache, 50 cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
51 tcon->fscache); 51 __func__, server->fscache, tcon->fscache);
52} 52}
53 53
54void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) 54void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon)
55{ 55{
56 cFYI(1, "%s: (0x%p)", __func__, tcon->fscache); 56 cifs_dbg(FYI, "%s: (0x%p)\n", __func__, tcon->fscache);
57 fscache_relinquish_cookie(tcon->fscache, 0); 57 fscache_relinquish_cookie(tcon->fscache, 0);
58 tcon->fscache = NULL; 58 tcon->fscache = NULL;
59} 59}
@@ -70,8 +70,8 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode)
70 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) { 70 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) {
71 cifsi->fscache = fscache_acquire_cookie(tcon->fscache, 71 cifsi->fscache = fscache_acquire_cookie(tcon->fscache,
72 &cifs_fscache_inode_object_def, cifsi); 72 &cifs_fscache_inode_object_def, cifsi);
73 cFYI(1, "%s: got FH cookie (0x%p/0x%p)", __func__, 73 cifs_dbg(FYI, "%s: got FH cookie (0x%p/0x%p)\n",
74 tcon->fscache, cifsi->fscache); 74 __func__, tcon->fscache, cifsi->fscache);
75 } 75 }
76} 76}
77 77
@@ -80,7 +80,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode)
80 struct cifsInodeInfo *cifsi = CIFS_I(inode); 80 struct cifsInodeInfo *cifsi = CIFS_I(inode);
81 81
82 if (cifsi->fscache) { 82 if (cifsi->fscache) {
83 cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); 83 cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache);
84 fscache_relinquish_cookie(cifsi->fscache, 0); 84 fscache_relinquish_cookie(cifsi->fscache, 0);
85 cifsi->fscache = NULL; 85 cifsi->fscache = NULL;
86 } 86 }
@@ -91,7 +91,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode)
91 struct cifsInodeInfo *cifsi = CIFS_I(inode); 91 struct cifsInodeInfo *cifsi = CIFS_I(inode);
92 92
93 if (cifsi->fscache) { 93 if (cifsi->fscache) {
94 cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); 94 cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache);
95 fscache_uncache_all_inode_pages(cifsi->fscache, inode); 95 fscache_uncache_all_inode_pages(cifsi->fscache, inode);
96 fscache_relinquish_cookie(cifsi->fscache, 1); 96 fscache_relinquish_cookie(cifsi->fscache, 1);
97 cifsi->fscache = NULL; 97 cifsi->fscache = NULL;
@@ -120,8 +120,8 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode)
120 cifs_sb_master_tcon(cifs_sb)->fscache, 120 cifs_sb_master_tcon(cifs_sb)->fscache,
121 &cifs_fscache_inode_object_def, 121 &cifs_fscache_inode_object_def,
122 cifsi); 122 cifsi);
123 cFYI(1, "%s: new cookie 0x%p oldcookie 0x%p", 123 cifs_dbg(FYI, "%s: new cookie 0x%p oldcookie 0x%p\n",
124 __func__, cifsi->fscache, old); 124 __func__, cifsi->fscache, old);
125 } 125 }
126} 126}
127 127
@@ -131,8 +131,8 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
131 struct inode *inode = page->mapping->host; 131 struct inode *inode = page->mapping->host;
132 struct cifsInodeInfo *cifsi = CIFS_I(inode); 132 struct cifsInodeInfo *cifsi = CIFS_I(inode);
133 133
134 cFYI(1, "%s: (0x%p/0x%p)", __func__, page, 134 cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
135 cifsi->fscache); 135 __func__, page, cifsi->fscache);
136 if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) 136 if (!fscache_maybe_release_page(cifsi->fscache, page, gfp))
137 return 0; 137 return 0;
138 } 138 }
@@ -143,7 +143,7 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
143static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, 143static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx,
144 int error) 144 int error)
145{ 145{
146 cFYI(1, "%s: (0x%p/%d)", __func__, page, error); 146 cifs_dbg(FYI, "%s: (0x%p/%d)\n", __func__, page, error);
147 if (!error) 147 if (!error)
148 SetPageUptodate(page); 148 SetPageUptodate(page);
149 unlock_page(page); 149 unlock_page(page);
@@ -156,8 +156,8 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
156{ 156{
157 int ret; 157 int ret;
158 158
159 cFYI(1, "%s: (fsc:%p, p:%p, i:0x%p", __func__, 159 cifs_dbg(FYI, "%s: (fsc:%p, p:%p, i:0x%p\n",
160 CIFS_I(inode)->fscache, page, inode); 160 __func__, CIFS_I(inode)->fscache, page, inode);
161 ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, 161 ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page,
162 cifs_readpage_from_fscache_complete, 162 cifs_readpage_from_fscache_complete,
163 NULL, 163 NULL,
@@ -165,15 +165,15 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
165 switch (ret) { 165 switch (ret) {
166 166
167 case 0: /* page found in fscache, read submitted */ 167 case 0: /* page found in fscache, read submitted */
168 cFYI(1, "%s: submitted", __func__); 168 cifs_dbg(FYI, "%s: submitted\n", __func__);
169 return ret; 169 return ret;
170 case -ENOBUFS: /* page won't be cached */ 170 case -ENOBUFS: /* page won't be cached */
171 case -ENODATA: /* page not in cache */ 171 case -ENODATA: /* page not in cache */
172 cFYI(1, "%s: %d", __func__, ret); 172 cifs_dbg(FYI, "%s: %d\n", __func__, ret);
173 return 1; 173 return 1;
174 174
175 default: 175 default:
176 cERROR(1, "unknown error ret = %d", ret); 176 cifs_dbg(VFS, "unknown error ret = %d\n", ret);
177 } 177 }
178 return ret; 178 return ret;
179} 179}
@@ -188,8 +188,8 @@ int __cifs_readpages_from_fscache(struct inode *inode,
188{ 188{
189 int ret; 189 int ret;
190 190
191 cFYI(1, "%s: (0x%p/%u/0x%p)", __func__, 191 cifs_dbg(FYI, "%s: (0x%p/%u/0x%p)\n",
192 CIFS_I(inode)->fscache, *nr_pages, inode); 192 __func__, CIFS_I(inode)->fscache, *nr_pages, inode);
193 ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, 193 ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping,
194 pages, nr_pages, 194 pages, nr_pages,
195 cifs_readpage_from_fscache_complete, 195 cifs_readpage_from_fscache_complete,
@@ -197,16 +197,16 @@ int __cifs_readpages_from_fscache(struct inode *inode,
197 mapping_gfp_mask(mapping)); 197 mapping_gfp_mask(mapping));
198 switch (ret) { 198 switch (ret) {
199 case 0: /* read submitted to the cache for all pages */ 199 case 0: /* read submitted to the cache for all pages */
200 cFYI(1, "%s: submitted", __func__); 200 cifs_dbg(FYI, "%s: submitted\n", __func__);
201 return ret; 201 return ret;
202 202
203 case -ENOBUFS: /* some pages are not cached and can't be */ 203 case -ENOBUFS: /* some pages are not cached and can't be */
204 case -ENODATA: /* some pages are not cached */ 204 case -ENODATA: /* some pages are not cached */
205 cFYI(1, "%s: no page", __func__); 205 cifs_dbg(FYI, "%s: no page\n", __func__);
206 return 1; 206 return 1;
207 207
208 default: 208 default:
209 cFYI(1, "unknown error ret = %d", ret); 209 cifs_dbg(FYI, "unknown error ret = %d\n", ret);
210 } 210 }
211 211
212 return ret; 212 return ret;
@@ -216,8 +216,8 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
216{ 216{
217 int ret; 217 int ret;
218 218
219 cFYI(1, "%s: (fsc: %p, p: %p, i: %p)", __func__, 219 cifs_dbg(FYI, "%s: (fsc: %p, p: %p, i: %p)\n",
220 CIFS_I(inode)->fscache, page, inode); 220 __func__, CIFS_I(inode)->fscache, page, inode);
221 ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); 221 ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL);
222 if (ret != 0) 222 if (ret != 0)
223 fscache_uncache_page(CIFS_I(inode)->fscache, page); 223 fscache_uncache_page(CIFS_I(inode)->fscache, page);
@@ -228,7 +228,7 @@ void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode)
228 struct cifsInodeInfo *cifsi = CIFS_I(inode); 228 struct cifsInodeInfo *cifsi = CIFS_I(inode);
229 struct fscache_cookie *cookie = cifsi->fscache; 229 struct fscache_cookie *cookie = cifsi->fscache;
230 230
231 cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cookie); 231 cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", __func__, page, cookie);
232 fscache_wait_on_page_write(cookie, page); 232 fscache_wait_on_page_write(cookie, page);
233 fscache_uncache_page(cookie, page); 233 fscache_uncache_page(cookie, page);
234} 234}
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 20887bf63121..fc3025199cb3 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -91,30 +91,32 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr)
91{ 91{
92 struct cifsInodeInfo *cifs_i = CIFS_I(inode); 92 struct cifsInodeInfo *cifs_i = CIFS_I(inode);
93 93
94 cFYI(1, "%s: revalidating inode %llu", __func__, cifs_i->uniqueid); 94 cifs_dbg(FYI, "%s: revalidating inode %llu\n",
95 __func__, cifs_i->uniqueid);
95 96
96 if (inode->i_state & I_NEW) { 97 if (inode->i_state & I_NEW) {
97 cFYI(1, "%s: inode %llu is new", __func__, cifs_i->uniqueid); 98 cifs_dbg(FYI, "%s: inode %llu is new\n",
99 __func__, cifs_i->uniqueid);
98 return; 100 return;
99 } 101 }
100 102
101 /* don't bother with revalidation if we have an oplock */ 103 /* don't bother with revalidation if we have an oplock */
102 if (cifs_i->clientCanCacheRead) { 104 if (cifs_i->clientCanCacheRead) {
103 cFYI(1, "%s: inode %llu is oplocked", __func__, 105 cifs_dbg(FYI, "%s: inode %llu is oplocked\n",
104 cifs_i->uniqueid); 106 __func__, cifs_i->uniqueid);
105 return; 107 return;
106 } 108 }
107 109
108 /* revalidate if mtime or size have changed */ 110 /* revalidate if mtime or size have changed */
109 if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) && 111 if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) &&
110 cifs_i->server_eof == fattr->cf_eof) { 112 cifs_i->server_eof == fattr->cf_eof) {
111 cFYI(1, "%s: inode %llu is unchanged", __func__, 113 cifs_dbg(FYI, "%s: inode %llu is unchanged\n",
112 cifs_i->uniqueid); 114 __func__, cifs_i->uniqueid);
113 return; 115 return;
114 } 116 }
115 117
116 cFYI(1, "%s: invalidating inode %llu mapping", __func__, 118 cifs_dbg(FYI, "%s: invalidating inode %llu mapping\n",
117 cifs_i->uniqueid); 119 __func__, cifs_i->uniqueid);
118 cifs_i->invalid_mapping = true; 120 cifs_i->invalid_mapping = true;
119} 121}
120 122
@@ -240,7 +242,7 @@ cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info,
240 /* safest to call it a file if we do not know */ 242 /* safest to call it a file if we do not know */
241 fattr->cf_mode |= S_IFREG; 243 fattr->cf_mode |= S_IFREG;
242 fattr->cf_dtype = DT_REG; 244 fattr->cf_dtype = DT_REG;
243 cFYI(1, "unknown type %d", le32_to_cpu(info->Type)); 245 cifs_dbg(FYI, "unknown type %d\n", le32_to_cpu(info->Type));
244 break; 246 break;
245 } 247 }
246 248
@@ -279,7 +281,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb)
279{ 281{
280 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 282 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
281 283
282 cFYI(1, "creating fake fattr for DFS referral"); 284 cifs_dbg(FYI, "creating fake fattr for DFS referral\n");
283 285
284 memset(fattr, 0, sizeof(*fattr)); 286 memset(fattr, 0, sizeof(*fattr));
285 fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU; 287 fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU;
@@ -329,7 +331,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
329 struct tcon_link *tlink; 331 struct tcon_link *tlink;
330 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 332 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
331 333
332 cFYI(1, "Getting info on %s", full_path); 334 cifs_dbg(FYI, "Getting info on %s\n", full_path);
333 335
334 tlink = cifs_sb_tlink(cifs_sb); 336 tlink = cifs_sb_tlink(cifs_sb);
335 if (IS_ERR(tlink)) 337 if (IS_ERR(tlink))
@@ -355,7 +357,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
355 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) { 357 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) {
356 int tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid); 358 int tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid);
357 if (tmprc) 359 if (tmprc)
358 cFYI(1, "CIFSCheckMFSymlink: %d", tmprc); 360 cifs_dbg(FYI, "CIFSCheckMFSymlink: %d\n", tmprc);
359 } 361 }
360 362
361 if (*pinode == NULL) { 363 if (*pinode == NULL) {
@@ -422,7 +424,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
422 &buf_type); 424 &buf_type);
423 if ((rc == 0) && (bytes_read >= 8)) { 425 if ((rc == 0) && (bytes_read >= 8)) {
424 if (memcmp("IntxBLK", pbuf, 8) == 0) { 426 if (memcmp("IntxBLK", pbuf, 8) == 0) {
425 cFYI(1, "Block device"); 427 cifs_dbg(FYI, "Block device\n");
426 fattr->cf_mode |= S_IFBLK; 428 fattr->cf_mode |= S_IFBLK;
427 fattr->cf_dtype = DT_BLK; 429 fattr->cf_dtype = DT_BLK;
428 if (bytes_read == 24) { 430 if (bytes_read == 24) {
@@ -434,7 +436,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
434 fattr->cf_rdev = MKDEV(mjr, mnr); 436 fattr->cf_rdev = MKDEV(mjr, mnr);
435 } 437 }
436 } else if (memcmp("IntxCHR", pbuf, 8) == 0) { 438 } else if (memcmp("IntxCHR", pbuf, 8) == 0) {
437 cFYI(1, "Char device"); 439 cifs_dbg(FYI, "Char device\n");
438 fattr->cf_mode |= S_IFCHR; 440 fattr->cf_mode |= S_IFCHR;
439 fattr->cf_dtype = DT_CHR; 441 fattr->cf_dtype = DT_CHR;
440 if (bytes_read == 24) { 442 if (bytes_read == 24) {
@@ -446,7 +448,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
446 fattr->cf_rdev = MKDEV(mjr, mnr); 448 fattr->cf_rdev = MKDEV(mjr, mnr);
447 } 449 }
448 } else if (memcmp("IntxLNK", pbuf, 7) == 0) { 450 } else if (memcmp("IntxLNK", pbuf, 7) == 0) {
449 cFYI(1, "Symlink"); 451 cifs_dbg(FYI, "Symlink\n");
450 fattr->cf_mode |= S_IFLNK; 452 fattr->cf_mode |= S_IFLNK;
451 fattr->cf_dtype = DT_LNK; 453 fattr->cf_dtype = DT_LNK;
452 } else { 454 } else {
@@ -497,10 +499,10 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
497 else if (rc > 3) { 499 else if (rc > 3) {
498 mode = le32_to_cpu(*((__le32 *)ea_value)); 500 mode = le32_to_cpu(*((__le32 *)ea_value));
499 fattr->cf_mode &= ~SFBITS_MASK; 501 fattr->cf_mode &= ~SFBITS_MASK;
500 cFYI(1, "special bits 0%o org mode 0%o", mode, 502 cifs_dbg(FYI, "special bits 0%o org mode 0%o\n",
501 fattr->cf_mode); 503 mode, fattr->cf_mode);
502 fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode; 504 fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode;
503 cFYI(1, "special mode bits 0%o", mode); 505 cifs_dbg(FYI, "special mode bits 0%o\n", mode);
504 } 506 }
505 507
506 return 0; 508 return 0;
@@ -635,11 +637,11 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
635 tcon = tlink_tcon(tlink); 637 tcon = tlink_tcon(tlink);
636 server = tcon->ses->server; 638 server = tcon->ses->server;
637 639
638 cFYI(1, "Getting info on %s", full_path); 640 cifs_dbg(FYI, "Getting info on %s\n", full_path);
639 641
640 if ((data == NULL) && (*inode != NULL)) { 642 if ((data == NULL) && (*inode != NULL)) {
641 if (CIFS_I(*inode)->clientCanCacheRead) { 643 if (CIFS_I(*inode)->clientCanCacheRead) {
642 cFYI(1, "No need to revalidate cached inode sizes"); 644 cifs_dbg(FYI, "No need to revalidate cached inode sizes\n");
643 goto cgii_exit; 645 goto cgii_exit;
644 } 646 }
645 } 647 }
@@ -714,7 +716,8 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
714 tcon, cifs_sb, full_path, 716 tcon, cifs_sb, full_path,
715 &fattr.cf_uniqueid, data); 717 &fattr.cf_uniqueid, data);
716 if (tmprc) { 718 if (tmprc) {
717 cFYI(1, "GetSrvInodeNum rc %d", tmprc); 719 cifs_dbg(FYI, "GetSrvInodeNum rc %d\n",
720 tmprc);
718 fattr.cf_uniqueid = iunique(sb, ROOT_I); 721 fattr.cf_uniqueid = iunique(sb, ROOT_I);
719 cifs_autodisable_serverino(cifs_sb); 722 cifs_autodisable_serverino(cifs_sb);
720 } 723 }
@@ -729,7 +732,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
729 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { 732 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
730 tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid); 733 tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid);
731 if (tmprc) 734 if (tmprc)
732 cFYI(1, "cifs_sfu_type failed: %d", tmprc); 735 cifs_dbg(FYI, "cifs_sfu_type failed: %d\n", tmprc);
733 } 736 }
734 737
735#ifdef CONFIG_CIFS_ACL 738#ifdef CONFIG_CIFS_ACL
@@ -737,8 +740,8 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
737 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { 740 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
738 rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, full_path, fid); 741 rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, full_path, fid);
739 if (rc) { 742 if (rc) {
740 cFYI(1, "%s: Getting ACL failed with error: %d", 743 cifs_dbg(FYI, "%s: Getting ACL failed with error: %d\n",
741 __func__, rc); 744 __func__, rc);
742 goto cgii_exit; 745 goto cgii_exit;
743 } 746 }
744 } 747 }
@@ -752,7 +755,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
752 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) { 755 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) {
753 tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid); 756 tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid);
754 if (tmprc) 757 if (tmprc)
755 cFYI(1, "CIFSCheckMFSymlink: %d", tmprc); 758 cifs_dbg(FYI, "CIFSCheckMFSymlink: %d\n", tmprc);
756 } 759 }
757 760
758 if (!*inode) { 761 if (!*inode) {
@@ -836,7 +839,7 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
836 struct inode *inode; 839 struct inode *inode;
837 840
838retry_iget5_locked: 841retry_iget5_locked:
839 cFYI(1, "looking for uniqueid=%llu", fattr->cf_uniqueid); 842 cifs_dbg(FYI, "looking for uniqueid=%llu\n", fattr->cf_uniqueid);
840 843
841 /* hash down to 32-bits on 32-bit arch */ 844 /* hash down to 32-bits on 32-bit arch */
842 hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid); 845 hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);
@@ -899,7 +902,7 @@ struct inode *cifs_root_iget(struct super_block *sb)
899#endif 902#endif
900 903
901 if (rc && tcon->ipc) { 904 if (rc && tcon->ipc) {
902 cFYI(1, "ipc connection - fake read inode"); 905 cifs_dbg(FYI, "ipc connection - fake read inode\n");
903 spin_lock(&inode->i_lock); 906 spin_lock(&inode->i_lock);
904 inode->i_mode |= S_IFDIR; 907 inode->i_mode |= S_IFDIR;
905 set_nlink(inode, 2); 908 set_nlink(inode, 2);
@@ -958,7 +961,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
958 * server times. 961 * server times.
959 */ 962 */
960 if (set_time && (attrs->ia_valid & ATTR_CTIME)) { 963 if (set_time && (attrs->ia_valid & ATTR_CTIME)) {
961 cFYI(1, "CIFS - CTIME changed"); 964 cifs_dbg(FYI, "CIFS - CTIME changed\n");
962 info_buf.ChangeTime = 965 info_buf.ChangeTime =
963 cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime)); 966 cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime));
964 } else 967 } else
@@ -1127,7 +1130,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
1127 struct iattr *attrs = NULL; 1130 struct iattr *attrs = NULL;
1128 __u32 dosattr = 0, origattr = 0; 1131 __u32 dosattr = 0, origattr = 0;
1129 1132
1130 cFYI(1, "cifs_unlink, dir=0x%p, dentry=0x%p", dir, dentry); 1133 cifs_dbg(FYI, "cifs_unlink, dir=0x%p, dentry=0x%p\n", dir, dentry);
1131 1134
1132 tlink = cifs_sb_tlink(cifs_sb); 1135 tlink = cifs_sb_tlink(cifs_sb);
1133 if (IS_ERR(tlink)) 1136 if (IS_ERR(tlink))
@@ -1150,7 +1153,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
1150 rc = CIFSPOSIXDelFile(xid, tcon, full_path, 1153 rc = CIFSPOSIXDelFile(xid, tcon, full_path,
1151 SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, 1154 SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls,
1152 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 1155 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
1153 cFYI(1, "posix del rc %d", rc); 1156 cifs_dbg(FYI, "posix del rc %d\n", rc);
1154 if ((rc == 0) || (rc == -ENOENT)) 1157 if ((rc == 0) || (rc == -ENOENT))
1155 goto psx_del_no_retry; 1158 goto psx_del_no_retry;
1156 } 1159 }
@@ -1320,7 +1323,7 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode,
1320 if (rc == -EOPNOTSUPP) 1323 if (rc == -EOPNOTSUPP)
1321 goto posix_mkdir_out; 1324 goto posix_mkdir_out;
1322 else if (rc) { 1325 else if (rc) {
1323 cFYI(1, "posix mkdir returned 0x%x", rc); 1326 cifs_dbg(FYI, "posix mkdir returned 0x%x\n", rc);
1324 d_drop(dentry); 1327 d_drop(dentry);
1325 goto posix_mkdir_out; 1328 goto posix_mkdir_out;
1326 } 1329 }
@@ -1342,11 +1345,12 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode,
1342 d_instantiate(dentry, newinode); 1345 d_instantiate(dentry, newinode);
1343 1346
1344#ifdef CONFIG_CIFS_DEBUG2 1347#ifdef CONFIG_CIFS_DEBUG2
1345 cFYI(1, "instantiated dentry %p %s to inode %p", dentry, 1348 cifs_dbg(FYI, "instantiated dentry %p %s to inode %p\n",
1346 dentry->d_name.name, newinode); 1349 dentry, dentry->d_name.name, newinode);
1347 1350
1348 if (newinode->i_nlink != 2) 1351 if (newinode->i_nlink != 2)
1349 cFYI(1, "unexpected number of links %d", newinode->i_nlink); 1352 cifs_dbg(FYI, "unexpected number of links %d\n",
1353 newinode->i_nlink);
1350#endif 1354#endif
1351 1355
1352posix_mkdir_out: 1356posix_mkdir_out:
@@ -1368,7 +1372,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1368 struct TCP_Server_Info *server; 1372 struct TCP_Server_Info *server;
1369 char *full_path; 1373 char *full_path;
1370 1374
1371 cFYI(1, "In cifs_mkdir, mode = 0x%hx inode = 0x%p", mode, inode); 1375 cifs_dbg(FYI, "In cifs_mkdir, mode = 0x%hx inode = 0x%p\n",
1376 mode, inode);
1372 1377
1373 cifs_sb = CIFS_SB(inode->i_sb); 1378 cifs_sb = CIFS_SB(inode->i_sb);
1374 tlink = cifs_sb_tlink(cifs_sb); 1379 tlink = cifs_sb_tlink(cifs_sb);
@@ -1402,7 +1407,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1402 /* BB add setting the equivalent of mode via CreateX w/ACLs */ 1407 /* BB add setting the equivalent of mode via CreateX w/ACLs */
1403 rc = server->ops->mkdir(xid, tcon, full_path, cifs_sb); 1408 rc = server->ops->mkdir(xid, tcon, full_path, cifs_sb);
1404 if (rc) { 1409 if (rc) {
1405 cFYI(1, "cifs_mkdir returned 0x%x", rc); 1410 cifs_dbg(FYI, "cifs_mkdir returned 0x%x\n", rc);
1406 d_drop(direntry); 1411 d_drop(direntry);
1407 goto mkdir_out; 1412 goto mkdir_out;
1408 } 1413 }
@@ -1432,7 +1437,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1432 char *full_path = NULL; 1437 char *full_path = NULL;
1433 struct cifsInodeInfo *cifsInode; 1438 struct cifsInodeInfo *cifsInode;
1434 1439
1435 cFYI(1, "cifs_rmdir, inode = 0x%p", inode); 1440 cifs_dbg(FYI, "cifs_rmdir, inode = 0x%p\n", inode);
1436 1441
1437 xid = get_xid(); 1442 xid = get_xid();
1438 1443
@@ -1681,8 +1686,8 @@ cifs_invalidate_mapping(struct inode *inode)
1681 if (inode->i_mapping && inode->i_mapping->nrpages != 0) { 1686 if (inode->i_mapping && inode->i_mapping->nrpages != 0) {
1682 rc = invalidate_inode_pages2(inode->i_mapping); 1687 rc = invalidate_inode_pages2(inode->i_mapping);
1683 if (rc) { 1688 if (rc) {
1684 cERROR(1, "%s: could not invalidate inode %p", __func__, 1689 cifs_dbg(VFS, "%s: could not invalidate inode %p\n",
1685 inode); 1690 __func__, inode);
1686 cifs_i->invalid_mapping = true; 1691 cifs_i->invalid_mapping = true;
1687 } 1692 }
1688 } 1693 }
@@ -1732,8 +1737,8 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
1732 goto out; 1737 goto out;
1733 } 1738 }
1734 1739
1735 cFYI(1, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time " 1740 cifs_dbg(FYI, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time %ld jiffies %ld\n",
1736 "%ld jiffies %ld", full_path, inode, inode->i_count.counter, 1741 full_path, inode, inode->i_count.counter,
1737 dentry, dentry->d_time, jiffies); 1742 dentry, dentry->d_time, jiffies);
1738 1743
1739 if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext) 1744 if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext)
@@ -1883,7 +1888,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
1883 else 1888 else
1884 rc = -ENOSYS; 1889 rc = -ENOSYS;
1885 cifsFileInfo_put(open_file); 1890 cifsFileInfo_put(open_file);
1886 cFYI(1, "SetFSize for attrs rc = %d", rc); 1891 cifs_dbg(FYI, "SetFSize for attrs rc = %d\n", rc);
1887 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { 1892 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
1888 unsigned int bytes_written; 1893 unsigned int bytes_written;
1889 1894
@@ -1894,7 +1899,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
1894 io_parms.length = attrs->ia_size; 1899 io_parms.length = attrs->ia_size;
1895 rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, 1900 rc = CIFSSMBWrite(xid, &io_parms, &bytes_written,
1896 NULL, NULL, 1); 1901 NULL, NULL, 1);
1897 cFYI(1, "Wrt seteof rc %d", rc); 1902 cifs_dbg(FYI, "Wrt seteof rc %d\n", rc);
1898 } 1903 }
1899 } else 1904 } else
1900 rc = -EINVAL; 1905 rc = -EINVAL;
@@ -1920,7 +1925,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
1920 attrs->ia_size, cifs_sb, false); 1925 attrs->ia_size, cifs_sb, false);
1921 else 1926 else
1922 rc = -ENOSYS; 1927 rc = -ENOSYS;
1923 cFYI(1, "SetEOF by path (setattrs) rc = %d", rc); 1928 cifs_dbg(FYI, "SetEOF by path (setattrs) rc = %d\n", rc);
1924 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { 1929 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
1925 __u16 netfid; 1930 __u16 netfid;
1926 int oplock = 0; 1931 int oplock = 0;
@@ -1940,7 +1945,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
1940 io_parms.length = attrs->ia_size; 1945 io_parms.length = attrs->ia_size;
1941 rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, NULL, 1946 rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, NULL,
1942 NULL, 1); 1947 NULL, 1);
1943 cFYI(1, "wrt seteof rc %d", rc); 1948 cifs_dbg(FYI, "wrt seteof rc %d\n", rc);
1944 CIFSSMBClose(xid, tcon, netfid); 1949 CIFSSMBClose(xid, tcon, netfid);
1945 } 1950 }
1946 } 1951 }
@@ -1971,7 +1976,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
1971 struct cifs_unix_set_info_args *args = NULL; 1976 struct cifs_unix_set_info_args *args = NULL;
1972 struct cifsFileInfo *open_file; 1977 struct cifsFileInfo *open_file;
1973 1978
1974 cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x", 1979 cifs_dbg(FYI, "setattr_unix on file %s attrs->ia_valid=0x%x\n",
1975 direntry->d_name.name, attrs->ia_valid); 1980 direntry->d_name.name, attrs->ia_valid);
1976 1981
1977 xid = get_xid(); 1982 xid = get_xid();
@@ -2114,7 +2119,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2114 2119
2115 xid = get_xid(); 2120 xid = get_xid();
2116 2121
2117 cFYI(1, "setattr on file %s attrs->iavalid 0x%x", 2122 cifs_dbg(FYI, "setattr on file %s attrs->iavalid 0x%x\n",
2118 direntry->d_name.name, attrs->ia_valid); 2123 direntry->d_name.name, attrs->ia_valid);
2119 2124
2120 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) 2125 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
@@ -2166,8 +2171,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2166 rc = id_mode_to_cifs_acl(inode, full_path, NO_CHANGE_64, 2171 rc = id_mode_to_cifs_acl(inode, full_path, NO_CHANGE_64,
2167 uid, gid); 2172 uid, gid);
2168 if (rc) { 2173 if (rc) {
2169 cFYI(1, "%s: Setting id failed with error: %d", 2174 cifs_dbg(FYI, "%s: Setting id failed with error: %d\n",
2170 __func__, rc); 2175 __func__, rc);
2171 goto cifs_setattr_exit; 2176 goto cifs_setattr_exit;
2172 } 2177 }
2173 } 2178 }
@@ -2188,8 +2193,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2188 rc = id_mode_to_cifs_acl(inode, full_path, mode, 2193 rc = id_mode_to_cifs_acl(inode, full_path, mode,
2189 INVALID_UID, INVALID_GID); 2194 INVALID_UID, INVALID_GID);
2190 if (rc) { 2195 if (rc) {
2191 cFYI(1, "%s: Setting ACL failed with error: %d", 2196 cifs_dbg(FYI, "%s: Setting ACL failed with error: %d\n",
2192 __func__, rc); 2197 __func__, rc);
2193 goto cifs_setattr_exit; 2198 goto cifs_setattr_exit;
2194 } 2199 }
2195 } else 2200 } else
@@ -2277,7 +2282,7 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
2277#if 0 2282#if 0
2278void cifs_delete_inode(struct inode *inode) 2283void cifs_delete_inode(struct inode *inode)
2279{ 2284{
2280 cFYI(1, "In cifs_delete_inode, inode = 0x%p", inode); 2285 cifs_dbg(FYI, "In cifs_delete_inode, inode = 0x%p\n", inode);
2281 /* may have to add back in if and when safe distributed caching of 2286 /* may have to add back in if and when safe distributed caching of
2282 directories added e.g. via FindNotify */ 2287 directories added e.g. via FindNotify */
2283} 2288}
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index 6c9f1214cf0b..3e0845585853 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
44 44
45 xid = get_xid(); 45 xid = get_xid();
46 46
47 cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg); 47 cifs_dbg(FYI, "ioctl file %p cmd %u arg %lu\n", filep, command, arg);
48 48
49 cifs_sb = CIFS_SB(inode->i_sb); 49 cifs_sb = CIFS_SB(inode->i_sb);
50 50
@@ -83,11 +83,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
83 * &ExtAttrMask); 83 * &ExtAttrMask);
84 */ 84 */
85 } 85 }
86 cFYI(1, "set flags not implemented yet"); 86 cifs_dbg(FYI, "set flags not implemented yet\n");
87 break; 87 break;
88#endif /* CONFIG_CIFS_POSIX */ 88#endif /* CONFIG_CIFS_POSIX */
89 default: 89 default:
90 cFYI(1, "unsupported ioctl"); 90 cifs_dbg(FYI, "unsupported ioctl\n");
91 break; 91 break;
92 } 92 }
93 93
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 9f6c4c45d21e..b83c3f5646bd 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -56,14 +56,14 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
56 md5 = crypto_alloc_shash("md5", 0, 0); 56 md5 = crypto_alloc_shash("md5", 0, 0);
57 if (IS_ERR(md5)) { 57 if (IS_ERR(md5)) {
58 rc = PTR_ERR(md5); 58 rc = PTR_ERR(md5);
59 cERROR(1, "%s: Crypto md5 allocation error %d", __func__, rc); 59 cifs_dbg(VFS, "%s: Crypto md5 allocation error %d\n",
60 __func__, rc);
60 return rc; 61 return rc;
61 } 62 }
62 size = sizeof(struct shash_desc) + crypto_shash_descsize(md5); 63 size = sizeof(struct shash_desc) + crypto_shash_descsize(md5);
63 sdescmd5 = kmalloc(size, GFP_KERNEL); 64 sdescmd5 = kmalloc(size, GFP_KERNEL);
64 if (!sdescmd5) { 65 if (!sdescmd5) {
65 rc = -ENOMEM; 66 rc = -ENOMEM;
66 cERROR(1, "%s: Memory allocation failure", __func__);
67 goto symlink_hash_err; 67 goto symlink_hash_err;
68 } 68 }
69 sdescmd5->shash.tfm = md5; 69 sdescmd5->shash.tfm = md5;
@@ -71,17 +71,17 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
71 71
72 rc = crypto_shash_init(&sdescmd5->shash); 72 rc = crypto_shash_init(&sdescmd5->shash);
73 if (rc) { 73 if (rc) {
74 cERROR(1, "%s: Could not init md5 shash", __func__); 74 cifs_dbg(VFS, "%s: Could not init md5 shash\n", __func__);
75 goto symlink_hash_err; 75 goto symlink_hash_err;
76 } 76 }
77 rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len); 77 rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len);
78 if (rc) { 78 if (rc) {
79 cERROR(1, "%s: Could not update with link_str", __func__); 79 cifs_dbg(VFS, "%s: Could not update with link_str\n", __func__);
80 goto symlink_hash_err; 80 goto symlink_hash_err;
81 } 81 }
82 rc = crypto_shash_final(&sdescmd5->shash, md5_hash); 82 rc = crypto_shash_final(&sdescmd5->shash, md5_hash);
83 if (rc) 83 if (rc)
84 cERROR(1, "%s: Could not generate md5 hash", __func__); 84 cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
85 85
86symlink_hash_err: 86symlink_hash_err:
87 crypto_free_shash(md5); 87 crypto_free_shash(md5);
@@ -115,7 +115,7 @@ CIFSParseMFSymlink(const u8 *buf,
115 115
116 rc = symlink_hash(link_len, link_str, md5_hash); 116 rc = symlink_hash(link_len, link_str, md5_hash);
117 if (rc) { 117 if (rc) {
118 cFYI(1, "%s: MD5 hash failure: %d", __func__, rc); 118 cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
119 return rc; 119 return rc;
120 } 120 }
121 121
@@ -154,7 +154,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str)
154 154
155 rc = symlink_hash(link_len, link_str, md5_hash); 155 rc = symlink_hash(link_len, link_str, md5_hash);
156 if (rc) { 156 if (rc) {
157 cFYI(1, "%s: MD5 hash failure: %d", __func__, rc); 157 cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
158 return rc; 158 return rc;
159 } 159 }
160 160
@@ -521,7 +521,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
521 if (!full_path) 521 if (!full_path)
522 goto out; 522 goto out;
523 523
524 cFYI(1, "Full path: %s inode = 0x%p", full_path, inode); 524 cifs_dbg(FYI, "Full path: %s inode = 0x%p\n", full_path, inode);
525 525
526 rc = -EACCES; 526 rc = -EACCES;
527 /* 527 /*
@@ -578,8 +578,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
578 goto symlink_exit; 578 goto symlink_exit;
579 } 579 }
580 580
581 cFYI(1, "Full path: %s", full_path); 581 cifs_dbg(FYI, "Full path: %s\n", full_path);
582 cFYI(1, "symname is %s", symname); 582 cifs_dbg(FYI, "symname is %s\n", symname);
583 583
584 /* BB what if DFS and this volume is on different share? BB */ 584 /* BB what if DFS and this volume is on different share? BB */
585 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) 585 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS)
@@ -601,8 +601,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
601 inode->i_sb, xid, NULL); 601 inode->i_sb, xid, NULL);
602 602
603 if (rc != 0) { 603 if (rc != 0) {
604 cFYI(1, "Create symlink ok, getinodeinfo fail rc = %d", 604 cifs_dbg(FYI, "Create symlink ok, getinodeinfo fail rc = %d\n",
605 rc); 605 rc);
606 } else { 606 } else {
607 d_instantiate(direntry, newinode); 607 d_instantiate(direntry, newinode);
608 } 608 }
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 1b15bf839f37..1bec014779fd 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -54,7 +54,7 @@ _get_xid(void)
54 if (GlobalTotalActiveXid > GlobalMaxActiveXid) 54 if (GlobalTotalActiveXid > GlobalMaxActiveXid)
55 GlobalMaxActiveXid = GlobalTotalActiveXid; 55 GlobalMaxActiveXid = GlobalTotalActiveXid;
56 if (GlobalTotalActiveXid > 65000) 56 if (GlobalTotalActiveXid > 65000)
57 cFYI(1, "warning: more than 65000 requests active"); 57 cifs_dbg(FYI, "warning: more than 65000 requests active\n");
58 xid = GlobalCurrentXid++; 58 xid = GlobalCurrentXid++;
59 spin_unlock(&GlobalMid_Lock); 59 spin_unlock(&GlobalMid_Lock);
60 return xid; 60 return xid;
@@ -91,7 +91,7 @@ void
91sesInfoFree(struct cifs_ses *buf_to_free) 91sesInfoFree(struct cifs_ses *buf_to_free)
92{ 92{
93 if (buf_to_free == NULL) { 93 if (buf_to_free == NULL) {
94 cFYI(1, "Null buffer passed to sesInfoFree"); 94 cifs_dbg(FYI, "Null buffer passed to sesInfoFree\n");
95 return; 95 return;
96 } 96 }
97 97
@@ -130,7 +130,7 @@ void
130tconInfoFree(struct cifs_tcon *buf_to_free) 130tconInfoFree(struct cifs_tcon *buf_to_free)
131{ 131{
132 if (buf_to_free == NULL) { 132 if (buf_to_free == NULL) {
133 cFYI(1, "Null buffer passed to tconInfoFree"); 133 cifs_dbg(FYI, "Null buffer passed to tconInfoFree\n");
134 return; 134 return;
135 } 135 }
136 atomic_dec(&tconInfoAllocCount); 136 atomic_dec(&tconInfoAllocCount);
@@ -180,7 +180,7 @@ void
180cifs_buf_release(void *buf_to_free) 180cifs_buf_release(void *buf_to_free)
181{ 181{
182 if (buf_to_free == NULL) { 182 if (buf_to_free == NULL) {
183 /* cFYI(1, "Null buffer passed to cifs_buf_release");*/ 183 /* cifs_dbg(FYI, "Null buffer passed to cifs_buf_release\n");*/
184 return; 184 return;
185 } 185 }
186 mempool_free(buf_to_free, cifs_req_poolp); 186 mempool_free(buf_to_free, cifs_req_poolp);
@@ -216,7 +216,7 @@ cifs_small_buf_release(void *buf_to_free)
216{ 216{
217 217
218 if (buf_to_free == NULL) { 218 if (buf_to_free == NULL) {
219 cFYI(1, "Null buffer passed to cifs_small_buf_release"); 219 cifs_dbg(FYI, "Null buffer passed to cifs_small_buf_release\n");
220 return; 220 return;
221 } 221 }
222 mempool_free(buf_to_free, cifs_sm_req_poolp); 222 mempool_free(buf_to_free, cifs_sm_req_poolp);
@@ -282,15 +282,15 @@ check_smb_hdr(struct smb_hdr *smb, __u16 mid)
282{ 282{
283 /* does it have the right SMB "signature" ? */ 283 /* does it have the right SMB "signature" ? */
284 if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) { 284 if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) {
285 cERROR(1, "Bad protocol string signature header 0x%x", 285 cifs_dbg(VFS, "Bad protocol string signature header 0x%x\n",
286 *(unsigned int *)smb->Protocol); 286 *(unsigned int *)smb->Protocol);
287 return 1; 287 return 1;
288 } 288 }
289 289
290 /* Make sure that message ids match */ 290 /* Make sure that message ids match */
291 if (mid != smb->Mid) { 291 if (mid != smb->Mid) {
292 cERROR(1, "Mids do not match. received=%u expected=%u", 292 cifs_dbg(VFS, "Mids do not match. received=%u expected=%u\n",
293 smb->Mid, mid); 293 smb->Mid, mid);
294 return 1; 294 return 1;
295 } 295 }
296 296
@@ -302,7 +302,7 @@ check_smb_hdr(struct smb_hdr *smb, __u16 mid)
302 if (smb->Command == SMB_COM_LOCKING_ANDX) 302 if (smb->Command == SMB_COM_LOCKING_ANDX)
303 return 0; 303 return 0;
304 304
305 cERROR(1, "Server sent request, not response. mid=%u", smb->Mid); 305 cifs_dbg(VFS, "Server sent request, not response. mid=%u\n", smb->Mid);
306 return 1; 306 return 1;
307} 307}
308 308
@@ -313,8 +313,8 @@ checkSMB(char *buf, unsigned int total_read)
313 __u16 mid = smb->Mid; 313 __u16 mid = smb->Mid;
314 __u32 rfclen = be32_to_cpu(smb->smb_buf_length); 314 __u32 rfclen = be32_to_cpu(smb->smb_buf_length);
315 __u32 clc_len; /* calculated length */ 315 __u32 clc_len; /* calculated length */
316 cFYI(0, "checkSMB Length: 0x%x, smb_buf_length: 0x%x", 316 cifs_dbg(FYI, "checkSMB Length: 0x%x, smb_buf_length: 0x%x\n",
317 total_read, rfclen); 317 total_read, rfclen);
318 318
319 /* is this frame too small to even get to a BCC? */ 319 /* is this frame too small to even get to a BCC? */
320 if (total_read < 2 + sizeof(struct smb_hdr)) { 320 if (total_read < 2 + sizeof(struct smb_hdr)) {
@@ -340,9 +340,9 @@ checkSMB(char *buf, unsigned int total_read)
340 tmp[sizeof(struct smb_hdr)+1] = 0; 340 tmp[sizeof(struct smb_hdr)+1] = 0;
341 return 0; 341 return 0;
342 } 342 }
343 cERROR(1, "rcvd invalid byte count (bcc)"); 343 cifs_dbg(VFS, "rcvd invalid byte count (bcc)\n");
344 } else { 344 } else {
345 cERROR(1, "Length less than smb header size"); 345 cifs_dbg(VFS, "Length less than smb header size\n");
346 } 346 }
347 return -EIO; 347 return -EIO;
348 } 348 }
@@ -353,8 +353,8 @@ checkSMB(char *buf, unsigned int total_read)
353 clc_len = smbCalcSize(smb); 353 clc_len = smbCalcSize(smb);
354 354
355 if (4 + rfclen != total_read) { 355 if (4 + rfclen != total_read) {
356 cERROR(1, "Length read does not match RFC1001 length %d", 356 cifs_dbg(VFS, "Length read does not match RFC1001 length %d\n",
357 rfclen); 357 rfclen);
358 return -EIO; 358 return -EIO;
359 } 359 }
360 360
@@ -365,12 +365,12 @@ checkSMB(char *buf, unsigned int total_read)
365 if (((4 + rfclen) & 0xFFFF) == (clc_len & 0xFFFF)) 365 if (((4 + rfclen) & 0xFFFF) == (clc_len & 0xFFFF))
366 return 0; /* bcc wrapped */ 366 return 0; /* bcc wrapped */
367 } 367 }
368 cFYI(1, "Calculated size %u vs length %u mismatch for mid=%u", 368 cifs_dbg(FYI, "Calculated size %u vs length %u mismatch for mid=%u\n",
369 clc_len, 4 + rfclen, smb->Mid); 369 clc_len, 4 + rfclen, smb->Mid);
370 370
371 if (4 + rfclen < clc_len) { 371 if (4 + rfclen < clc_len) {
372 cERROR(1, "RFC1001 size %u smaller than SMB for mid=%u", 372 cifs_dbg(VFS, "RFC1001 size %u smaller than SMB for mid=%u\n",
373 rfclen, smb->Mid); 373 rfclen, smb->Mid);
374 return -EIO; 374 return -EIO;
375 } else if (rfclen > clc_len + 512) { 375 } else if (rfclen > clc_len + 512) {
376 /* 376 /*
@@ -382,8 +382,8 @@ checkSMB(char *buf, unsigned int total_read)
382 * trailing data, we choose limit the amount of extra 382 * trailing data, we choose limit the amount of extra
383 * data to 512 bytes. 383 * data to 512 bytes.
384 */ 384 */
385 cERROR(1, "RFC1001 size %u more than 512 bytes larger " 385 cifs_dbg(VFS, "RFC1001 size %u more than 512 bytes larger than SMB for mid=%u\n",
386 "than SMB for mid=%u", rfclen, smb->Mid); 386 rfclen, smb->Mid);
387 return -EIO; 387 return -EIO;
388 } 388 }
389 } 389 }
@@ -401,7 +401,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
401 struct cifsInodeInfo *pCifsInode; 401 struct cifsInodeInfo *pCifsInode;
402 struct cifsFileInfo *netfile; 402 struct cifsFileInfo *netfile;
403 403
404 cFYI(1, "Checking for oplock break or dnotify response"); 404 cifs_dbg(FYI, "Checking for oplock break or dnotify response\n");
405 if ((pSMB->hdr.Command == SMB_COM_NT_TRANSACT) && 405 if ((pSMB->hdr.Command == SMB_COM_NT_TRANSACT) &&
406 (pSMB->hdr.Flags & SMBFLG_RESPONSE)) { 406 (pSMB->hdr.Flags & SMBFLG_RESPONSE)) {
407 struct smb_com_transaction_change_notify_rsp *pSMBr = 407 struct smb_com_transaction_change_notify_rsp *pSMBr =
@@ -413,15 +413,15 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
413 413
414 pnotify = (struct file_notify_information *) 414 pnotify = (struct file_notify_information *)
415 ((char *)&pSMBr->hdr.Protocol + data_offset); 415 ((char *)&pSMBr->hdr.Protocol + data_offset);
416 cFYI(1, "dnotify on %s Action: 0x%x", 416 cifs_dbg(FYI, "dnotify on %s Action: 0x%x\n",
417 pnotify->FileName, pnotify->Action); 417 pnotify->FileName, pnotify->Action);
418 /* cifs_dump_mem("Rcvd notify Data: ",buf, 418 /* cifs_dump_mem("Rcvd notify Data: ",buf,
419 sizeof(struct smb_hdr)+60); */ 419 sizeof(struct smb_hdr)+60); */
420 return true; 420 return true;
421 } 421 }
422 if (pSMBr->hdr.Status.CifsError) { 422 if (pSMBr->hdr.Status.CifsError) {
423 cFYI(1, "notify err 0x%d", 423 cifs_dbg(FYI, "notify err 0x%d\n",
424 pSMBr->hdr.Status.CifsError); 424 pSMBr->hdr.Status.CifsError);
425 return true; 425 return true;
426 } 426 }
427 return false; 427 return false;
@@ -435,7 +435,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
435 large dirty files cached on the client */ 435 large dirty files cached on the client */
436 if ((NT_STATUS_INVALID_HANDLE) == 436 if ((NT_STATUS_INVALID_HANDLE) ==
437 le32_to_cpu(pSMB->hdr.Status.CifsError)) { 437 le32_to_cpu(pSMB->hdr.Status.CifsError)) {
438 cFYI(1, "invalid handle on oplock break"); 438 cifs_dbg(FYI, "invalid handle on oplock break\n");
439 return true; 439 return true;
440 } else if (ERRbadfid == 440 } else if (ERRbadfid ==
441 le16_to_cpu(pSMB->hdr.Status.DosError.Error)) { 441 le16_to_cpu(pSMB->hdr.Status.DosError.Error)) {
@@ -447,7 +447,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
447 if (pSMB->hdr.WordCount != 8) 447 if (pSMB->hdr.WordCount != 8)
448 return false; 448 return false;
449 449
450 cFYI(1, "oplock type 0x%d level 0x%d", 450 cifs_dbg(FYI, "oplock type 0x%d level 0x%d\n",
451 pSMB->LockType, pSMB->OplockLevel); 451 pSMB->LockType, pSMB->OplockLevel);
452 if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE)) 452 if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE))
453 return false; 453 return false;
@@ -469,7 +469,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
469 if (pSMB->Fid != netfile->fid.netfid) 469 if (pSMB->Fid != netfile->fid.netfid)
470 continue; 470 continue;
471 471
472 cFYI(1, "file id match, oplock break"); 472 cifs_dbg(FYI, "file id match, oplock break\n");
473 pCifsInode = CIFS_I(netfile->dentry->d_inode); 473 pCifsInode = CIFS_I(netfile->dentry->d_inode);
474 474
475 cifs_set_oplock_level(pCifsInode, 475 cifs_set_oplock_level(pCifsInode,
@@ -484,12 +484,12 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
484 } 484 }
485 spin_unlock(&cifs_file_list_lock); 485 spin_unlock(&cifs_file_list_lock);
486 spin_unlock(&cifs_tcp_ses_lock); 486 spin_unlock(&cifs_tcp_ses_lock);
487 cFYI(1, "No matching file for oplock break"); 487 cifs_dbg(FYI, "No matching file for oplock break\n");
488 return true; 488 return true;
489 } 489 }
490 } 490 }
491 spin_unlock(&cifs_tcp_ses_lock); 491 spin_unlock(&cifs_tcp_ses_lock);
492 cFYI(1, "Can not process oplock break for non-existent connection"); 492 cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
493 return true; 493 return true;
494} 494}
495 495
@@ -536,12 +536,8 @@ cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb)
536{ 536{
537 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { 537 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
538 cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM; 538 cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM;
539 cERROR(1, "Autodisabling the use of server inode numbers on " 539 cifs_dbg(VFS, "Autodisabling the use of server inode numbers on %s. This server doesn't seem to support them properly. Hardlinks will not be recognized on this mount. Consider mounting with the \"noserverino\" option to silence this message.\n",
540 "%s. This server doesn't seem to support them " 540 cifs_sb_master_tcon(cifs_sb)->treeName);
541 "properly. Hardlinks will not be recognized on this "
542 "mount. Consider mounting with the \"noserverino\" "
543 "option to silence this message.",
544 cifs_sb_master_tcon(cifs_sb)->treeName);
545 } 541 }
546} 542}
547 543
@@ -552,13 +548,13 @@ void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock)
552 if (oplock == OPLOCK_EXCLUSIVE) { 548 if (oplock == OPLOCK_EXCLUSIVE) {
553 cinode->clientCanCacheAll = true; 549 cinode->clientCanCacheAll = true;
554 cinode->clientCanCacheRead = true; 550 cinode->clientCanCacheRead = true;
555 cFYI(1, "Exclusive Oplock granted on inode %p", 551 cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n",
556 &cinode->vfs_inode); 552 &cinode->vfs_inode);
557 } else if (oplock == OPLOCK_READ) { 553 } else if (oplock == OPLOCK_READ) {
558 cinode->clientCanCacheAll = false; 554 cinode->clientCanCacheAll = false;
559 cinode->clientCanCacheRead = true; 555 cinode->clientCanCacheRead = true;
560 cFYI(1, "Level II Oplock granted on inode %p", 556 cifs_dbg(FYI, "Level II Oplock granted on inode %p\n",
561 &cinode->vfs_inode); 557 &cinode->vfs_inode);
562 } else { 558 } else {
563 cinode->clientCanCacheAll = false; 559 cinode->clientCanCacheAll = false;
564 cinode->clientCanCacheRead = false; 560 cinode->clientCanCacheRead = false;
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index c0b25b28be6c..af847e1cf1c1 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -150,8 +150,8 @@ cifs_inet_pton(const int address_family, const char *cp, int len, void *dst)
150 else if (address_family == AF_INET6) 150 else if (address_family == AF_INET6)
151 ret = in6_pton(cp, len, dst , '\\', NULL); 151 ret = in6_pton(cp, len, dst , '\\', NULL);
152 152
153 cFYI(DBG2, "address conversion returned %d for %*.*s", 153 cifs_dbg(NOISY, "address conversion returned %d for %*.*s\n",
154 ret, len, len, cp); 154 ret, len, len, cp);
155 if (ret > 0) 155 if (ret > 0)
156 ret = 1; 156 ret = 1;
157 return ret; 157 return ret;
@@ -887,7 +887,7 @@ map_smb_to_linux_error(char *buf, bool logErr)
887 } 887 }
888 /* else ERRHRD class errors or junk - return EIO */ 888 /* else ERRHRD class errors or junk - return EIO */
889 889
890 cFYI(1, "Mapping smb error code 0x%x to POSIX err %d", 890 cifs_dbg(FYI, "Mapping smb error code 0x%x to POSIX err %d\n",
891 le32_to_cpu(smb->Status.CifsError), rc); 891 le32_to_cpu(smb->Status.CifsError), rc);
892 892
893 /* generic corrective action e.g. reconnect SMB session on 893 /* generic corrective action e.g. reconnect SMB session on
@@ -951,20 +951,20 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
951 SMB_TIME *st = (SMB_TIME *)&time; 951 SMB_TIME *st = (SMB_TIME *)&time;
952 SMB_DATE *sd = (SMB_DATE *)&date; 952 SMB_DATE *sd = (SMB_DATE *)&date;
953 953
954 cFYI(1, "date %d time %d", date, time); 954 cifs_dbg(FYI, "date %d time %d\n", date, time);
955 955
956 sec = 2 * st->TwoSeconds; 956 sec = 2 * st->TwoSeconds;
957 min = st->Minutes; 957 min = st->Minutes;
958 if ((sec > 59) || (min > 59)) 958 if ((sec > 59) || (min > 59))
959 cERROR(1, "illegal time min %d sec %d", min, sec); 959 cifs_dbg(VFS, "illegal time min %d sec %d\n", min, sec);
960 sec += (min * 60); 960 sec += (min * 60);
961 sec += 60 * 60 * st->Hours; 961 sec += 60 * 60 * st->Hours;
962 if (st->Hours > 24) 962 if (st->Hours > 24)
963 cERROR(1, "illegal hours %d", st->Hours); 963 cifs_dbg(VFS, "illegal hours %d\n", st->Hours);
964 days = sd->Day; 964 days = sd->Day;
965 month = sd->Month; 965 month = sd->Month;
966 if ((days > 31) || (month > 12)) { 966 if ((days > 31) || (month > 12)) {
967 cERROR(1, "illegal date, month %d day: %d", month, days); 967 cifs_dbg(VFS, "illegal date, month %d day: %d\n", month, days);
968 if (month > 12) 968 if (month > 12)
969 month = 12; 969 month = 12;
970 } 970 }
@@ -990,7 +990,7 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
990 990
991 ts.tv_sec = sec + offset; 991 ts.tv_sec = sec + offset;
992 992
993 /* cFYI(1, "sec after cnvrt dos to unix time %d",sec); */ 993 /* cifs_dbg(FYI, "sec after cnvrt dos to unix time %d\n",sec); */
994 994
995 ts.tv_nsec = 0; 995 ts.tv_nsec = 0;
996 return ts; 996 return ts;
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index df40cc5fd13a..770d5a9781c1 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -48,15 +48,15 @@ static void dump_cifs_file_struct(struct file *file, char *label)
48 if (file) { 48 if (file) {
49 cf = file->private_data; 49 cf = file->private_data;
50 if (cf == NULL) { 50 if (cf == NULL) {
51 cFYI(1, "empty cifs private file data"); 51 cifs_dbg(FYI, "empty cifs private file data\n");
52 return; 52 return;
53 } 53 }
54 if (cf->invalidHandle) 54 if (cf->invalidHandle)
55 cFYI(1, "invalid handle"); 55 cifs_dbg(FYI, "invalid handle\n");
56 if (cf->srch_inf.endOfSearch) 56 if (cf->srch_inf.endOfSearch)
57 cFYI(1, "end of search"); 57 cifs_dbg(FYI, "end of search\n");
58 if (cf->srch_inf.emptyDir) 58 if (cf->srch_inf.emptyDir)
59 cFYI(1, "empty dir"); 59 cifs_dbg(FYI, "empty dir\n");
60 } 60 }
61} 61}
62#else 62#else
@@ -80,7 +80,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
80 struct super_block *sb = parent->d_inode->i_sb; 80 struct super_block *sb = parent->d_inode->i_sb;
81 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 81 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
82 82
83 cFYI(1, "%s: for %s", __func__, name->name); 83 cifs_dbg(FYI, "%s: for %s\n", __func__, name->name);
84 84
85 dentry = d_hash_and_lookup(parent, name); 85 dentry = d_hash_and_lookup(parent, name);
86 if (unlikely(IS_ERR(dentry))) 86 if (unlikely(IS_ERR(dentry)))
@@ -233,7 +233,7 @@ int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
233 fid, 233 fid,
234 cifs_sb->local_nls); 234 cifs_sb->local_nls);
235 if (CIFSSMBClose(xid, ptcon, fid)) { 235 if (CIFSSMBClose(xid, ptcon, fid)) {
236 cFYI(1, "Error closing temporary reparsepoint open"); 236 cifs_dbg(FYI, "Error closing temporary reparsepoint open\n");
237 } 237 }
238 } 238 }
239} 239}
@@ -285,7 +285,7 @@ initiate_cifs_search(const unsigned int xid, struct file *file)
285 goto error_exit; 285 goto error_exit;
286 } 286 }
287 287
288 cFYI(1, "Full path: %s start at: %lld", full_path, file->f_pos); 288 cifs_dbg(FYI, "Full path: %s start at: %lld\n", full_path, file->f_pos);
289 289
290ffirst_retry: 290ffirst_retry:
291 /* test for Unix extensions */ 291 /* test for Unix extensions */
@@ -336,7 +336,7 @@ static int cifs_unicode_bytelen(const char *str)
336 if (ustr[len] == 0) 336 if (ustr[len] == 0)
337 return len << 1; 337 return len << 1;
338 } 338 }
339 cFYI(1, "Unicode string longer than PATH_MAX found"); 339 cifs_dbg(FYI, "Unicode string longer than PATH_MAX found\n");
340 return len << 1; 340 return len << 1;
341} 341}
342 342
@@ -353,18 +353,18 @@ static char *nxt_dir_entry(char *old_entry, char *end_of_smb, int level)
353 pfData->FileNameLength; 353 pfData->FileNameLength;
354 } else 354 } else
355 new_entry = old_entry + le32_to_cpu(pDirInfo->NextEntryOffset); 355 new_entry = old_entry + le32_to_cpu(pDirInfo->NextEntryOffset);
356 cFYI(1, "new entry %p old entry %p", new_entry, old_entry); 356 cifs_dbg(FYI, "new entry %p old entry %p\n", new_entry, old_entry);
357 /* validate that new_entry is not past end of SMB */ 357 /* validate that new_entry is not past end of SMB */
358 if (new_entry >= end_of_smb) { 358 if (new_entry >= end_of_smb) {
359 cERROR(1, "search entry %p began after end of SMB %p old entry %p", 359 cifs_dbg(VFS, "search entry %p began after end of SMB %p old entry %p\n",
360 new_entry, end_of_smb, old_entry); 360 new_entry, end_of_smb, old_entry);
361 return NULL; 361 return NULL;
362 } else if (((level == SMB_FIND_FILE_INFO_STANDARD) && 362 } else if (((level == SMB_FIND_FILE_INFO_STANDARD) &&
363 (new_entry + sizeof(FIND_FILE_STANDARD_INFO) > end_of_smb)) 363 (new_entry + sizeof(FIND_FILE_STANDARD_INFO) > end_of_smb))
364 || ((level != SMB_FIND_FILE_INFO_STANDARD) && 364 || ((level != SMB_FIND_FILE_INFO_STANDARD) &&
365 (new_entry + sizeof(FILE_DIRECTORY_INFO) > end_of_smb))) { 365 (new_entry + sizeof(FILE_DIRECTORY_INFO) > end_of_smb))) {
366 cERROR(1, "search entry %p extends after end of SMB %p", 366 cifs_dbg(VFS, "search entry %p extends after end of SMB %p\n",
367 new_entry, end_of_smb); 367 new_entry, end_of_smb);
368 return NULL; 368 return NULL;
369 } else 369 } else
370 return new_entry; 370 return new_entry;
@@ -457,7 +457,7 @@ static int cifs_fill_dirent(struct cifs_dirent *de, const void *info,
457 cifs_fill_dirent_std(de, info); 457 cifs_fill_dirent_std(de, info);
458 break; 458 break;
459 default: 459 default:
460 cFYI(1, "Unknown findfirst level %d", level); 460 cifs_dbg(FYI, "Unknown findfirst level %d\n", level);
461 return -EINVAL; 461 return -EINVAL;
462 } 462 }
463 463
@@ -572,7 +572,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
572 if (((index_to_find < cfile->srch_inf.index_of_last_entry) && 572 if (((index_to_find < cfile->srch_inf.index_of_last_entry) &&
573 is_dir_changed(file)) || (index_to_find < first_entry_in_buffer)) { 573 is_dir_changed(file)) || (index_to_find < first_entry_in_buffer)) {
574 /* close and restart search */ 574 /* close and restart search */
575 cFYI(1, "search backing up - close and restart search"); 575 cifs_dbg(FYI, "search backing up - close and restart search\n");
576 spin_lock(&cifs_file_list_lock); 576 spin_lock(&cifs_file_list_lock);
577 if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) { 577 if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) {
578 cfile->invalidHandle = true; 578 cfile->invalidHandle = true;
@@ -582,7 +582,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
582 } else 582 } else
583 spin_unlock(&cifs_file_list_lock); 583 spin_unlock(&cifs_file_list_lock);
584 if (cfile->srch_inf.ntwrk_buf_start) { 584 if (cfile->srch_inf.ntwrk_buf_start) {
585 cFYI(1, "freeing SMB ff cache buf on search rewind"); 585 cifs_dbg(FYI, "freeing SMB ff cache buf on search rewind\n");
586 if (cfile->srch_inf.smallBuf) 586 if (cfile->srch_inf.smallBuf)
587 cifs_small_buf_release(cfile->srch_inf. 587 cifs_small_buf_release(cfile->srch_inf.
588 ntwrk_buf_start); 588 ntwrk_buf_start);
@@ -593,7 +593,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
593 } 593 }
594 rc = initiate_cifs_search(xid, file); 594 rc = initiate_cifs_search(xid, file);
595 if (rc) { 595 if (rc) {
596 cFYI(1, "error %d reinitiating a search on rewind", 596 cifs_dbg(FYI, "error %d reinitiating a search on rewind\n",
597 rc); 597 rc);
598 return rc; 598 return rc;
599 } 599 }
@@ -608,7 +608,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
608 608
609 while ((index_to_find >= cfile->srch_inf.index_of_last_entry) && 609 while ((index_to_find >= cfile->srch_inf.index_of_last_entry) &&
610 (rc == 0) && !cfile->srch_inf.endOfSearch) { 610 (rc == 0) && !cfile->srch_inf.endOfSearch) {
611 cFYI(1, "calling findnext2"); 611 cifs_dbg(FYI, "calling findnext2\n");
612 rc = server->ops->query_dir_next(xid, tcon, &cfile->fid, 612 rc = server->ops->query_dir_next(xid, tcon, &cfile->fid,
613 search_flags, 613 search_flags,
614 &cfile->srch_inf); 614 &cfile->srch_inf);
@@ -631,7 +631,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
631 first_entry_in_buffer = cfile->srch_inf.index_of_last_entry 631 first_entry_in_buffer = cfile->srch_inf.index_of_last_entry
632 - cfile->srch_inf.entries_in_buffer; 632 - cfile->srch_inf.entries_in_buffer;
633 pos_in_buf = index_to_find - first_entry_in_buffer; 633 pos_in_buf = index_to_find - first_entry_in_buffer;
634 cFYI(1, "found entry - pos_in_buf %d", pos_in_buf); 634 cifs_dbg(FYI, "found entry - pos_in_buf %d\n", pos_in_buf);
635 635
636 for (i = 0; (i < (pos_in_buf)) && (cur_ent != NULL); i++) { 636 for (i = 0; (i < (pos_in_buf)) && (cur_ent != NULL); i++) {
637 /* go entry by entry figuring out which is first */ 637 /* go entry by entry figuring out which is first */
@@ -640,19 +640,18 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
640 } 640 }
641 if ((cur_ent == NULL) && (i < pos_in_buf)) { 641 if ((cur_ent == NULL) && (i < pos_in_buf)) {
642 /* BB fixme - check if we should flag this error */ 642 /* BB fixme - check if we should flag this error */
643 cERROR(1, "reached end of buf searching for pos in buf" 643 cifs_dbg(VFS, "reached end of buf searching for pos in buf %d index to find %lld rc %d\n",
644 " %d index to find %lld rc %d", pos_in_buf, 644 pos_in_buf, index_to_find, rc);
645 index_to_find, rc);
646 } 645 }
647 rc = 0; 646 rc = 0;
648 *current_entry = cur_ent; 647 *current_entry = cur_ent;
649 } else { 648 } else {
650 cFYI(1, "index not in buffer - could not findnext into it"); 649 cifs_dbg(FYI, "index not in buffer - could not findnext into it\n");
651 return 0; 650 return 0;
652 } 651 }
653 652
654 if (pos_in_buf >= cfile->srch_inf.entries_in_buffer) { 653 if (pos_in_buf >= cfile->srch_inf.entries_in_buffer) {
655 cFYI(1, "can not return entries pos_in_buf beyond last"); 654 cifs_dbg(FYI, "can not return entries pos_in_buf beyond last\n");
656 *num_to_ret = 0; 655 *num_to_ret = 0;
657 } else 656 } else
658 *num_to_ret = cfile->srch_inf.entries_in_buffer - pos_in_buf; 657 *num_to_ret = cfile->srch_inf.entries_in_buffer - pos_in_buf;
@@ -678,8 +677,8 @@ static int cifs_filldir(char *find_entry, struct file *file, filldir_t filldir,
678 return rc; 677 return rc;
679 678
680 if (de.namelen > max_len) { 679 if (de.namelen > max_len) {
681 cERROR(1, "bad search response length %zd past smb end", 680 cifs_dbg(VFS, "bad search response length %zd past smb end\n",
682 de.namelen); 681 de.namelen);
683 return -EINVAL; 682 return -EINVAL;
684 } 683 }
685 684
@@ -768,7 +767,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
768 */ 767 */
769 if (file->private_data == NULL) { 768 if (file->private_data == NULL) {
770 rc = initiate_cifs_search(xid, file); 769 rc = initiate_cifs_search(xid, file);
771 cFYI(1, "initiate cifs search rc %d", rc); 770 cifs_dbg(FYI, "initiate cifs search rc %d\n", rc);
772 if (rc) 771 if (rc)
773 goto rddir2_exit; 772 goto rddir2_exit;
774 } 773 }
@@ -777,7 +776,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
777 case 0: 776 case 0:
778 if (filldir(direntry, ".", 1, file->f_pos, 777 if (filldir(direntry, ".", 1, file->f_pos,
779 file_inode(file)->i_ino, DT_DIR) < 0) { 778 file_inode(file)->i_ino, DT_DIR) < 0) {
780 cERROR(1, "Filldir for current dir failed"); 779 cifs_dbg(VFS, "Filldir for current dir failed\n");
781 rc = -ENOMEM; 780 rc = -ENOMEM;
782 break; 781 break;
783 } 782 }
@@ -785,7 +784,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
785 case 1: 784 case 1:
786 if (filldir(direntry, "..", 2, file->f_pos, 785 if (filldir(direntry, "..", 2, file->f_pos,
787 parent_ino(file->f_path.dentry), DT_DIR) < 0) { 786 parent_ino(file->f_path.dentry), DT_DIR) < 0) {
788 cERROR(1, "Filldir for parent dir failed"); 787 cifs_dbg(VFS, "Filldir for parent dir failed\n");
789 rc = -ENOMEM; 788 rc = -ENOMEM;
790 break; 789 break;
791 } 790 }
@@ -804,7 +803,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
804 cifsFile = file->private_data; 803 cifsFile = file->private_data;
805 if (cifsFile->srch_inf.endOfSearch) { 804 if (cifsFile->srch_inf.endOfSearch) {
806 if (cifsFile->srch_inf.emptyDir) { 805 if (cifsFile->srch_inf.emptyDir) {
807 cFYI(1, "End of search, empty dir"); 806 cifs_dbg(FYI, "End of search, empty dir\n");
808 rc = 0; 807 rc = 0;
809 break; 808 break;
810 } 809 }
@@ -817,16 +816,16 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
817 rc = find_cifs_entry(xid, tcon, file, &current_entry, 816 rc = find_cifs_entry(xid, tcon, file, &current_entry,
818 &num_to_fill); 817 &num_to_fill);
819 if (rc) { 818 if (rc) {
820 cFYI(1, "fce error %d", rc); 819 cifs_dbg(FYI, "fce error %d\n", rc);
821 goto rddir2_exit; 820 goto rddir2_exit;
822 } else if (current_entry != NULL) { 821 } else if (current_entry != NULL) {
823 cFYI(1, "entry %lld found", file->f_pos); 822 cifs_dbg(FYI, "entry %lld found\n", file->f_pos);
824 } else { 823 } else {
825 cFYI(1, "could not find entry"); 824 cifs_dbg(FYI, "could not find entry\n");
826 goto rddir2_exit; 825 goto rddir2_exit;
827 } 826 }
828 cFYI(1, "loop through %d times filling dir for net buf %p", 827 cifs_dbg(FYI, "loop through %d times filling dir for net buf %p\n",
829 num_to_fill, cifsFile->srch_inf.ntwrk_buf_start); 828 num_to_fill, cifsFile->srch_inf.ntwrk_buf_start);
830 max_len = tcon->ses->server->ops->calc_smb_size( 829 max_len = tcon->ses->server->ops->calc_smb_size(
831 cifsFile->srch_inf.ntwrk_buf_start); 830 cifsFile->srch_inf.ntwrk_buf_start);
832 end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + max_len; 831 end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + max_len;
@@ -840,8 +839,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
840 for (i = 0; (i < num_to_fill) && (rc == 0); i++) { 839 for (i = 0; (i < num_to_fill) && (rc == 0); i++) {
841 if (current_entry == NULL) { 840 if (current_entry == NULL) {
842 /* evaluate whether this case is an error */ 841 /* evaluate whether this case is an error */
843 cERROR(1, "past SMB end, num to fill %d i %d", 842 cifs_dbg(VFS, "past SMB end, num to fill %d i %d\n",
844 num_to_fill, i); 843 num_to_fill, i);
845 break; 844 break;
846 } 845 }
847 /* 846 /*
@@ -858,8 +857,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
858 file->f_pos++; 857 file->f_pos++;
859 if (file->f_pos == 858 if (file->f_pos ==
860 cifsFile->srch_inf.index_of_last_entry) { 859 cifsFile->srch_inf.index_of_last_entry) {
861 cFYI(1, "last entry in buf at pos %lld %s", 860 cifs_dbg(FYI, "last entry in buf at pos %lld %s\n",
862 file->f_pos, tmp_buf); 861 file->f_pos, tmp_buf);
863 cifs_save_resume_key(current_entry, cifsFile); 862 cifs_save_resume_key(current_entry, cifsFile);
864 break; 863 break;
865 } else 864 } else
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 6f83881ff30b..f230571a7ab3 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -283,11 +283,11 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifs_ses *ses,
283 int len; 283 int len;
284 char *data = *pbcc_area; 284 char *data = *pbcc_area;
285 285
286 cFYI(1, "bleft %d", bleft); 286 cifs_dbg(FYI, "bleft %d\n", bleft);
287 287
288 kfree(ses->serverOS); 288 kfree(ses->serverOS);
289 ses->serverOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp); 289 ses->serverOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp);
290 cFYI(1, "serverOS=%s", ses->serverOS); 290 cifs_dbg(FYI, "serverOS=%s\n", ses->serverOS);
291 len = (UniStrnlen((wchar_t *) data, bleft / 2) * 2) + 2; 291 len = (UniStrnlen((wchar_t *) data, bleft / 2) * 2) + 2;
292 data += len; 292 data += len;
293 bleft -= len; 293 bleft -= len;
@@ -296,7 +296,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifs_ses *ses,
296 296
297 kfree(ses->serverNOS); 297 kfree(ses->serverNOS);
298 ses->serverNOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp); 298 ses->serverNOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp);
299 cFYI(1, "serverNOS=%s", ses->serverNOS); 299 cifs_dbg(FYI, "serverNOS=%s\n", ses->serverNOS);
300 len = (UniStrnlen((wchar_t *) data, bleft / 2) * 2) + 2; 300 len = (UniStrnlen((wchar_t *) data, bleft / 2) * 2) + 2;
301 data += len; 301 data += len;
302 bleft -= len; 302 bleft -= len;
@@ -305,7 +305,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifs_ses *ses,
305 305
306 kfree(ses->serverDomain); 306 kfree(ses->serverDomain);
307 ses->serverDomain = cifs_strndup_from_utf16(data, bleft, true, nls_cp); 307 ses->serverDomain = cifs_strndup_from_utf16(data, bleft, true, nls_cp);
308 cFYI(1, "serverDomain=%s", ses->serverDomain); 308 cifs_dbg(FYI, "serverDomain=%s\n", ses->serverDomain);
309 309
310 return; 310 return;
311} 311}
@@ -318,7 +318,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
318 int len; 318 int len;
319 char *bcc_ptr = *pbcc_area; 319 char *bcc_ptr = *pbcc_area;
320 320
321 cFYI(1, "decode sessetup ascii. bleft %d", bleft); 321 cifs_dbg(FYI, "decode sessetup ascii. bleft %d\n", bleft);
322 322
323 len = strnlen(bcc_ptr, bleft); 323 len = strnlen(bcc_ptr, bleft);
324 if (len >= bleft) 324 if (len >= bleft)
@@ -330,7 +330,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
330 if (ses->serverOS) 330 if (ses->serverOS)
331 strncpy(ses->serverOS, bcc_ptr, len); 331 strncpy(ses->serverOS, bcc_ptr, len);
332 if (strncmp(ses->serverOS, "OS/2", 4) == 0) { 332 if (strncmp(ses->serverOS, "OS/2", 4) == 0) {
333 cFYI(1, "OS/2 server"); 333 cifs_dbg(FYI, "OS/2 server\n");
334 ses->flags |= CIFS_SES_OS2; 334 ses->flags |= CIFS_SES_OS2;
335 } 335 }
336 336
@@ -359,7 +359,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
359 /* BB For newer servers which do not support Unicode, 359 /* BB For newer servers which do not support Unicode,
360 but thus do return domain here we could add parsing 360 but thus do return domain here we could add parsing
361 for it later, but it is not very important */ 361 for it later, but it is not very important */
362 cFYI(1, "ascii: bytes left %d", bleft); 362 cifs_dbg(FYI, "ascii: bytes left %d\n", bleft);
363 363
364 return rc; 364 return rc;
365} 365}
@@ -373,16 +373,18 @@ int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len,
373 CHALLENGE_MESSAGE *pblob = (CHALLENGE_MESSAGE *)bcc_ptr; 373 CHALLENGE_MESSAGE *pblob = (CHALLENGE_MESSAGE *)bcc_ptr;
374 374
375 if (blob_len < sizeof(CHALLENGE_MESSAGE)) { 375 if (blob_len < sizeof(CHALLENGE_MESSAGE)) {
376 cERROR(1, "challenge blob len %d too small", blob_len); 376 cifs_dbg(VFS, "challenge blob len %d too small\n", blob_len);
377 return -EINVAL; 377 return -EINVAL;
378 } 378 }
379 379
380 if (memcmp(pblob->Signature, "NTLMSSP", 8)) { 380 if (memcmp(pblob->Signature, "NTLMSSP", 8)) {
381 cERROR(1, "blob signature incorrect %s", pblob->Signature); 381 cifs_dbg(VFS, "blob signature incorrect %s\n",
382 pblob->Signature);
382 return -EINVAL; 383 return -EINVAL;
383 } 384 }
384 if (pblob->MessageType != NtLmChallenge) { 385 if (pblob->MessageType != NtLmChallenge) {
385 cERROR(1, "Incorrect message type %d", pblob->MessageType); 386 cifs_dbg(VFS, "Incorrect message type %d\n",
387 pblob->MessageType);
386 return -EINVAL; 388 return -EINVAL;
387 } 389 }
388 390
@@ -395,14 +397,15 @@ int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len,
395 tioffset = le32_to_cpu(pblob->TargetInfoArray.BufferOffset); 397 tioffset = le32_to_cpu(pblob->TargetInfoArray.BufferOffset);
396 tilen = le16_to_cpu(pblob->TargetInfoArray.Length); 398 tilen = le16_to_cpu(pblob->TargetInfoArray.Length);
397 if (tioffset > blob_len || tioffset + tilen > blob_len) { 399 if (tioffset > blob_len || tioffset + tilen > blob_len) {
398 cERROR(1, "tioffset + tilen too high %u + %u", tioffset, tilen); 400 cifs_dbg(VFS, "tioffset + tilen too high %u + %u",
401 tioffset, tilen);
399 return -EINVAL; 402 return -EINVAL;
400 } 403 }
401 if (tilen) { 404 if (tilen) {
402 ses->auth_key.response = kmemdup(bcc_ptr + tioffset, tilen, 405 ses->auth_key.response = kmemdup(bcc_ptr + tioffset, tilen,
403 GFP_KERNEL); 406 GFP_KERNEL);
404 if (!ses->auth_key.response) { 407 if (!ses->auth_key.response) {
405 cERROR(1, "Challenge target info allocation failure"); 408 cifs_dbg(VFS, "Challenge target info alloc failure");
406 return -ENOMEM; 409 return -ENOMEM;
407 } 410 }
408 ses->auth_key.len = tilen; 411 ses->auth_key.len = tilen;
@@ -486,7 +489,7 @@ int build_ntlmssp_auth_blob(unsigned char *pbuffer,
486 sec_blob->NtChallengeResponse.BufferOffset = cpu_to_le32(tmp - pbuffer); 489 sec_blob->NtChallengeResponse.BufferOffset = cpu_to_le32(tmp - pbuffer);
487 rc = setup_ntlmv2_rsp(ses, nls_cp); 490 rc = setup_ntlmv2_rsp(ses, nls_cp);
488 if (rc) { 491 if (rc) {
489 cERROR(1, "Error %d during NTLMSSP authentication", rc); 492 cifs_dbg(VFS, "Error %d during NTLMSSP authentication\n", rc);
490 goto setup_ntlmv2_ret; 493 goto setup_ntlmv2_ret;
491 } 494 }
492 memcpy(tmp, ses->auth_key.response + CIFS_SESS_KEY_SIZE, 495 memcpy(tmp, ses->auth_key.response + CIFS_SESS_KEY_SIZE,
@@ -580,7 +583,7 @@ CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
580 return -EINVAL; 583 return -EINVAL;
581 584
582 type = ses->server->secType; 585 type = ses->server->secType;
583 cFYI(1, "sess setup type %d", type); 586 cifs_dbg(FYI, "sess setup type %d\n", type);
584 if (type == RawNTLMSSP) { 587 if (type == RawNTLMSSP) {
585 /* if memory allocation is successful, caller of this function 588 /* if memory allocation is successful, caller of this function
586 * frees it. 589 * frees it.
@@ -674,7 +677,7 @@ ssetup_ntlmssp_authenticate:
674 changed to do higher than lanman dialect and 677 changed to do higher than lanman dialect and
675 we reconnected would we ever calc signing_key? */ 678 we reconnected would we ever calc signing_key? */
676 679
677 cFYI(1, "Negotiating LANMAN setting up strings"); 680 cifs_dbg(FYI, "Negotiating LANMAN setting up strings\n");
678 /* Unicode not allowed for LANMAN dialects */ 681 /* Unicode not allowed for LANMAN dialects */
679 ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); 682 ascii_ssetup_strings(&bcc_ptr, ses, nls_cp);
680#endif 683#endif
@@ -688,7 +691,8 @@ ssetup_ntlmssp_authenticate:
688 /* calculate ntlm response and session key */ 691 /* calculate ntlm response and session key */
689 rc = setup_ntlm_response(ses, nls_cp); 692 rc = setup_ntlm_response(ses, nls_cp);
690 if (rc) { 693 if (rc) {
691 cERROR(1, "Error %d during NTLM authentication", rc); 694 cifs_dbg(VFS, "Error %d during NTLM authentication\n",
695 rc);
692 goto ssetup_exit; 696 goto ssetup_exit;
693 } 697 }
694 698
@@ -718,7 +722,8 @@ ssetup_ntlmssp_authenticate:
718 /* calculate nlmv2 response and session key */ 722 /* calculate nlmv2 response and session key */
719 rc = setup_ntlmv2_rsp(ses, nls_cp); 723 rc = setup_ntlmv2_rsp(ses, nls_cp);
720 if (rc) { 724 if (rc) {
721 cERROR(1, "Error %d during NTLMv2 authentication", rc); 725 cifs_dbg(VFS, "Error %d during NTLMv2 authentication\n",
726 rc);
722 goto ssetup_exit; 727 goto ssetup_exit;
723 } 728 }
724 memcpy(bcc_ptr, ses->auth_key.response + CIFS_SESS_KEY_SIZE, 729 memcpy(bcc_ptr, ses->auth_key.response + CIFS_SESS_KEY_SIZE,
@@ -754,8 +759,8 @@ ssetup_ntlmssp_authenticate:
754 /* check version field to make sure that cifs.upcall is 759 /* check version field to make sure that cifs.upcall is
755 sending us a response in an expected form */ 760 sending us a response in an expected form */
756 if (msg->version != CIFS_SPNEGO_UPCALL_VERSION) { 761 if (msg->version != CIFS_SPNEGO_UPCALL_VERSION) {
757 cERROR(1, "incorrect version of cifs.upcall (expected" 762 cifs_dbg(VFS, "incorrect version of cifs.upcall "
758 " %d but got %d)", 763 "expected %d but got %d)",
759 CIFS_SPNEGO_UPCALL_VERSION, msg->version); 764 CIFS_SPNEGO_UPCALL_VERSION, msg->version);
760 rc = -EKEYREJECTED; 765 rc = -EKEYREJECTED;
761 goto ssetup_exit; 766 goto ssetup_exit;
@@ -764,7 +769,7 @@ ssetup_ntlmssp_authenticate:
764 ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, 769 ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len,
765 GFP_KERNEL); 770 GFP_KERNEL);
766 if (!ses->auth_key.response) { 771 if (!ses->auth_key.response) {
767 cERROR(1, "Kerberos can't allocate (%u bytes) memory", 772 cifs_dbg(VFS, "Kerberos can't allocate (%u bytes) memory",
768 msg->sesskey_len); 773 msg->sesskey_len);
769 rc = -ENOMEM; 774 rc = -ENOMEM;
770 goto ssetup_exit; 775 goto ssetup_exit;
@@ -790,18 +795,18 @@ ssetup_ntlmssp_authenticate:
790 /* BB: is this right? */ 795 /* BB: is this right? */
791 ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); 796 ascii_ssetup_strings(&bcc_ptr, ses, nls_cp);
792#else /* ! CONFIG_CIFS_UPCALL */ 797#else /* ! CONFIG_CIFS_UPCALL */
793 cERROR(1, "Kerberos negotiated but upcall support disabled!"); 798 cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n");
794 rc = -ENOSYS; 799 rc = -ENOSYS;
795 goto ssetup_exit; 800 goto ssetup_exit;
796#endif /* CONFIG_CIFS_UPCALL */ 801#endif /* CONFIG_CIFS_UPCALL */
797 } else if (type == RawNTLMSSP) { 802 } else if (type == RawNTLMSSP) {
798 if ((pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) == 0) { 803 if ((pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) == 0) {
799 cERROR(1, "NTLMSSP requires Unicode support"); 804 cifs_dbg(VFS, "NTLMSSP requires Unicode support\n");
800 rc = -ENOSYS; 805 rc = -ENOSYS;
801 goto ssetup_exit; 806 goto ssetup_exit;
802 } 807 }
803 808
804 cFYI(1, "ntlmssp session setup phase %d", phase); 809 cifs_dbg(FYI, "ntlmssp session setup phase %d\n", phase);
805 pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; 810 pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
806 capabilities |= CAP_EXTENDED_SECURITY; 811 capabilities |= CAP_EXTENDED_SECURITY;
807 pSMB->req.Capabilities |= cpu_to_le32(capabilities); 812 pSMB->req.Capabilities |= cpu_to_le32(capabilities);
@@ -824,7 +829,6 @@ ssetup_ntlmssp_authenticate:
824 5*sizeof(struct _AUTHENTICATE_MESSAGE), 829 5*sizeof(struct _AUTHENTICATE_MESSAGE),
825 GFP_KERNEL); 830 GFP_KERNEL);
826 if (!ntlmsspblob) { 831 if (!ntlmsspblob) {
827 cERROR(1, "Can't allocate NTLMSSP blob");
828 rc = -ENOMEM; 832 rc = -ENOMEM;
829 goto ssetup_exit; 833 goto ssetup_exit;
830 } 834 }
@@ -844,7 +848,7 @@ ssetup_ntlmssp_authenticate:
844 smb_buf->Uid = ses->Suid; 848 smb_buf->Uid = ses->Suid;
845 break; 849 break;
846 default: 850 default:
847 cERROR(1, "invalid phase %d", phase); 851 cifs_dbg(VFS, "invalid phase %d\n", phase);
848 rc = -ENOSYS; 852 rc = -ENOSYS;
849 goto ssetup_exit; 853 goto ssetup_exit;
850 } 854 }
@@ -855,7 +859,7 @@ ssetup_ntlmssp_authenticate:
855 } 859 }
856 unicode_oslm_strings(&bcc_ptr, nls_cp); 860 unicode_oslm_strings(&bcc_ptr, nls_cp);
857 } else { 861 } else {
858 cERROR(1, "secType %d not supported!", type); 862 cifs_dbg(VFS, "secType %d not supported!\n", type);
859 rc = -ENOSYS; 863 rc = -ENOSYS;
860 goto ssetup_exit; 864 goto ssetup_exit;
861 } 865 }
@@ -880,7 +884,7 @@ ssetup_ntlmssp_authenticate:
880 (smb_buf->Status.CifsError == 884 (smb_buf->Status.CifsError ==
881 cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED))) { 885 cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED))) {
882 if (phase != NtLmNegotiate) { 886 if (phase != NtLmNegotiate) {
883 cERROR(1, "Unexpected more processing error"); 887 cifs_dbg(VFS, "Unexpected more processing error\n");
884 goto ssetup_exit; 888 goto ssetup_exit;
885 } 889 }
886 /* NTLMSSP Negotiate sent now processing challenge (response) */ 890 /* NTLMSSP Negotiate sent now processing challenge (response) */
@@ -892,14 +896,14 @@ ssetup_ntlmssp_authenticate:
892 896
893 if ((smb_buf->WordCount != 3) && (smb_buf->WordCount != 4)) { 897 if ((smb_buf->WordCount != 3) && (smb_buf->WordCount != 4)) {
894 rc = -EIO; 898 rc = -EIO;
895 cERROR(1, "bad word count %d", smb_buf->WordCount); 899 cifs_dbg(VFS, "bad word count %d\n", smb_buf->WordCount);
896 goto ssetup_exit; 900 goto ssetup_exit;
897 } 901 }
898 action = le16_to_cpu(pSMB->resp.Action); 902 action = le16_to_cpu(pSMB->resp.Action);
899 if (action & GUEST_LOGIN) 903 if (action & GUEST_LOGIN)
900 cFYI(1, "Guest login"); /* BB mark SesInfo struct? */ 904 cifs_dbg(FYI, "Guest login\n"); /* BB mark SesInfo struct? */
901 ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */ 905 ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */
902 cFYI(1, "UID = %llu ", ses->Suid); 906 cifs_dbg(FYI, "UID = %llu\n", ses->Suid);
903 /* response can have either 3 or 4 word count - Samba sends 3 */ 907 /* response can have either 3 or 4 word count - Samba sends 3 */
904 /* and lanman response is 3 */ 908 /* and lanman response is 3 */
905 bytes_remaining = get_bcc(smb_buf); 909 bytes_remaining = get_bcc(smb_buf);
@@ -908,7 +912,8 @@ ssetup_ntlmssp_authenticate:
908 if (smb_buf->WordCount == 4) { 912 if (smb_buf->WordCount == 4) {
909 blob_len = le16_to_cpu(pSMB->resp.SecurityBlobLength); 913 blob_len = le16_to_cpu(pSMB->resp.SecurityBlobLength);
910 if (blob_len > bytes_remaining) { 914 if (blob_len > bytes_remaining) {
911 cERROR(1, "bad security blob length %d", blob_len); 915 cifs_dbg(VFS, "bad security blob length %d\n",
916 blob_len);
912 rc = -EINVAL; 917 rc = -EINVAL;
913 goto ssetup_exit; 918 goto ssetup_exit;
914 } 919 }
@@ -946,7 +951,7 @@ ssetup_exit:
946 kfree(ntlmsspblob); 951 kfree(ntlmsspblob);
947 ntlmsspblob = NULL; 952 ntlmsspblob = NULL;
948 if (resp_buf_type == CIFS_SMALL_BUFFER) { 953 if (resp_buf_type == CIFS_SMALL_BUFFER) {
949 cFYI(1, "ssetup freeing small buf %p", iov[0].iov_base); 954 cifs_dbg(FYI, "ssetup freeing small buf %p\n", iov[0].iov_base);
950 cifs_small_buf_release(iov[0].iov_base); 955 cifs_small_buf_release(iov[0].iov_base);
951 } else if (resp_buf_type == CIFS_LARGE_BUFFER) 956 } else if (resp_buf_type == CIFS_LARGE_BUFFER)
952 cifs_buf_release(iov[0].iov_base); 957 cifs_buf_release(iov[0].iov_base);
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 47bc5a87f94e..23bcd11c8103 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -63,8 +63,8 @@ send_nt_cancel(struct TCP_Server_Info *server, void *buf,
63 rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); 63 rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
64 mutex_unlock(&server->srv_mutex); 64 mutex_unlock(&server->srv_mutex);
65 65
66 cFYI(1, "issued NT_CANCEL for mid %u, rc = %d", 66 cifs_dbg(FYI, "issued NT_CANCEL for mid %u, rc = %d\n",
67 in_buf->Mid, rc); 67 in_buf->Mid, rc);
68 68
69 return rc; 69 return rc;
70} 70}
@@ -249,7 +249,7 @@ check2ndT2(char *buf)
249 /* check for plausible wct, bcc and t2 data and parm sizes */ 249 /* check for plausible wct, bcc and t2 data and parm sizes */
250 /* check for parm and data offset going beyond end of smb */ 250 /* check for parm and data offset going beyond end of smb */
251 if (pSMB->WordCount != 10) { /* coalesce_t2 depends on this */ 251 if (pSMB->WordCount != 10) { /* coalesce_t2 depends on this */
252 cFYI(1, "invalid transact2 word count"); 252 cifs_dbg(FYI, "invalid transact2 word count\n");
253 return -EINVAL; 253 return -EINVAL;
254 } 254 }
255 255
@@ -261,18 +261,18 @@ check2ndT2(char *buf)
261 if (total_data_size == data_in_this_rsp) 261 if (total_data_size == data_in_this_rsp)
262 return 0; 262 return 0;
263 else if (total_data_size < data_in_this_rsp) { 263 else if (total_data_size < data_in_this_rsp) {
264 cFYI(1, "total data %d smaller than data in frame %d", 264 cifs_dbg(FYI, "total data %d smaller than data in frame %d\n",
265 total_data_size, data_in_this_rsp); 265 total_data_size, data_in_this_rsp);
266 return -EINVAL; 266 return -EINVAL;
267 } 267 }
268 268
269 remaining = total_data_size - data_in_this_rsp; 269 remaining = total_data_size - data_in_this_rsp;
270 270
271 cFYI(1, "missing %d bytes from transact2, check next response", 271 cifs_dbg(FYI, "missing %d bytes from transact2, check next response\n",
272 remaining); 272 remaining);
273 if (total_data_size > CIFSMaxBufSize) { 273 if (total_data_size > CIFSMaxBufSize) {
274 cERROR(1, "TotalDataSize %d is over maximum buffer %d", 274 cifs_dbg(VFS, "TotalDataSize %d is over maximum buffer %d\n",
275 total_data_size, CIFSMaxBufSize); 275 total_data_size, CIFSMaxBufSize);
276 return -EINVAL; 276 return -EINVAL;
277 } 277 }
278 return remaining; 278 return remaining;
@@ -293,28 +293,28 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
293 tgt_total_cnt = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount); 293 tgt_total_cnt = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
294 294
295 if (tgt_total_cnt != src_total_cnt) 295 if (tgt_total_cnt != src_total_cnt)
296 cFYI(1, "total data count of primary and secondary t2 differ " 296 cifs_dbg(FYI, "total data count of primary and secondary t2 differ source=%hu target=%hu\n",
297 "source=%hu target=%hu", src_total_cnt, tgt_total_cnt); 297 src_total_cnt, tgt_total_cnt);
298 298
299 total_in_tgt = get_unaligned_le16(&pSMBt->t2_rsp.DataCount); 299 total_in_tgt = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);
300 300
301 remaining = tgt_total_cnt - total_in_tgt; 301 remaining = tgt_total_cnt - total_in_tgt;
302 302
303 if (remaining < 0) { 303 if (remaining < 0) {
304 cFYI(1, "Server sent too much data. tgt_total_cnt=%hu " 304 cifs_dbg(FYI, "Server sent too much data. tgt_total_cnt=%hu total_in_tgt=%hu\n",
305 "total_in_tgt=%hu", tgt_total_cnt, total_in_tgt); 305 tgt_total_cnt, total_in_tgt);
306 return -EPROTO; 306 return -EPROTO;
307 } 307 }
308 308
309 if (remaining == 0) { 309 if (remaining == 0) {
310 /* nothing to do, ignore */ 310 /* nothing to do, ignore */
311 cFYI(1, "no more data remains"); 311 cifs_dbg(FYI, "no more data remains\n");
312 return 0; 312 return 0;
313 } 313 }
314 314
315 total_in_src = get_unaligned_le16(&pSMBs->t2_rsp.DataCount); 315 total_in_src = get_unaligned_le16(&pSMBs->t2_rsp.DataCount);
316 if (remaining < total_in_src) 316 if (remaining < total_in_src)
317 cFYI(1, "transact2 2nd response contains too much data"); 317 cifs_dbg(FYI, "transact2 2nd response contains too much data\n");
318 318
319 /* find end of first SMB data area */ 319 /* find end of first SMB data area */
320 data_area_of_tgt = (char *)&pSMBt->hdr.Protocol + 320 data_area_of_tgt = (char *)&pSMBt->hdr.Protocol +
@@ -329,7 +329,8 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
329 total_in_tgt += total_in_src; 329 total_in_tgt += total_in_src;
330 /* is the result too big for the field? */ 330 /* is the result too big for the field? */
331 if (total_in_tgt > USHRT_MAX) { 331 if (total_in_tgt > USHRT_MAX) {
332 cFYI(1, "coalesced DataCount too large (%u)", total_in_tgt); 332 cifs_dbg(FYI, "coalesced DataCount too large (%u)\n",
333 total_in_tgt);
333 return -EPROTO; 334 return -EPROTO;
334 } 335 }
335 put_unaligned_le16(total_in_tgt, &pSMBt->t2_rsp.DataCount); 336 put_unaligned_le16(total_in_tgt, &pSMBt->t2_rsp.DataCount);
@@ -339,7 +340,7 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
339 byte_count += total_in_src; 340 byte_count += total_in_src;
340 /* is the result too big for the field? */ 341 /* is the result too big for the field? */
341 if (byte_count > USHRT_MAX) { 342 if (byte_count > USHRT_MAX) {
342 cFYI(1, "coalesced BCC too large (%u)", byte_count); 343 cifs_dbg(FYI, "coalesced BCC too large (%u)\n", byte_count);
343 return -EPROTO; 344 return -EPROTO;
344 } 345 }
345 put_bcc(byte_count, target_hdr); 346 put_bcc(byte_count, target_hdr);
@@ -348,7 +349,8 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
348 byte_count += total_in_src; 349 byte_count += total_in_src;
349 /* don't allow buffer to overflow */ 350 /* don't allow buffer to overflow */
350 if (byte_count > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { 351 if (byte_count > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
351 cFYI(1, "coalesced BCC exceeds buffer size (%u)", byte_count); 352 cifs_dbg(FYI, "coalesced BCC exceeds buffer size (%u)\n",
353 byte_count);
352 return -ENOBUFS; 354 return -ENOBUFS;
353 } 355 }
354 target_hdr->smb_buf_length = cpu_to_be32(byte_count); 356 target_hdr->smb_buf_length = cpu_to_be32(byte_count);
@@ -358,12 +360,12 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
358 360
359 if (remaining != total_in_src) { 361 if (remaining != total_in_src) {
360 /* more responses to go */ 362 /* more responses to go */
361 cFYI(1, "waiting for more secondary responses"); 363 cifs_dbg(FYI, "waiting for more secondary responses\n");
362 return 1; 364 return 1;
363 } 365 }
364 366
365 /* we are done */ 367 /* we are done */
366 cFYI(1, "found the last secondary response"); 368 cifs_dbg(FYI, "found the last secondary response\n");
367 return 0; 369 return 0;
368} 370}
369 371
@@ -388,7 +390,7 @@ cifs_check_trans2(struct mid_q_entry *mid, struct TCP_Server_Info *server,
388 } 390 }
389 if (!server->large_buf) { 391 if (!server->large_buf) {
390 /*FIXME: switch to already allocated largebuf?*/ 392 /*FIXME: switch to already allocated largebuf?*/
391 cERROR(1, "1st trans2 resp needs bigbuf"); 393 cifs_dbg(VFS, "1st trans2 resp needs bigbuf\n");
392 } else { 394 } else {
393 /* Have first buffer */ 395 /* Have first buffer */
394 mid->resp_buf = buf; 396 mid->resp_buf = buf;
@@ -776,8 +778,7 @@ smb_set_file_info(struct inode *inode, const char *full_path,
776 goto out; 778 goto out;
777 } 779 }
778 780
779 cFYI(1, "calling SetFileInfo since SetPathInfo for times not supported " 781 cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for times not supported by this server\n");
780 "by this server");
781 rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, 782 rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
782 SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, 783 SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR,
783 &netfid, &oplock, NULL, cifs_sb->local_nls, 784 &netfid, &oplock, NULL, cifs_sb->local_nls,
diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c
index 71e6aed4b382..5da1b55a2258 100644
--- a/fs/cifs/smb2file.c
+++ b/fs/cifs/smb2file.c
@@ -43,13 +43,13 @@ smb2_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock)
43 if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE) { 43 if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE) {
44 cinode->clientCanCacheAll = true; 44 cinode->clientCanCacheAll = true;
45 cinode->clientCanCacheRead = true; 45 cinode->clientCanCacheRead = true;
46 cFYI(1, "Exclusive Oplock granted on inode %p", 46 cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n",
47 &cinode->vfs_inode); 47 &cinode->vfs_inode);
48 } else if (oplock == SMB2_OPLOCK_LEVEL_II) { 48 } else if (oplock == SMB2_OPLOCK_LEVEL_II) {
49 cinode->clientCanCacheAll = false; 49 cinode->clientCanCacheAll = false;
50 cinode->clientCanCacheRead = true; 50 cinode->clientCanCacheRead = true;
51 cFYI(1, "Level II Oplock granted on inode %p", 51 cifs_dbg(FYI, "Level II Oplock granted on inode %p\n",
52 &cinode->vfs_inode); 52 &cinode->vfs_inode);
53 } else { 53 } else {
54 cinode->clientCanCacheAll = false; 54 cinode->clientCanCacheAll = false;
55 cinode->clientCanCacheRead = false; 55 cinode->clientCanCacheRead = false;
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
index 706482452df4..fff6dfba6204 100644
--- a/fs/cifs/smb2inode.c
+++ b/fs/cifs/smb2inode.c
@@ -92,7 +92,7 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon,
92 (FILE_BASIC_INFO *)data); 92 (FILE_BASIC_INFO *)data);
93 break; 93 break;
94 default: 94 default:
95 cERROR(1, "Invalid command"); 95 cifs_dbg(VFS, "Invalid command\n");
96 break; 96 break;
97 } 97 }
98 98
diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
index 494c912c76fe..7c2f45c06fc2 100644
--- a/fs/cifs/smb2maperror.c
+++ b/fs/cifs/smb2maperror.c
@@ -2472,7 +2472,7 @@ map_smb2_to_linux_error(char *buf, bool log_err)
2472 2472
2473 /* on error mapping not found - return EIO */ 2473 /* on error mapping not found - return EIO */
2474 2474
2475 cFYI(1, "Mapping SMB2 status code %d to POSIX err %d", 2475 cifs_dbg(FYI, "Mapping SMB2 status code %d to POSIX err %d\n",
2476 smb2err, rc); 2476 smb2err, rc);
2477 2477
2478 return rc; 2478 return rc;
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
index 7b1c5e3287fb..10383d8c015b 100644
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -45,17 +45,17 @@ check_smb2_hdr(struct smb2_hdr *hdr, __u64 mid)
45 if (hdr->Command == SMB2_OPLOCK_BREAK) 45 if (hdr->Command == SMB2_OPLOCK_BREAK)
46 return 0; 46 return 0;
47 else 47 else
48 cERROR(1, "Received Request not response"); 48 cifs_dbg(VFS, "Received Request not response\n");
49 } 49 }
50 } else { /* bad signature or mid */ 50 } else { /* bad signature or mid */
51 if (*(__le32 *)hdr->ProtocolId != SMB2_PROTO_NUMBER) 51 if (*(__le32 *)hdr->ProtocolId != SMB2_PROTO_NUMBER)
52 cERROR(1, "Bad protocol string signature header %x", 52 cifs_dbg(VFS, "Bad protocol string signature header %x\n",
53 *(unsigned int *) hdr->ProtocolId); 53 *(unsigned int *) hdr->ProtocolId);
54 if (mid != hdr->MessageId) 54 if (mid != hdr->MessageId)
55 cERROR(1, "Mids do not match: %llu and %llu", mid, 55 cifs_dbg(VFS, "Mids do not match: %llu and %llu\n",
56 hdr->MessageId); 56 mid, hdr->MessageId);
57 } 57 }
58 cERROR(1, "Bad SMB detected. The Mid=%llu", hdr->MessageId); 58 cifs_dbg(VFS, "Bad SMB detected. The Mid=%llu\n", hdr->MessageId);
59 return 1; 59 return 1;
60} 60}
61 61
@@ -101,7 +101,8 @@ smb2_check_message(char *buf, unsigned int length)
101 int command; 101 int command;
102 102
103 /* BB disable following printk later */ 103 /* BB disable following printk later */
104 cFYI(1, "%s length: 0x%x, smb_buf_length: 0x%x", __func__, length, len); 104 cifs_dbg(FYI, "%s length: 0x%x, smb_buf_length: 0x%x\n",
105 __func__, length, len);
105 106
106 /* 107 /*
107 * Add function to do table lookup of StructureSize by command 108 * Add function to do table lookup of StructureSize by command
@@ -117,12 +118,13 @@ smb2_check_message(char *buf, unsigned int length)
117 */ 118 */
118 return 0; 119 return 0;
119 } else { 120 } else {
120 cERROR(1, "Length less than SMB header size"); 121 cifs_dbg(VFS, "Length less than SMB header size\n");
121 } 122 }
122 return 1; 123 return 1;
123 } 124 }
124 if (len > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE - 4) { 125 if (len > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE - 4) {
125 cERROR(1, "SMB length greater than maximum, mid=%llu", mid); 126 cifs_dbg(VFS, "SMB length greater than maximum, mid=%llu\n",
127 mid);
126 return 1; 128 return 1;
127 } 129 }
128 130
@@ -130,14 +132,14 @@ smb2_check_message(char *buf, unsigned int length)
130 return 1; 132 return 1;
131 133
132 if (hdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) { 134 if (hdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) {
133 cERROR(1, "Illegal structure size %u", 135 cifs_dbg(VFS, "Illegal structure size %u\n",
134 le16_to_cpu(hdr->StructureSize)); 136 le16_to_cpu(hdr->StructureSize));
135 return 1; 137 return 1;
136 } 138 }
137 139
138 command = le16_to_cpu(hdr->Command); 140 command = le16_to_cpu(hdr->Command);
139 if (command >= NUMBER_OF_SMB2_COMMANDS) { 141 if (command >= NUMBER_OF_SMB2_COMMANDS) {
140 cERROR(1, "Illegal SMB2 command %d", command); 142 cifs_dbg(VFS, "Illegal SMB2 command %d\n", command);
141 return 1; 143 return 1;
142 } 144 }
143 145
@@ -145,30 +147,30 @@ smb2_check_message(char *buf, unsigned int length)
145 if (command != SMB2_OPLOCK_BREAK_HE && (hdr->Status == 0 || 147 if (command != SMB2_OPLOCK_BREAK_HE && (hdr->Status == 0 ||
146 pdu->StructureSize2 != SMB2_ERROR_STRUCTURE_SIZE2)) { 148 pdu->StructureSize2 != SMB2_ERROR_STRUCTURE_SIZE2)) {
147 /* error packets have 9 byte structure size */ 149 /* error packets have 9 byte structure size */
148 cERROR(1, "Illegal response size %u for command %d", 150 cifs_dbg(VFS, "Illegal response size %u for command %d\n",
149 le16_to_cpu(pdu->StructureSize2), command); 151 le16_to_cpu(pdu->StructureSize2), command);
150 return 1; 152 return 1;
151 } else if (command == SMB2_OPLOCK_BREAK_HE && (hdr->Status == 0) 153 } else if (command == SMB2_OPLOCK_BREAK_HE && (hdr->Status == 0)
152 && (le16_to_cpu(pdu->StructureSize2) != 44) 154 && (le16_to_cpu(pdu->StructureSize2) != 44)
153 && (le16_to_cpu(pdu->StructureSize2) != 36)) { 155 && (le16_to_cpu(pdu->StructureSize2) != 36)) {
154 /* special case for SMB2.1 lease break message */ 156 /* special case for SMB2.1 lease break message */
155 cERROR(1, "Illegal response size %d for oplock break", 157 cifs_dbg(VFS, "Illegal response size %d for oplock break\n",
156 le16_to_cpu(pdu->StructureSize2)); 158 le16_to_cpu(pdu->StructureSize2));
157 return 1; 159 return 1;
158 } 160 }
159 } 161 }
160 162
161 if (4 + len != length) { 163 if (4 + len != length) {
162 cERROR(1, "Total length %u RFC1002 length %u mismatch mid %llu", 164 cifs_dbg(VFS, "Total length %u RFC1002 length %u mismatch mid %llu\n",
163 length, 4 + len, mid); 165 length, 4 + len, mid);
164 return 1; 166 return 1;
165 } 167 }
166 168
167 clc_len = smb2_calc_size(hdr); 169 clc_len = smb2_calc_size(hdr);
168 170
169 if (4 + len != clc_len) { 171 if (4 + len != clc_len) {
170 cFYI(1, "Calculated size %u length %u mismatch mid %llu", 172 cifs_dbg(FYI, "Calculated size %u length %u mismatch mid %llu\n",
171 clc_len, 4 + len, mid); 173 clc_len, 4 + len, mid);
172 /* Windows 7 server returns 24 bytes more */ 174 /* Windows 7 server returns 24 bytes more */
173 if (clc_len + 20 == len && command == SMB2_OPLOCK_BREAK_HE) 175 if (clc_len + 20 == len && command == SMB2_OPLOCK_BREAK_HE)
174 return 0; 176 return 0;
@@ -267,7 +269,7 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr)
267 case SMB2_CHANGE_NOTIFY: 269 case SMB2_CHANGE_NOTIFY:
268 default: 270 default:
269 /* BB FIXME for unimplemented cases above */ 271 /* BB FIXME for unimplemented cases above */
270 cERROR(1, "no length check for command"); 272 cifs_dbg(VFS, "no length check for command\n");
271 break; 273 break;
272 } 274 }
273 275
@@ -276,20 +278,20 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr)
276 * we have little choice but to ignore the data area in this case. 278 * we have little choice but to ignore the data area in this case.
277 */ 279 */
278 if (*off > 4096) { 280 if (*off > 4096) {
279 cERROR(1, "offset %d too large, data area ignored", *off); 281 cifs_dbg(VFS, "offset %d too large, data area ignored\n", *off);
280 *len = 0; 282 *len = 0;
281 *off = 0; 283 *off = 0;
282 } else if (*off < 0) { 284 } else if (*off < 0) {
283 cERROR(1, "negative offset %d to data invalid ignore data area", 285 cifs_dbg(VFS, "negative offset %d to data invalid ignore data area\n",
284 *off); 286 *off);
285 *off = 0; 287 *off = 0;
286 *len = 0; 288 *len = 0;
287 } else if (*len < 0) { 289 } else if (*len < 0) {
288 cERROR(1, "negative data length %d invalid, data area ignored", 290 cifs_dbg(VFS, "negative data length %d invalid, data area ignored\n",
289 *len); 291 *len);
290 *len = 0; 292 *len = 0;
291 } else if (*len > 128 * 1024) { 293 } else if (*len > 128 * 1024) {
292 cERROR(1, "data area larger than 128K: %d", *len); 294 cifs_dbg(VFS, "data area larger than 128K: %d\n", *len);
293 *len = 0; 295 *len = 0;
294 } 296 }
295 297
@@ -324,7 +326,7 @@ smb2_calc_size(void *buf)
324 goto calc_size_exit; 326 goto calc_size_exit;
325 327
326 smb2_get_data_area_len(&offset, &data_length, hdr); 328 smb2_get_data_area_len(&offset, &data_length, hdr);
327 cFYI(1, "SMB2 data length %d offset %d", data_length, offset); 329 cifs_dbg(FYI, "SMB2 data length %d offset %d\n", data_length, offset);
328 330
329 if (data_length > 0) { 331 if (data_length > 0) {
330 /* 332 /*
@@ -335,15 +337,15 @@ smb2_calc_size(void *buf)
335 * the size of the RFC1001 hdr. 337 * the size of the RFC1001 hdr.
336 */ 338 */
337 if (offset + 4 + 1 < len) { 339 if (offset + 4 + 1 < len) {
338 cERROR(1, "data area offset %d overlaps SMB2 header %d", 340 cifs_dbg(VFS, "data area offset %d overlaps SMB2 header %d\n",
339 offset + 4 + 1, len); 341 offset + 4 + 1, len);
340 data_length = 0; 342 data_length = 0;
341 } else { 343 } else {
342 len = 4 + offset + data_length; 344 len = 4 + offset + data_length;
343 } 345 }
344 } 346 }
345calc_size_exit: 347calc_size_exit:
346 cFYI(1, "SMB2 len %d", len); 348 cifs_dbg(FYI, "SMB2 len %d\n", len);
347 return len; 349 return len;
348} 350}
349 351
@@ -405,7 +407,7 @@ cifs_ses_oplock_break(struct work_struct *work)
405 407
406 rc = SMB2_lease_break(0, tlink_tcon(lw->tlink), lw->lease_key, 408 rc = SMB2_lease_break(0, tlink_tcon(lw->tlink), lw->lease_key,
407 lw->lease_state); 409 lw->lease_state);
408 cFYI(1, "Lease release rc %d", rc); 410 cifs_dbg(FYI, "Lease release rc %d\n", rc);
409 cifs_put_tlink(lw->tlink); 411 cifs_put_tlink(lw->tlink);
410 kfree(lw); 412 kfree(lw);
411} 413}
@@ -426,15 +428,13 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
426 SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED); 428 SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED);
427 429
428 lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL); 430 lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL);
429 if (!lw) { 431 if (!lw)
430 cERROR(1, "Memory allocation failed during lease break check");
431 return false; 432 return false;
432 }
433 433
434 INIT_WORK(&lw->lease_break, cifs_ses_oplock_break); 434 INIT_WORK(&lw->lease_break, cifs_ses_oplock_break);
435 lw->lease_state = rsp->NewLeaseState; 435 lw->lease_state = rsp->NewLeaseState;
436 436
437 cFYI(1, "Checking for lease break"); 437 cifs_dbg(FYI, "Checking for lease break\n");
438 438
439 /* look up tcon based on tid & uid */ 439 /* look up tcon based on tid & uid */
440 spin_lock(&cifs_tcp_ses_lock); 440 spin_lock(&cifs_tcp_ses_lock);
@@ -455,9 +455,9 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
455 SMB2_LEASE_KEY_SIZE)) 455 SMB2_LEASE_KEY_SIZE))
456 continue; 456 continue;
457 457
458 cFYI(1, "found in the open list"); 458 cifs_dbg(FYI, "found in the open list\n");
459 cFYI(1, "lease key match, lease break 0x%d", 459 cifs_dbg(FYI, "lease key match, lease break 0x%d\n",
460 le32_to_cpu(rsp->NewLeaseState)); 460 le32_to_cpu(rsp->NewLeaseState));
461 461
462 smb2_set_oplock_level(cinode, 462 smb2_set_oplock_level(cinode,
463 smb2_map_lease_to_oplock(rsp->NewLeaseState)); 463 smb2_map_lease_to_oplock(rsp->NewLeaseState));
@@ -489,9 +489,9 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
489 &lw->lease_break); 489 &lw->lease_break);
490 } 490 }
491 491
492 cFYI(1, "found in the pending open list"); 492 cifs_dbg(FYI, "found in the pending open list\n");
493 cFYI(1, "lease key match, lease break 0x%d", 493 cifs_dbg(FYI, "lease key match, lease break 0x%d\n",
494 le32_to_cpu(rsp->NewLeaseState)); 494 le32_to_cpu(rsp->NewLeaseState));
495 495
496 open->oplock = 496 open->oplock =
497 smb2_map_lease_to_oplock(rsp->NewLeaseState); 497 smb2_map_lease_to_oplock(rsp->NewLeaseState);
@@ -506,7 +506,7 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
506 } 506 }
507 spin_unlock(&cifs_tcp_ses_lock); 507 spin_unlock(&cifs_tcp_ses_lock);
508 kfree(lw); 508 kfree(lw);
509 cFYI(1, "Can not process lease break - no lease matched"); 509 cifs_dbg(FYI, "Can not process lease break - no lease matched\n");
510 return false; 510 return false;
511} 511}
512 512
@@ -520,7 +520,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
520 struct cifsInodeInfo *cinode; 520 struct cifsInodeInfo *cinode;
521 struct cifsFileInfo *cfile; 521 struct cifsFileInfo *cfile;
522 522
523 cFYI(1, "Checking for oplock break"); 523 cifs_dbg(FYI, "Checking for oplock break\n");
524 524
525 if (rsp->hdr.Command != SMB2_OPLOCK_BREAK) 525 if (rsp->hdr.Command != SMB2_OPLOCK_BREAK)
526 return false; 526 return false;
@@ -533,7 +533,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
533 return false; 533 return false;
534 } 534 }
535 535
536 cFYI(1, "oplock level 0x%d", rsp->OplockLevel); 536 cifs_dbg(FYI, "oplock level 0x%d\n", rsp->OplockLevel);
537 537
538 /* look up tcon based on tid & uid */ 538 /* look up tcon based on tid & uid */
539 spin_lock(&cifs_tcp_ses_lock); 539 spin_lock(&cifs_tcp_ses_lock);
@@ -553,7 +553,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
553 cfile->fid.volatile_fid) 553 cfile->fid.volatile_fid)
554 continue; 554 continue;
555 555
556 cFYI(1, "file id match, oplock break"); 556 cifs_dbg(FYI, "file id match, oplock break\n");
557 cinode = CIFS_I(cfile->dentry->d_inode); 557 cinode = CIFS_I(cfile->dentry->d_inode);
558 558
559 if (!cinode->clientCanCacheAll && 559 if (!cinode->clientCanCacheAll &&
@@ -573,11 +573,11 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
573 } 573 }
574 spin_unlock(&cifs_file_list_lock); 574 spin_unlock(&cifs_file_list_lock);
575 spin_unlock(&cifs_tcp_ses_lock); 575 spin_unlock(&cifs_tcp_ses_lock);
576 cFYI(1, "No matching file for oplock break"); 576 cifs_dbg(FYI, "No matching file for oplock break\n");
577 return true; 577 return true;
578 } 578 }
579 } 579 }
580 spin_unlock(&cifs_tcp_ses_lock); 580 spin_unlock(&cifs_tcp_ses_lock);
581 cFYI(1, "Can not process oplock break for non-existent connection"); 581 cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
582 return false; 582 return false;
583} 583}
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index bceffe7b8f8d..f2e76f3b0c61 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -38,13 +38,13 @@ change_conf(struct TCP_Server_Info *server)
38 case 1: 38 case 1:
39 server->echoes = false; 39 server->echoes = false;
40 server->oplocks = false; 40 server->oplocks = false;
41 cERROR(1, "disabling echoes and oplocks"); 41 cifs_dbg(VFS, "disabling echoes and oplocks\n");
42 break; 42 break;
43 case 2: 43 case 2:
44 server->echoes = true; 44 server->echoes = true;
45 server->oplocks = false; 45 server->oplocks = false;
46 server->echo_credits = 1; 46 server->echo_credits = 1;
47 cFYI(1, "disabling oplocks"); 47 cifs_dbg(FYI, "disabling oplocks\n");
48 break; 48 break;
49 default: 49 default:
50 server->echoes = true; 50 server->echoes = true;
@@ -147,10 +147,10 @@ smb2_dump_detail(void *buf)
147#ifdef CONFIG_CIFS_DEBUG2 147#ifdef CONFIG_CIFS_DEBUG2
148 struct smb2_hdr *smb = (struct smb2_hdr *)buf; 148 struct smb2_hdr *smb = (struct smb2_hdr *)buf;
149 149
150 cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d", 150 cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d\n",
151 smb->Command, smb->Status, smb->Flags, smb->MessageId, 151 smb->Command, smb->Status, smb->Flags, smb->MessageId,
152 smb->ProcessId); 152 smb->ProcessId);
153 cERROR(1, "smb buf %p len %u", smb, smb2_calc_size(smb)); 153 cifs_dbg(VFS, "smb buf %p len %u\n", smb, smb2_calc_size(smb));
154#endif 154#endif
155} 155}
156 156
@@ -436,7 +436,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
436 &oplock, NULL); 436 &oplock, NULL);
437 kfree(utf16_path); 437 kfree(utf16_path);
438 if (rc) { 438 if (rc) {
439 cERROR(1, "open dir failed"); 439 cifs_dbg(VFS, "open dir failed\n");
440 return rc; 440 return rc;
441 } 441 }
442 442
@@ -448,7 +448,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
448 rc = SMB2_query_directory(xid, tcon, persistent_fid, volatile_fid, 0, 448 rc = SMB2_query_directory(xid, tcon, persistent_fid, volatile_fid, 0,
449 srch_inf); 449 srch_inf);
450 if (rc) { 450 if (rc) {
451 cERROR(1, "query directory failed"); 451 cifs_dbg(VFS, "query directory failed\n");
452 SMB2_close(xid, tcon, persistent_fid, volatile_fid); 452 SMB2_close(xid, tcon, persistent_fid, volatile_fid);
453 } 453 }
454 return rc; 454 return rc;
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 83ef66ed4c84..2b95ce2b54e8 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -155,8 +155,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
155 if ((smb2_command != SMB2_WRITE) && 155 if ((smb2_command != SMB2_WRITE) &&
156 (smb2_command != SMB2_CREATE) && 156 (smb2_command != SMB2_CREATE) &&
157 (smb2_command != SMB2_TREE_DISCONNECT)) { 157 (smb2_command != SMB2_TREE_DISCONNECT)) {
158 cFYI(1, "can not send cmd %d while umounting", 158 cifs_dbg(FYI, "can not send cmd %d while umounting\n",
159 smb2_command); 159 smb2_command);
160 return -ENODEV; 160 return -ENODEV;
161 } 161 }
162 } 162 }
@@ -200,7 +200,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
200 * back on-line 200 * back on-line
201 */ 201 */
202 if (!tcon->retry) { 202 if (!tcon->retry) {
203 cFYI(1, "gave up waiting on reconnect in smb_init"); 203 cifs_dbg(FYI, "gave up waiting on reconnect in smb_init\n");
204 return -EHOSTDOWN; 204 return -EHOSTDOWN;
205 } 205 }
206 } 206 }
@@ -227,7 +227,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
227 cifs_mark_open_files_invalid(tcon); 227 cifs_mark_open_files_invalid(tcon);
228 rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage); 228 rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage);
229 mutex_unlock(&tcon->ses->session_mutex); 229 mutex_unlock(&tcon->ses->session_mutex);
230 cFYI(1, "reconnect tcon rc = %d", rc); 230 cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
231 if (rc) 231 if (rc)
232 goto out; 232 goto out;
233 atomic_inc(&tconInfoReconnectCount); 233 atomic_inc(&tconInfoReconnectCount);
@@ -335,7 +335,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
335 char *security_blob; 335 char *security_blob;
336 int flags = CIFS_NEG_OP; 336 int flags = CIFS_NEG_OP;
337 337
338 cFYI(1, "Negotiate protocol"); 338 cifs_dbg(FYI, "Negotiate protocol\n");
339 339
340 if (ses->server) 340 if (ses->server)
341 server = ses->server; 341 server = ses->server;
@@ -354,7 +354,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
354 else /* if override flags set only sign/seal OR them with global auth */ 354 else /* if override flags set only sign/seal OR them with global auth */
355 sec_flags = global_secflags | ses->overrideSecFlg; 355 sec_flags = global_secflags | ses->overrideSecFlg;
356 356
357 cFYI(1, "sec_flags 0x%x", sec_flags); 357 cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags);
358 358
359 req->hdr.SessionId = 0; 359 req->hdr.SessionId = 0;
360 360
@@ -389,19 +389,19 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
389 if (rc != 0) 389 if (rc != 0)
390 goto neg_exit; 390 goto neg_exit;
391 391
392 cFYI(1, "mode 0x%x", rsp->SecurityMode); 392 cifs_dbg(FYI, "mode 0x%x\n", rsp->SecurityMode);
393 393
394 /* BB we may eventually want to match the negotiated vs. requested 394 /* BB we may eventually want to match the negotiated vs. requested
395 dialect, even though we are only requesting one at a time */ 395 dialect, even though we are only requesting one at a time */
396 if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) 396 if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID))
397 cFYI(1, "negotiated smb2.0 dialect"); 397 cifs_dbg(FYI, "negotiated smb2.0 dialect\n");
398 else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) 398 else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID))
399 cFYI(1, "negotiated smb2.1 dialect"); 399 cifs_dbg(FYI, "negotiated smb2.1 dialect\n");
400 else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID)) 400 else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID))
401 cFYI(1, "negotiated smb3.0 dialect"); 401 cifs_dbg(FYI, "negotiated smb3.0 dialect\n");
402 else { 402 else {
403 cERROR(1, "Illegal dialect returned by server %d", 403 cifs_dbg(VFS, "Illegal dialect returned by server %d\n",
404 le16_to_cpu(rsp->DialectRevision)); 404 le16_to_cpu(rsp->DialectRevision));
405 rc = -EIO; 405 rc = -EIO;
406 goto neg_exit; 406 goto neg_exit;
407 } 407 }
@@ -419,35 +419,34 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
419 security_blob = smb2_get_data_area_len(&blob_offset, &blob_length, 419 security_blob = smb2_get_data_area_len(&blob_offset, &blob_length,
420 &rsp->hdr); 420 &rsp->hdr);
421 if (blob_length == 0) { 421 if (blob_length == 0) {
422 cERROR(1, "missing security blob on negprot"); 422 cifs_dbg(VFS, "missing security blob on negprot\n");
423 rc = -EIO; 423 rc = -EIO;
424 goto neg_exit; 424 goto neg_exit;
425 } 425 }
426 426
427 cFYI(1, "sec_flags 0x%x", sec_flags); 427 cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags);
428 if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { 428 if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) {
429 cFYI(1, "Signing required"); 429 cifs_dbg(FYI, "Signing required\n");
430 if (!(server->sec_mode & (SMB2_NEGOTIATE_SIGNING_REQUIRED | 430 if (!(server->sec_mode & (SMB2_NEGOTIATE_SIGNING_REQUIRED |
431 SMB2_NEGOTIATE_SIGNING_ENABLED))) { 431 SMB2_NEGOTIATE_SIGNING_ENABLED))) {
432 cERROR(1, "signing required but server lacks support"); 432 cifs_dbg(VFS, "signing required but server lacks support\n");
433 rc = -EOPNOTSUPP; 433 rc = -EOPNOTSUPP;
434 goto neg_exit; 434 goto neg_exit;
435 } 435 }
436 server->sec_mode |= SECMODE_SIGN_REQUIRED; 436 server->sec_mode |= SECMODE_SIGN_REQUIRED;
437 } else if (sec_flags & CIFSSEC_MAY_SIGN) { 437 } else if (sec_flags & CIFSSEC_MAY_SIGN) {
438 cFYI(1, "Signing optional"); 438 cifs_dbg(FYI, "Signing optional\n");
439 if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) { 439 if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) {
440 cFYI(1, "Server requires signing"); 440 cifs_dbg(FYI, "Server requires signing\n");
441 server->sec_mode |= SECMODE_SIGN_REQUIRED; 441 server->sec_mode |= SECMODE_SIGN_REQUIRED;
442 } else { 442 } else {
443 server->sec_mode &= 443 server->sec_mode &=
444 ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); 444 ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED);
445 } 445 }
446 } else { 446 } else {
447 cFYI(1, "Signing disabled"); 447 cifs_dbg(FYI, "Signing disabled\n");
448 if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) { 448 if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) {
449 cERROR(1, "Server requires packet signing to be enabled" 449 cifs_dbg(VFS, "Server requires packet signing to be enabled in /proc/fs/cifs/SecurityFlags\n");
450 " in /proc/fs/cifs/SecurityFlags.");
451 rc = -EOPNOTSUPP; 450 rc = -EOPNOTSUPP;
452 goto neg_exit; 451 goto neg_exit;
453 } 452 }
@@ -489,7 +488,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
489 char *ntlmssp_blob = NULL; 488 char *ntlmssp_blob = NULL;
490 bool use_spnego = false; /* else use raw ntlmssp */ 489 bool use_spnego = false; /* else use raw ntlmssp */
491 490
492 cFYI(1, "Session Setup"); 491 cifs_dbg(FYI, "Session Setup\n");
493 492
494 if (ses->server) 493 if (ses->server)
495 server = ses->server; 494 server = ses->server;
@@ -522,7 +521,7 @@ ssetup_ntlmssp_authenticate:
522 else /* if override flags set only sign/seal OR them with global auth */ 521 else /* if override flags set only sign/seal OR them with global auth */
523 sec_flags = global_secflags | ses->overrideSecFlg; 522 sec_flags = global_secflags | ses->overrideSecFlg;
524 523
525 cFYI(1, "sec_flags 0x%x", sec_flags); 524 cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags);
526 525
527 req->hdr.SessionId = 0; /* First session, not a reauthenticate */ 526 req->hdr.SessionId = 0; /* First session, not a reauthenticate */
528 req->VcNumber = 0; /* MBZ */ 527 req->VcNumber = 0; /* MBZ */
@@ -558,7 +557,7 @@ ssetup_ntlmssp_authenticate:
558 sizeof(struct _NEGOTIATE_MESSAGE), 557 sizeof(struct _NEGOTIATE_MESSAGE),
559 ntlmssp_blob); */ 558 ntlmssp_blob); */
560 /* BB eventually need to add this */ 559 /* BB eventually need to add this */
561 cERROR(1, "spnego not supported for SMB2 yet"); 560 cifs_dbg(VFS, "spnego not supported for SMB2 yet\n");
562 rc = -EOPNOTSUPP; 561 rc = -EOPNOTSUPP;
563 kfree(ntlmssp_blob); 562 kfree(ntlmssp_blob);
564 goto ssetup_exit; 563 goto ssetup_exit;
@@ -572,14 +571,14 @@ ssetup_ntlmssp_authenticate:
572 ntlmssp_blob = kzalloc(sizeof(struct _NEGOTIATE_MESSAGE) + 500, 571 ntlmssp_blob = kzalloc(sizeof(struct _NEGOTIATE_MESSAGE) + 500,
573 GFP_KERNEL); 572 GFP_KERNEL);
574 if (ntlmssp_blob == NULL) { 573 if (ntlmssp_blob == NULL) {
575 cERROR(1, "failed to malloc ntlmssp blob");
576 rc = -ENOMEM; 574 rc = -ENOMEM;
577 goto ssetup_exit; 575 goto ssetup_exit;
578 } 576 }
579 rc = build_ntlmssp_auth_blob(ntlmssp_blob, &blob_length, ses, 577 rc = build_ntlmssp_auth_blob(ntlmssp_blob, &blob_length, ses,
580 nls_cp); 578 nls_cp);
581 if (rc) { 579 if (rc) {
582 cFYI(1, "build_ntlmssp_auth_blob failed %d", rc); 580 cifs_dbg(FYI, "build_ntlmssp_auth_blob failed %d\n",
581 rc);
583 goto ssetup_exit; /* BB double check error handling */ 582 goto ssetup_exit; /* BB double check error handling */
584 } 583 }
585 if (use_spnego) { 584 if (use_spnego) {
@@ -587,7 +586,7 @@ ssetup_ntlmssp_authenticate:
587 &security_blob, 586 &security_blob,
588 blob_length, 587 blob_length,
589 ntlmssp_blob); */ 588 ntlmssp_blob); */
590 cERROR(1, "spnego not supported for SMB2 yet"); 589 cifs_dbg(VFS, "spnego not supported for SMB2 yet\n");
591 rc = -EOPNOTSUPP; 590 rc = -EOPNOTSUPP;
592 kfree(ntlmssp_blob); 591 kfree(ntlmssp_blob);
593 goto ssetup_exit; 592 goto ssetup_exit;
@@ -595,7 +594,7 @@ ssetup_ntlmssp_authenticate:
595 security_blob = ntlmssp_blob; 594 security_blob = ntlmssp_blob;
596 } 595 }
597 } else { 596 } else {
598 cERROR(1, "illegal ntlmssp phase"); 597 cifs_dbg(VFS, "illegal ntlmssp phase\n");
599 rc = -EIO; 598 rc = -EIO;
600 goto ssetup_exit; 599 goto ssetup_exit;
601 } 600 }
@@ -620,13 +619,13 @@ ssetup_ntlmssp_authenticate:
620 if (resp_buftype != CIFS_NO_BUFFER && 619 if (resp_buftype != CIFS_NO_BUFFER &&
621 rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) { 620 rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) {
622 if (phase != NtLmNegotiate) { 621 if (phase != NtLmNegotiate) {
623 cERROR(1, "Unexpected more processing error"); 622 cifs_dbg(VFS, "Unexpected more processing error\n");
624 goto ssetup_exit; 623 goto ssetup_exit;
625 } 624 }
626 if (offsetof(struct smb2_sess_setup_rsp, Buffer) - 4 != 625 if (offsetof(struct smb2_sess_setup_rsp, Buffer) - 4 !=
627 le16_to_cpu(rsp->SecurityBufferOffset)) { 626 le16_to_cpu(rsp->SecurityBufferOffset)) {
628 cERROR(1, "Invalid security buffer offset %d", 627 cifs_dbg(VFS, "Invalid security buffer offset %d\n",
629 le16_to_cpu(rsp->SecurityBufferOffset)); 628 le16_to_cpu(rsp->SecurityBufferOffset));
630 rc = -EIO; 629 rc = -EIO;
631 goto ssetup_exit; 630 goto ssetup_exit;
632 } 631 }
@@ -667,7 +666,7 @@ SMB2_logoff(const unsigned int xid, struct cifs_ses *ses)
667 int rc = 0; 666 int rc = 0;
668 struct TCP_Server_Info *server; 667 struct TCP_Server_Info *server;
669 668
670 cFYI(1, "disconnect session %p", ses); 669 cifs_dbg(FYI, "disconnect session %p\n", ses);
671 670
672 if (ses && (ses->server)) 671 if (ses && (ses->server))
673 server = ses->server; 672 server = ses->server;
@@ -711,7 +710,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
711 struct TCP_Server_Info *server; 710 struct TCP_Server_Info *server;
712 __le16 *unc_path = NULL; 711 __le16 *unc_path = NULL;
713 712
714 cFYI(1, "TCON"); 713 cifs_dbg(FYI, "TCON\n");
715 714
716 if ((ses->server) && tree) 715 if ((ses->server) && tree)
717 server = ses->server; 716 server = ses->server;
@@ -775,15 +774,15 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
775 } 774 }
776 775
777 if (rsp->ShareType & SMB2_SHARE_TYPE_DISK) 776 if (rsp->ShareType & SMB2_SHARE_TYPE_DISK)
778 cFYI(1, "connection to disk share"); 777 cifs_dbg(FYI, "connection to disk share\n");
779 else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) { 778 else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) {
780 tcon->ipc = true; 779 tcon->ipc = true;
781 cFYI(1, "connection to pipe share"); 780 cifs_dbg(FYI, "connection to pipe share\n");
782 } else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) { 781 } else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) {
783 tcon->print = true; 782 tcon->print = true;
784 cFYI(1, "connection to printer"); 783 cifs_dbg(FYI, "connection to printer\n");
785 } else { 784 } else {
786 cERROR(1, "unknown share type %d", rsp->ShareType); 785 cifs_dbg(VFS, "unknown share type %d\n", rsp->ShareType);
787 rc = -EOPNOTSUPP; 786 rc = -EOPNOTSUPP;
788 goto tcon_error_exit; 787 goto tcon_error_exit;
789 } 788 }
@@ -797,7 +796,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
797 796
798 if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && 797 if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) &&
799 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) 798 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0))
800 cERROR(1, "DFS capability contradicts DFS flag"); 799 cifs_dbg(VFS, "DFS capability contradicts DFS flag\n");
801 800
802tcon_exit: 801tcon_exit:
803 free_rsp_buf(resp_buftype, rsp); 802 free_rsp_buf(resp_buftype, rsp);
@@ -806,7 +805,7 @@ tcon_exit:
806 805
807tcon_error_exit: 806tcon_error_exit:
808 if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) { 807 if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) {
809 cERROR(1, "BAD_NETWORK_NAME: %s", tree); 808 cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree);
810 tcon->bad_network_name = true; 809 tcon->bad_network_name = true;
811 } 810 }
812 goto tcon_exit; 811 goto tcon_exit;
@@ -820,7 +819,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
820 struct TCP_Server_Info *server; 819 struct TCP_Server_Info *server;
821 struct cifs_ses *ses = tcon->ses; 820 struct cifs_ses *ses = tcon->ses;
822 821
823 cFYI(1, "Tree Disconnect"); 822 cifs_dbg(FYI, "Tree Disconnect\n");
824 823
825 if (ses && (ses->server)) 824 if (ses && (ses->server))
826 server = ses->server; 825 server = ses->server;
@@ -923,7 +922,7 @@ SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path,
923 int rc = 0; 922 int rc = 0;
924 int num_iovecs = 2; 923 int num_iovecs = 2;
925 924
926 cFYI(1, "create/open"); 925 cifs_dbg(FYI, "create/open\n");
927 926
928 if (ses && (ses->server)) 927 if (ses && (ses->server))
929 server = ses->server; 928 server = ses->server;
@@ -1049,7 +1048,7 @@ SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
1049 int resp_buftype; 1048 int resp_buftype;
1050 int rc = 0; 1049 int rc = 0;
1051 1050
1052 cFYI(1, "Close"); 1051 cifs_dbg(FYI, "Close\n");
1053 1052
1054 if (ses && (ses->server)) 1053 if (ses && (ses->server))
1055 server = ses->server; 1054 server = ses->server;
@@ -1095,20 +1094,20 @@ validate_buf(unsigned int offset, unsigned int buffer_length,
1095 1094
1096 1095
1097 if (buffer_length < min_buf_size) { 1096 if (buffer_length < min_buf_size) {
1098 cERROR(1, "buffer length %d smaller than minimum size %d", 1097 cifs_dbg(VFS, "buffer length %d smaller than minimum size %d\n",
1099 buffer_length, min_buf_size); 1098 buffer_length, min_buf_size);
1100 return -EINVAL; 1099 return -EINVAL;
1101 } 1100 }
1102 1101
1103 /* check if beyond RFC1001 maximum length */ 1102 /* check if beyond RFC1001 maximum length */
1104 if ((smb_len > 0x7FFFFF) || (buffer_length > 0x7FFFFF)) { 1103 if ((smb_len > 0x7FFFFF) || (buffer_length > 0x7FFFFF)) {
1105 cERROR(1, "buffer length %d or smb length %d too large", 1104 cifs_dbg(VFS, "buffer length %d or smb length %d too large\n",
1106 buffer_length, smb_len); 1105 buffer_length, smb_len);
1107 return -EINVAL; 1106 return -EINVAL;
1108 } 1107 }
1109 1108
1110 if ((begin_of_buf > end_of_smb) || (end_of_buf > end_of_smb)) { 1109 if ((begin_of_buf > end_of_smb) || (end_of_buf > end_of_smb)) {
1111 cERROR(1, "illegal server response, bad offset to data"); 1110 cifs_dbg(VFS, "illegal server response, bad offset to data\n");
1112 return -EINVAL; 1111 return -EINVAL;
1113 } 1112 }
1114 1113
@@ -1153,7 +1152,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon,
1153 struct TCP_Server_Info *server; 1152 struct TCP_Server_Info *server;
1154 struct cifs_ses *ses = tcon->ses; 1153 struct cifs_ses *ses = tcon->ses;
1155 1154
1156 cFYI(1, "Query Info"); 1155 cifs_dbg(FYI, "Query Info\n");
1157 1156
1158 if (ses && (ses->server)) 1157 if (ses && (ses->server))
1159 server = ses->server; 1158 server = ses->server;
@@ -1245,7 +1244,7 @@ SMB2_echo(struct TCP_Server_Info *server)
1245 struct smb_rqst rqst = { .rq_iov = &iov, 1244 struct smb_rqst rqst = { .rq_iov = &iov,
1246 .rq_nvec = 1 }; 1245 .rq_nvec = 1 };
1247 1246
1248 cFYI(1, "In echo request"); 1247 cifs_dbg(FYI, "In echo request\n");
1249 1248
1250 rc = small_smb2_init(SMB2_ECHO, NULL, (void **)&req); 1249 rc = small_smb2_init(SMB2_ECHO, NULL, (void **)&req);
1251 if (rc) 1250 if (rc)
@@ -1260,7 +1259,7 @@ SMB2_echo(struct TCP_Server_Info *server)
1260 rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, server, 1259 rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, server,
1261 CIFS_ECHO_OP); 1260 CIFS_ECHO_OP);
1262 if (rc) 1261 if (rc)
1263 cFYI(1, "Echo request failed: %d", rc); 1262 cifs_dbg(FYI, "Echo request failed: %d\n", rc);
1264 1263
1265 cifs_small_buf_release(req); 1264 cifs_small_buf_release(req);
1266 return rc; 1265 return rc;
@@ -1277,7 +1276,7 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
1277 int resp_buftype; 1276 int resp_buftype;
1278 int rc = 0; 1277 int rc = 0;
1279 1278
1280 cFYI(1, "Flush"); 1279 cifs_dbg(FYI, "Flush\n");
1281 1280
1282 if (ses && (ses->server)) 1281 if (ses && (ses->server))
1283 server = ses->server; 1282 server = ses->server;
@@ -1377,8 +1376,9 @@ smb2_readv_callback(struct mid_q_entry *mid)
1377 .rq_pagesz = rdata->pagesz, 1376 .rq_pagesz = rdata->pagesz,
1378 .rq_tailsz = rdata->tailsz }; 1377 .rq_tailsz = rdata->tailsz };
1379 1378
1380 cFYI(1, "%s: mid=%llu state=%d result=%d bytes=%u", __func__, 1379 cifs_dbg(FYI, "%s: mid=%llu state=%d result=%d bytes=%u\n",
1381 mid->mid, mid->mid_state, rdata->result, rdata->bytes); 1380 __func__, mid->mid, mid->mid_state, rdata->result,
1381 rdata->bytes);
1382 1382
1383 switch (mid->mid_state) { 1383 switch (mid->mid_state) {
1384 case MID_RESPONSE_RECEIVED: 1384 case MID_RESPONSE_RECEIVED:
@@ -1390,8 +1390,8 @@ smb2_readv_callback(struct mid_q_entry *mid)
1390 1390
1391 rc = smb2_verify_signature(&rqst, server); 1391 rc = smb2_verify_signature(&rqst, server);
1392 if (rc) 1392 if (rc)
1393 cERROR(1, "SMB signature verification returned " 1393 cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
1394 "error = %d", rc); 1394 rc);
1395 } 1395 }
1396 /* FIXME: should this be counted toward the initiating task? */ 1396 /* FIXME: should this be counted toward the initiating task? */
1397 task_io_account_read(rdata->bytes); 1397 task_io_account_read(rdata->bytes);
@@ -1424,8 +1424,8 @@ smb2_async_readv(struct cifs_readdata *rdata)
1424 struct smb_rqst rqst = { .rq_iov = &rdata->iov, 1424 struct smb_rqst rqst = { .rq_iov = &rdata->iov,
1425 .rq_nvec = 1 }; 1425 .rq_nvec = 1 };
1426 1426
1427 cFYI(1, "%s: offset=%llu bytes=%u", __func__, 1427 cifs_dbg(FYI, "%s: offset=%llu bytes=%u\n",
1428 rdata->offset, rdata->bytes); 1428 __func__, rdata->offset, rdata->bytes);
1429 1429
1430 io_parms.tcon = tlink_tcon(rdata->cfile->tlink); 1430 io_parms.tcon = tlink_tcon(rdata->cfile->tlink);
1431 io_parms.offset = rdata->offset; 1431 io_parms.offset = rdata->offset;
@@ -1479,13 +1479,13 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
1479 1479
1480 if (rc) { 1480 if (rc) {
1481 cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE); 1481 cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE);
1482 cERROR(1, "Send error in read = %d", rc); 1482 cifs_dbg(VFS, "Send error in read = %d\n", rc);
1483 } else { 1483 } else {
1484 *nbytes = le32_to_cpu(rsp->DataLength); 1484 *nbytes = le32_to_cpu(rsp->DataLength);
1485 if ((*nbytes > CIFS_MAX_MSGSIZE) || 1485 if ((*nbytes > CIFS_MAX_MSGSIZE) ||
1486 (*nbytes > io_parms->length)) { 1486 (*nbytes > io_parms->length)) {
1487 cFYI(1, "bad length %d for count %d", *nbytes, 1487 cifs_dbg(FYI, "bad length %d for count %d\n",
1488 io_parms->length); 1488 *nbytes, io_parms->length);
1489 rc = -EIO; 1489 rc = -EIO;
1490 *nbytes = 0; 1490 *nbytes = 0;
1491 } 1491 }
@@ -1595,7 +1595,8 @@ smb2_async_writev(struct cifs_writedata *wdata)
1595 rqst.rq_pagesz = wdata->pagesz; 1595 rqst.rq_pagesz = wdata->pagesz;
1596 rqst.rq_tailsz = wdata->tailsz; 1596 rqst.rq_tailsz = wdata->tailsz;
1597 1597
1598 cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); 1598 cifs_dbg(FYI, "async write at %llu %u bytes\n",
1599 wdata->offset, wdata->bytes);
1599 1600
1600 req->Length = cpu_to_le32(wdata->bytes); 1601 req->Length = cpu_to_le32(wdata->bytes);
1601 1602
@@ -1668,7 +1669,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
1668 1669
1669 if (rc) { 1670 if (rc) {
1670 cifs_stats_fail_inc(io_parms->tcon, SMB2_WRITE_HE); 1671 cifs_stats_fail_inc(io_parms->tcon, SMB2_WRITE_HE);
1671 cERROR(1, "Send error in write = %d", rc); 1672 cifs_dbg(VFS, "Send error in write = %d\n", rc);
1672 } else 1673 } else
1673 *nbytes = le32_to_cpu(rsp->DataLength); 1674 *nbytes = le32_to_cpu(rsp->DataLength);
1674 1675
@@ -1694,14 +1695,14 @@ num_entries(char *bufstart, char *end_of_buf, char **lastentry, size_t size)
1694 ((char *)entryptr + next_offset); 1695 ((char *)entryptr + next_offset);
1695 1696
1696 if ((char *)entryptr + size > end_of_buf) { 1697 if ((char *)entryptr + size > end_of_buf) {
1697 cERROR(1, "malformed search entry would overflow"); 1698 cifs_dbg(VFS, "malformed search entry would overflow\n");
1698 break; 1699 break;
1699 } 1700 }
1700 1701
1701 len = le32_to_cpu(entryptr->FileNameLength); 1702 len = le32_to_cpu(entryptr->FileNameLength);
1702 if ((char *)entryptr + len + size > end_of_buf) { 1703 if ((char *)entryptr + len + size > end_of_buf) {
1703 cERROR(1, "directory entry name would overflow frame " 1704 cifs_dbg(VFS, "directory entry name would overflow frame end of buf %p\n",
1704 "end of buf %p", end_of_buf); 1705 end_of_buf);
1705 break; 1706 break;
1706 } 1707 }
1707 1708
@@ -1757,8 +1758,8 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
1757 info_buf_size = sizeof(SEARCH_ID_FULL_DIR_INFO) - 1; 1758 info_buf_size = sizeof(SEARCH_ID_FULL_DIR_INFO) - 1;
1758 break; 1759 break;
1759 default: 1760 default:
1760 cERROR(1, "info level %u isn't supported", 1761 cifs_dbg(VFS, "info level %u isn't supported\n",
1761 srch_inf->info_level); 1762 srch_inf->info_level);
1762 rc = -EINVAL; 1763 rc = -EINVAL;
1763 goto qdir_exit; 1764 goto qdir_exit;
1764 } 1765 }
@@ -1822,15 +1823,15 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
1822 num_entries(srch_inf->srch_entries_start, end_of_smb, 1823 num_entries(srch_inf->srch_entries_start, end_of_smb,
1823 &srch_inf->last_entry, info_buf_size); 1824 &srch_inf->last_entry, info_buf_size);
1824 srch_inf->index_of_last_entry += srch_inf->entries_in_buffer; 1825 srch_inf->index_of_last_entry += srch_inf->entries_in_buffer;
1825 cFYI(1, "num entries %d last_index %lld srch start %p srch end %p", 1826 cifs_dbg(FYI, "num entries %d last_index %lld srch start %p srch end %p\n",
1826 srch_inf->entries_in_buffer, srch_inf->index_of_last_entry, 1827 srch_inf->entries_in_buffer, srch_inf->index_of_last_entry,
1827 srch_inf->srch_entries_start, srch_inf->last_entry); 1828 srch_inf->srch_entries_start, srch_inf->last_entry);
1828 if (resp_buftype == CIFS_LARGE_BUFFER) 1829 if (resp_buftype == CIFS_LARGE_BUFFER)
1829 srch_inf->smallBuf = false; 1830 srch_inf->smallBuf = false;
1830 else if (resp_buftype == CIFS_SMALL_BUFFER) 1831 else if (resp_buftype == CIFS_SMALL_BUFFER)
1831 srch_inf->smallBuf = true; 1832 srch_inf->smallBuf = true;
1832 else 1833 else
1833 cERROR(1, "illegal search buffer type"); 1834 cifs_dbg(VFS, "illegal search buffer type\n");
1834 1835
1835 if (rsp->hdr.Status == STATUS_NO_MORE_FILES) 1836 if (rsp->hdr.Status == STATUS_NO_MORE_FILES)
1836 srch_inf->endOfSearch = 1; 1837 srch_inf->endOfSearch = 1;
@@ -2015,7 +2016,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon,
2015 int rc; 2016 int rc;
2016 struct smb2_oplock_break *req = NULL; 2017 struct smb2_oplock_break *req = NULL;
2017 2018
2018 cFYI(1, "SMB2_oplock_break"); 2019 cifs_dbg(FYI, "SMB2_oplock_break\n");
2019 rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req); 2020 rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req);
2020 2021
2021 if (rc) 2022 if (rc)
@@ -2031,7 +2032,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon,
2031 2032
2032 if (rc) { 2033 if (rc) {
2033 cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); 2034 cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE);
2034 cFYI(1, "Send error in Oplock Break = %d", rc); 2035 cifs_dbg(FYI, "Send error in Oplock Break = %d\n", rc);
2035 } 2036 }
2036 2037
2037 return rc; 2038 return rc;
@@ -2056,7 +2057,7 @@ build_qfs_info_req(struct kvec *iov, struct cifs_tcon *tcon, int level,
2056 int rc; 2057 int rc;
2057 struct smb2_query_info_req *req; 2058 struct smb2_query_info_req *req;
2058 2059
2059 cFYI(1, "Query FSInfo level %d", level); 2060 cifs_dbg(FYI, "Query FSInfo level %d\n", level);
2060 2061
2061 if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) 2062 if ((tcon->ses == NULL) || (tcon->ses->server == NULL))
2062 return -EIO; 2063 return -EIO;
@@ -2129,7 +2130,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2129 int resp_buf_type; 2130 int resp_buf_type;
2130 unsigned int count; 2131 unsigned int count;
2131 2132
2132 cFYI(1, "smb2_lockv num lock %d", num_lock); 2133 cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock);
2133 2134
2134 rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); 2135 rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req);
2135 if (rc) 2136 if (rc)
@@ -2153,7 +2154,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2153 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); 2154 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2154 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); 2155 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP);
2155 if (rc) { 2156 if (rc) {
2156 cFYI(1, "Send error in smb2_lockv = %d", rc); 2157 cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc);
2157 cifs_stats_fail_inc(tcon, SMB2_LOCK_HE); 2158 cifs_stats_fail_inc(tcon, SMB2_LOCK_HE);
2158 } 2159 }
2159 2160
@@ -2184,7 +2185,7 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon,
2184 int rc; 2185 int rc;
2185 struct smb2_lease_ack *req = NULL; 2186 struct smb2_lease_ack *req = NULL;
2186 2187
2187 cFYI(1, "SMB2_lease_break"); 2188 cifs_dbg(FYI, "SMB2_lease_break\n");
2188 rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req); 2189 rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req);
2189 2190
2190 if (rc) 2191 if (rc)
@@ -2202,7 +2203,7 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon,
2202 2203
2203 if (rc) { 2204 if (rc) {
2204 cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); 2205 cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE);
2205 cFYI(1, "Send error in Lease Break = %d", rc); 2206 cifs_dbg(FYI, "Send error in Lease Break = %d\n", rc);
2206 } 2207 }
2207 2208
2208 return rc; 2209 return rc;
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
index 8dd73e61d762..01f0ac800780 100644
--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -55,13 +55,13 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
55 rc = crypto_shash_setkey(server->secmech.hmacsha256, 55 rc = crypto_shash_setkey(server->secmech.hmacsha256,
56 server->session_key.response, SMB2_NTLMV2_SESSKEY_SIZE); 56 server->session_key.response, SMB2_NTLMV2_SESSKEY_SIZE);
57 if (rc) { 57 if (rc) {
58 cERROR(1, "%s: Could not update with response\n", __func__); 58 cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
59 return rc; 59 return rc;
60 } 60 }
61 61
62 rc = crypto_shash_init(&server->secmech.sdeschmacsha256->shash); 62 rc = crypto_shash_init(&server->secmech.sdeschmacsha256->shash);
63 if (rc) { 63 if (rc) {
64 cERROR(1, "%s: Could not init md5\n", __func__); 64 cifs_dbg(VFS, "%s: Could not init md5\n", __func__);
65 return rc; 65 return rc;
66 } 66 }
67 67
@@ -69,7 +69,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
69 if (iov[i].iov_len == 0) 69 if (iov[i].iov_len == 0)
70 continue; 70 continue;
71 if (iov[i].iov_base == NULL) { 71 if (iov[i].iov_base == NULL) {
72 cERROR(1, "null iovec entry"); 72 cifs_dbg(VFS, "null iovec entry\n");
73 return -EIO; 73 return -EIO;
74 } 74 }
75 /* 75 /*
@@ -90,8 +90,8 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
90 iov[i].iov_base, iov[i].iov_len); 90 iov[i].iov_base, iov[i].iov_len);
91 } 91 }
92 if (rc) { 92 if (rc) {
93 cERROR(1, "%s: Could not update with payload\n", 93 cifs_dbg(VFS, "%s: Could not update with payload\n",
94 __func__); 94 __func__);
95 return rc; 95 return rc;
96 } 96 }
97 } 97 }
@@ -109,7 +109,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
109 rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash, 109 rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash,
110 sigptr); 110 sigptr);
111 if (rc) 111 if (rc)
112 cERROR(1, "%s: Could not generate sha256 hash\n", __func__); 112 cifs_dbg(VFS, "%s: Could not generate sha256 hash\n", __func__);
113 113
114 memcpy(smb2_pdu->Signature, sigptr, SMB2_SIGNATURE_SIZE); 114 memcpy(smb2_pdu->Signature, sigptr, SMB2_SIGNATURE_SIZE);
115 115
@@ -119,7 +119,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
119int 119int
120smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) 120smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
121{ 121{
122 cFYI(1, "smb3 signatures not supported yet"); 122 cifs_dbg(FYI, "smb3 signatures not supported yet\n");
123 return -EOPNOTSUPP; 123 return -EOPNOTSUPP;
124} 124}
125 125
@@ -163,8 +163,8 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
163 163
164 /* Do not need to verify session setups with signature "BSRSPYL " */ 164 /* Do not need to verify session setups with signature "BSRSPYL " */
165 if (memcmp(smb2_pdu->Signature, "BSRSPYL ", 8) == 0) 165 if (memcmp(smb2_pdu->Signature, "BSRSPYL ", 8) == 0)
166 cFYI(1, "dummy signature received for smb command 0x%x", 166 cifs_dbg(FYI, "dummy signature received for smb command 0x%x\n",
167 smb2_pdu->Command); 167 smb2_pdu->Command);
168 168
169 /* 169 /*
170 * Save off the origiginal signature so we can modify the smb and check 170 * Save off the origiginal signature so we can modify the smb and check
@@ -205,7 +205,7 @@ smb2_mid_entry_alloc(const struct smb2_hdr *smb_buffer,
205 struct mid_q_entry *temp; 205 struct mid_q_entry *temp;
206 206
207 if (server == NULL) { 207 if (server == NULL) {
208 cERROR(1, "Null TCP session in smb2_mid_entry_alloc"); 208 cifs_dbg(VFS, "Null TCP session in smb2_mid_entry_alloc\n");
209 return NULL; 209 return NULL;
210 } 210 }
211 211
@@ -241,7 +241,7 @@ smb2_get_mid_entry(struct cifs_ses *ses, struct smb2_hdr *buf,
241 return -ENOENT; 241 return -ENOENT;
242 242
243 if (ses->server->tcpStatus == CifsNeedReconnect) { 243 if (ses->server->tcpStatus == CifsNeedReconnect) {
244 cFYI(1, "tcp session dead - return to caller to retry"); 244 cifs_dbg(FYI, "tcp session dead - return to caller to retry\n");
245 return -EAGAIN; 245 return -EAGAIN;
246 } 246 }
247 247
@@ -281,8 +281,8 @@ smb2_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
281 281
282 rc = smb2_verify_signature(&rqst, server); 282 rc = smb2_verify_signature(&rqst, server);
283 if (rc) 283 if (rc)
284 cERROR(1, "SMB signature verification returned error = " 284 cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
285 "%d", rc); 285 rc);
286 } 286 }
287 287
288 return map_smb2_to_linux_error(mid->resp_buf, log_error); 288 return map_smb2_to_linux_error(mid->resp_buf, log_error);
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
index a0a58fbe2c10..43eb1367b103 100644
--- a/fs/cifs/smbencrypt.c
+++ b/fs/cifs/smbencrypt.c
@@ -78,7 +78,7 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
78 tfm_des = crypto_alloc_blkcipher("ecb(des)", 0, CRYPTO_ALG_ASYNC); 78 tfm_des = crypto_alloc_blkcipher("ecb(des)", 0, CRYPTO_ALG_ASYNC);
79 if (IS_ERR(tfm_des)) { 79 if (IS_ERR(tfm_des)) {
80 rc = PTR_ERR(tfm_des); 80 rc = PTR_ERR(tfm_des);
81 cERROR(1, "could not allocate des crypto API"); 81 cifs_dbg(VFS, "could not allocate des crypto API\n");
82 goto smbhash_err; 82 goto smbhash_err;
83 } 83 }
84 84
@@ -91,7 +91,7 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
91 91
92 rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, 8); 92 rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, 8);
93 if (rc) 93 if (rc)
94 cERROR(1, "could not encrypt crypt key rc: %d", rc); 94 cifs_dbg(VFS, "could not encrypt crypt key rc: %d\n", rc);
95 95
96 crypto_free_blkcipher(tfm_des); 96 crypto_free_blkcipher(tfm_des);
97smbhash_err: 97smbhash_err:
@@ -139,14 +139,14 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len)
139 md4 = crypto_alloc_shash("md4", 0, 0); 139 md4 = crypto_alloc_shash("md4", 0, 0);
140 if (IS_ERR(md4)) { 140 if (IS_ERR(md4)) {
141 rc = PTR_ERR(md4); 141 rc = PTR_ERR(md4);
142 cERROR(1, "%s: Crypto md4 allocation error %d", __func__, rc); 142 cifs_dbg(VFS, "%s: Crypto md4 allocation error %d\n",
143 __func__, rc);
143 return rc; 144 return rc;
144 } 145 }
145 size = sizeof(struct shash_desc) + crypto_shash_descsize(md4); 146 size = sizeof(struct shash_desc) + crypto_shash_descsize(md4);
146 sdescmd4 = kmalloc(size, GFP_KERNEL); 147 sdescmd4 = kmalloc(size, GFP_KERNEL);
147 if (!sdescmd4) { 148 if (!sdescmd4) {
148 rc = -ENOMEM; 149 rc = -ENOMEM;
149 cERROR(1, "%s: Memory allocation failure", __func__);
150 goto mdfour_err; 150 goto mdfour_err;
151 } 151 }
152 sdescmd4->shash.tfm = md4; 152 sdescmd4->shash.tfm = md4;
@@ -154,17 +154,17 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len)
154 154
155 rc = crypto_shash_init(&sdescmd4->shash); 155 rc = crypto_shash_init(&sdescmd4->shash);
156 if (rc) { 156 if (rc) {
157 cERROR(1, "%s: Could not init md4 shash", __func__); 157 cifs_dbg(VFS, "%s: Could not init md4 shash\n", __func__);
158 goto mdfour_err; 158 goto mdfour_err;
159 } 159 }
160 rc = crypto_shash_update(&sdescmd4->shash, link_str, link_len); 160 rc = crypto_shash_update(&sdescmd4->shash, link_str, link_len);
161 if (rc) { 161 if (rc) {
162 cERROR(1, "%s: Could not update with link_str", __func__); 162 cifs_dbg(VFS, "%s: Could not update with link_str\n", __func__);
163 goto mdfour_err; 163 goto mdfour_err;
164 } 164 }
165 rc = crypto_shash_final(&sdescmd4->shash, md4_hash); 165 rc = crypto_shash_final(&sdescmd4->shash, md4_hash);
166 if (rc) 166 if (rc)
167 cERROR(1, "%s: Could not genereate md4 hash", __func__); 167 cifs_dbg(VFS, "%s: Could not generate md4 hash\n", __func__);
168 168
169mdfour_err: 169mdfour_err:
170 crypto_free_shash(md4); 170 crypto_free_shash(md4);
@@ -238,7 +238,8 @@ SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24,
238 238
239 rc = E_md4hash(passwd, p16, codepage); 239 rc = E_md4hash(passwd, p16, codepage);
240 if (rc) { 240 if (rc) {
241 cFYI(1, "%s Can't generate NT hash, error: %d", __func__, rc); 241 cifs_dbg(FYI, "%s Can't generate NT hash, error: %d\n",
242 __func__, rc);
242 return rc; 243 return rc;
243 } 244 }
244 memcpy(p21, p16, 16); 245 memcpy(p21, p16, 16);
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 1a528680ec5a..cf8bf69bd60c 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -49,7 +49,7 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
49 struct mid_q_entry *temp; 49 struct mid_q_entry *temp;
50 50
51 if (server == NULL) { 51 if (server == NULL) {
52 cERROR(1, "Null TCP session in AllocMidQEntry"); 52 cifs_dbg(VFS, "Null TCP session in AllocMidQEntry\n");
53 return NULL; 53 return NULL;
54 } 54 }
55 55
@@ -61,7 +61,7 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
61 temp->mid = smb_buffer->Mid; /* always LE */ 61 temp->mid = smb_buffer->Mid; /* always LE */
62 temp->pid = current->pid; 62 temp->pid = current->pid;
63 temp->command = cpu_to_le16(smb_buffer->Command); 63 temp->command = cpu_to_le16(smb_buffer->Command);
64 cFYI(1, "For smb_command %d", smb_buffer->Command); 64 cifs_dbg(FYI, "For smb_command %d\n", smb_buffer->Command);
65 /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ 65 /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */
66 /* when mid allocated can be before when sent */ 66 /* when mid allocated can be before when sent */
67 temp->when_alloc = jiffies; 67 temp->when_alloc = jiffies;
@@ -188,8 +188,8 @@ smb_send_kvec(struct TCP_Server_Info *server, struct kvec *iov, size_t n_vec,
188 WARN_ON_ONCE(rc == -ENOSPC); 188 WARN_ON_ONCE(rc == -ENOSPC);
189 i++; 189 i++;
190 if (i >= 14 || (!server->noblocksnd && (i > 2))) { 190 if (i >= 14 || (!server->noblocksnd && (i > 2))) {
191 cERROR(1, "sends on sock %p stuck for 15 " 191 cifs_dbg(VFS, "sends on sock %p stuck for 15 seconds\n",
192 "seconds", ssocket); 192 ssocket);
193 rc = -EAGAIN; 193 rc = -EAGAIN;
194 break; 194 break;
195 } 195 }
@@ -209,14 +209,14 @@ smb_send_kvec(struct TCP_Server_Info *server, struct kvec *iov, size_t n_vec,
209 } 209 }
210 210
211 if (rc > remaining) { 211 if (rc > remaining) {
212 cERROR(1, "sent %d requested %d", rc, remaining); 212 cifs_dbg(VFS, "sent %d requested %d\n", rc, remaining);
213 break; 213 break;
214 } 214 }
215 215
216 if (rc == 0) { 216 if (rc == 0) {
217 /* should never happen, letting socket clear before 217 /* should never happen, letting socket clear before
218 retrying is our only obvious option here */ 218 retrying is our only obvious option here */
219 cERROR(1, "tcp sent no data"); 219 cifs_dbg(VFS, "tcp sent no data\n");
220 msleep(500); 220 msleep(500);
221 continue; 221 continue;
222 } 222 }
@@ -291,7 +291,7 @@ smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst)
291 if (ssocket == NULL) 291 if (ssocket == NULL)
292 return -ENOTSOCK; 292 return -ENOTSOCK;
293 293
294 cFYI(1, "Sending smb: smb_len=%u", smb_buf_length); 294 cifs_dbg(FYI, "Sending smb: smb_len=%u\n", smb_buf_length);
295 dump_smb(iov[0].iov_base, iov[0].iov_len); 295 dump_smb(iov[0].iov_base, iov[0].iov_len);
296 296
297 /* cork the socket */ 297 /* cork the socket */
@@ -324,8 +324,8 @@ uncork:
324 (char *)&val, sizeof(val)); 324 (char *)&val, sizeof(val));
325 325
326 if ((total_len > 0) && (total_len != smb_buf_length + 4)) { 326 if ((total_len > 0) && (total_len != smb_buf_length + 4)) {
327 cFYI(1, "partial send (wanted=%u sent=%zu): terminating " 327 cifs_dbg(FYI, "partial send (wanted=%u sent=%zu): terminating session\n",
328 "session", smb_buf_length + 4, total_len); 328 smb_buf_length + 4, total_len);
329 /* 329 /*
330 * If we have only sent part of an SMB then the next SMB could 330 * If we have only sent part of an SMB then the next SMB could
331 * be taken as the remainder of this one. We need to kill the 331 * be taken as the remainder of this one. We need to kill the
@@ -335,7 +335,8 @@ uncork:
335 } 335 }
336 336
337 if (rc < 0 && rc != -EINTR) 337 if (rc < 0 && rc != -EINTR)
338 cERROR(1, "Error %d sending data on socket to server", rc); 338 cifs_dbg(VFS, "Error %d sending data on socket to server\n",
339 rc);
339 else 340 else
340 rc = 0; 341 rc = 0;
341 342
@@ -427,7 +428,7 @@ static int allocate_mid(struct cifs_ses *ses, struct smb_hdr *in_buf,
427 } 428 }
428 429
429 if (ses->server->tcpStatus == CifsNeedReconnect) { 430 if (ses->server->tcpStatus == CifsNeedReconnect) {
430 cFYI(1, "tcp session dead - return to caller to retry"); 431 cifs_dbg(FYI, "tcp session dead - return to caller to retry\n");
431 return -EAGAIN; 432 return -EAGAIN;
432 } 433 }
433 434
@@ -559,7 +560,7 @@ SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
559 iov[0].iov_len = get_rfc1002_length(in_buf) + 4; 560 iov[0].iov_len = get_rfc1002_length(in_buf) + 4;
560 flags |= CIFS_NO_RESP; 561 flags |= CIFS_NO_RESP;
561 rc = SendReceive2(xid, ses, iov, 1, &resp_buf_type, flags); 562 rc = SendReceive2(xid, ses, iov, 1, &resp_buf_type, flags);
562 cFYI(DBG2, "SendRcvNoRsp flags %d rc %d", flags, rc); 563 cifs_dbg(NOISY, "SendRcvNoRsp flags %d rc %d\n", flags, rc);
563 564
564 return rc; 565 return rc;
565} 566}
@@ -569,8 +570,8 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
569{ 570{
570 int rc = 0; 571 int rc = 0;
571 572
572 cFYI(1, "%s: cmd=%d mid=%llu state=%d", __func__, 573 cifs_dbg(FYI, "%s: cmd=%d mid=%llu state=%d\n",
573 le16_to_cpu(mid->command), mid->mid, mid->mid_state); 574 __func__, le16_to_cpu(mid->command), mid->mid, mid->mid_state);
574 575
575 spin_lock(&GlobalMid_Lock); 576 spin_lock(&GlobalMid_Lock);
576 switch (mid->mid_state) { 577 switch (mid->mid_state) {
@@ -588,8 +589,8 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
588 break; 589 break;
589 default: 590 default:
590 list_del_init(&mid->qhead); 591 list_del_init(&mid->qhead);
591 cERROR(1, "%s: invalid mid state mid=%llu state=%d", __func__, 592 cifs_dbg(VFS, "%s: invalid mid state mid=%llu state=%d\n",
592 mid->mid, mid->mid_state); 593 __func__, mid->mid, mid->mid_state);
593 rc = -EIO; 594 rc = -EIO;
594 } 595 }
595 spin_unlock(&GlobalMid_Lock); 596 spin_unlock(&GlobalMid_Lock);
@@ -626,8 +627,8 @@ cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
626 rc = cifs_verify_signature(&rqst, server, 627 rc = cifs_verify_signature(&rqst, server,
627 mid->sequence_number + 1); 628 mid->sequence_number + 1);
628 if (rc) 629 if (rc)
629 cERROR(1, "SMB signature verification returned error = " 630 cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
630 "%d", rc); 631 rc);
631 } 632 }
632 633
633 /* BB special case reconnect tid and uid here? */ 634 /* BB special case reconnect tid and uid here? */
@@ -672,7 +673,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
672 673
673 if ((ses == NULL) || (ses->server == NULL)) { 674 if ((ses == NULL) || (ses->server == NULL)) {
674 cifs_small_buf_release(buf); 675 cifs_small_buf_release(buf);
675 cERROR(1, "Null session"); 676 cifs_dbg(VFS, "Null session\n");
676 return -EIO; 677 return -EIO;
677 } 678 }
678 679
@@ -752,7 +753,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
752 753
753 if (!midQ->resp_buf || midQ->mid_state != MID_RESPONSE_RECEIVED) { 754 if (!midQ->resp_buf || midQ->mid_state != MID_RESPONSE_RECEIVED) {
754 rc = -EIO; 755 rc = -EIO;
755 cFYI(1, "Bad MID state?"); 756 cifs_dbg(FYI, "Bad MID state?\n");
756 goto out; 757 goto out;
757 } 758 }
758 759
@@ -788,11 +789,11 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
788 struct mid_q_entry *midQ; 789 struct mid_q_entry *midQ;
789 790
790 if (ses == NULL) { 791 if (ses == NULL) {
791 cERROR(1, "Null smb session"); 792 cifs_dbg(VFS, "Null smb session\n");
792 return -EIO; 793 return -EIO;
793 } 794 }
794 if (ses->server == NULL) { 795 if (ses->server == NULL) {
795 cERROR(1, "Null tcp session"); 796 cifs_dbg(VFS, "Null tcp session\n");
796 return -EIO; 797 return -EIO;
797 } 798 }
798 799
@@ -805,8 +806,8 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
805 806
806 if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize + 807 if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize +
807 MAX_CIFS_HDR_SIZE - 4) { 808 MAX_CIFS_HDR_SIZE - 4) {
808 cERROR(1, "Illegal length, greater than maximum frame, %d", 809 cifs_dbg(VFS, "Illegal length, greater than maximum frame, %d\n",
809 be32_to_cpu(in_buf->smb_buf_length)); 810 be32_to_cpu(in_buf->smb_buf_length));
810 return -EIO; 811 return -EIO;
811 } 812 }
812 813
@@ -871,7 +872,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
871 if (!midQ->resp_buf || !out_buf || 872 if (!midQ->resp_buf || !out_buf ||
872 midQ->mid_state != MID_RESPONSE_RECEIVED) { 873 midQ->mid_state != MID_RESPONSE_RECEIVED) {
873 rc = -EIO; 874 rc = -EIO;
874 cERROR(1, "Bad MID state?"); 875 cifs_dbg(VFS, "Bad MID state?\n");
875 goto out; 876 goto out;
876 } 877 }
877 878
@@ -921,13 +922,13 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
921 struct cifs_ses *ses; 922 struct cifs_ses *ses;
922 923
923 if (tcon == NULL || tcon->ses == NULL) { 924 if (tcon == NULL || tcon->ses == NULL) {
924 cERROR(1, "Null smb session"); 925 cifs_dbg(VFS, "Null smb session\n");
925 return -EIO; 926 return -EIO;
926 } 927 }
927 ses = tcon->ses; 928 ses = tcon->ses;
928 929
929 if (ses->server == NULL) { 930 if (ses->server == NULL) {
930 cERROR(1, "Null tcp session"); 931 cifs_dbg(VFS, "Null tcp session\n");
931 return -EIO; 932 return -EIO;
932 } 933 }
933 934
@@ -940,8 +941,8 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
940 941
941 if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize + 942 if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize +
942 MAX_CIFS_HDR_SIZE - 4) { 943 MAX_CIFS_HDR_SIZE - 4) {
943 cERROR(1, "Illegal length, greater than maximum frame, %d", 944 cifs_dbg(VFS, "Illegal length, greater than maximum frame, %d\n",
944 be32_to_cpu(in_buf->smb_buf_length)); 945 be32_to_cpu(in_buf->smb_buf_length));
945 return -EIO; 946 return -EIO;
946 } 947 }
947 948
@@ -1038,7 +1039,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
1038 /* rcvd frame is ok */ 1039 /* rcvd frame is ok */
1039 if (out_buf == NULL || midQ->mid_state != MID_RESPONSE_RECEIVED) { 1040 if (out_buf == NULL || midQ->mid_state != MID_RESPONSE_RECEIVED) {
1040 rc = -EIO; 1041 rc = -EIO;
1041 cERROR(1, "Bad MID state?"); 1042 cifs_dbg(VFS, "Bad MID state?\n");
1042 goto out; 1043 goto out;
1043 } 1044 }
1044 1045
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 5142f2c60278..09afda4cc58e 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -68,12 +68,12 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
68 goto remove_ea_exit; 68 goto remove_ea_exit;
69 } 69 }
70 if (ea_name == NULL) { 70 if (ea_name == NULL) {
71 cFYI(1, "Null xattr names not supported"); 71 cifs_dbg(FYI, "Null xattr names not supported\n");
72 } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) 72 } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)
73 && (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))) { 73 && (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))) {
74 cFYI(1, 74 cifs_dbg(FYI,
75 "illegal xattr request %s (only user namespace supported)", 75 "illegal xattr request %s (only user namespace supported)\n",
76 ea_name); 76 ea_name);
77 /* BB what if no namespace prefix? */ 77 /* BB what if no namespace prefix? */
78 /* Should we just pass them to server, except for 78 /* Should we just pass them to server, except for
79 system and perhaps security prefixes? */ 79 system and perhaps security prefixes? */
@@ -134,19 +134,19 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
134 search server for EAs or streams to 134 search server for EAs or streams to
135 returns as xattrs */ 135 returns as xattrs */
136 if (value_size > MAX_EA_VALUE_SIZE) { 136 if (value_size > MAX_EA_VALUE_SIZE) {
137 cFYI(1, "size of EA value too large"); 137 cifs_dbg(FYI, "size of EA value too large\n");
138 rc = -EOPNOTSUPP; 138 rc = -EOPNOTSUPP;
139 goto set_ea_exit; 139 goto set_ea_exit;
140 } 140 }
141 141
142 if (ea_name == NULL) { 142 if (ea_name == NULL) {
143 cFYI(1, "Null xattr names not supported"); 143 cifs_dbg(FYI, "Null xattr names not supported\n");
144 } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) 144 } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)
145 == 0) { 145 == 0) {
146 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) 146 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
147 goto set_ea_exit; 147 goto set_ea_exit;
148 if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) 148 if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0)
149 cFYI(1, "attempt to set cifs inode metadata"); 149 cifs_dbg(FYI, "attempt to set cifs inode metadata\n");
150 150
151 ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */ 151 ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
152 rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value, 152 rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
@@ -167,8 +167,6 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
167 struct cifs_ntsd *pacl; 167 struct cifs_ntsd *pacl;
168 pacl = kmalloc(value_size, GFP_KERNEL); 168 pacl = kmalloc(value_size, GFP_KERNEL);
169 if (!pacl) { 169 if (!pacl) {
170 cFYI(1, "%s: Can't allocate memory for ACL",
171 __func__);
172 rc = -ENOMEM; 170 rc = -ENOMEM;
173 } else { 171 } else {
174 memcpy(pacl, ea_value, value_size); 172 memcpy(pacl, ea_value, value_size);
@@ -179,7 +177,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
179 kfree(pacl); 177 kfree(pacl);
180 } 178 }
181#else 179#else
182 cFYI(1, "Set CIFS ACL not supported yet"); 180 cifs_dbg(FYI, "Set CIFS ACL not supported yet\n");
183#endif /* CONFIG_CIFS_ACL */ 181#endif /* CONFIG_CIFS_ACL */
184 } else { 182 } else {
185 int temp; 183 int temp;
@@ -193,9 +191,9 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
193 ACL_TYPE_ACCESS, cifs_sb->local_nls, 191 ACL_TYPE_ACCESS, cifs_sb->local_nls,
194 cifs_sb->mnt_cifs_flags & 192 cifs_sb->mnt_cifs_flags &
195 CIFS_MOUNT_MAP_SPECIAL_CHR); 193 CIFS_MOUNT_MAP_SPECIAL_CHR);
196 cFYI(1, "set POSIX ACL rc %d", rc); 194 cifs_dbg(FYI, "set POSIX ACL rc %d\n", rc);
197#else 195#else
198 cFYI(1, "set POSIX ACL not supported"); 196 cifs_dbg(FYI, "set POSIX ACL not supported\n");
199#endif 197#endif
200 } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, 198 } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT,
201 strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { 199 strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) {
@@ -206,13 +204,13 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
206 ACL_TYPE_DEFAULT, cifs_sb->local_nls, 204 ACL_TYPE_DEFAULT, cifs_sb->local_nls,
207 cifs_sb->mnt_cifs_flags & 205 cifs_sb->mnt_cifs_flags &
208 CIFS_MOUNT_MAP_SPECIAL_CHR); 206 CIFS_MOUNT_MAP_SPECIAL_CHR);
209 cFYI(1, "set POSIX default ACL rc %d", rc); 207 cifs_dbg(FYI, "set POSIX default ACL rc %d\n", rc);
210#else 208#else
211 cFYI(1, "set default POSIX ACL not supported"); 209 cifs_dbg(FYI, "set default POSIX ACL not supported\n");
212#endif 210#endif
213 } else { 211 } else {
214 cFYI(1, "illegal xattr request %s (only user namespace" 212 cifs_dbg(FYI, "illegal xattr request %s (only user namespace supported)\n",
215 " supported)", ea_name); 213 ea_name);
216 /* BB what if no namespace prefix? */ 214 /* BB what if no namespace prefix? */
217 /* Should we just pass them to server, except for 215 /* Should we just pass them to server, except for
218 system and perhaps security prefixes? */ 216 system and perhaps security prefixes? */
@@ -263,14 +261,14 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
263 /* return dos attributes as pseudo xattr */ 261 /* return dos attributes as pseudo xattr */
264 /* return alt name if available as pseudo attr */ 262 /* return alt name if available as pseudo attr */
265 if (ea_name == NULL) { 263 if (ea_name == NULL) {
266 cFYI(1, "Null xattr names not supported"); 264 cifs_dbg(FYI, "Null xattr names not supported\n");
267 } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) 265 } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)
268 == 0) { 266 == 0) {
269 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) 267 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
270 goto get_ea_exit; 268 goto get_ea_exit;
271 269
272 if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) { 270 if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) {
273 cFYI(1, "attempt to query cifs inode metadata"); 271 cifs_dbg(FYI, "attempt to query cifs inode metadata\n");
274 /* revalidate/getattr then populate from inode */ 272 /* revalidate/getattr then populate from inode */
275 } /* BB add else when above is implemented */ 273 } /* BB add else when above is implemented */
276 ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */ 274 ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
@@ -295,7 +293,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
295 cifs_sb->mnt_cifs_flags & 293 cifs_sb->mnt_cifs_flags &
296 CIFS_MOUNT_MAP_SPECIAL_CHR); 294 CIFS_MOUNT_MAP_SPECIAL_CHR);
297#else 295#else
298 cFYI(1, "Query POSIX ACL not supported yet"); 296 cifs_dbg(FYI, "Query POSIX ACL not supported yet\n");
299#endif /* CONFIG_CIFS_POSIX */ 297#endif /* CONFIG_CIFS_POSIX */
300 } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, 298 } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT,
301 strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { 299 strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) {
@@ -307,7 +305,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
307 cifs_sb->mnt_cifs_flags & 305 cifs_sb->mnt_cifs_flags &
308 CIFS_MOUNT_MAP_SPECIAL_CHR); 306 CIFS_MOUNT_MAP_SPECIAL_CHR);
309#else 307#else
310 cFYI(1, "Query POSIX default ACL not supported yet"); 308 cifs_dbg(FYI, "Query POSIX default ACL not supported yet\n");
311#endif /* CONFIG_CIFS_POSIX */ 309#endif /* CONFIG_CIFS_POSIX */
312 } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL, 310 } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL,
313 strlen(CIFS_XATTR_CIFS_ACL)) == 0) { 311 strlen(CIFS_XATTR_CIFS_ACL)) == 0) {
@@ -319,8 +317,8 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
319 full_path, &acllen); 317 full_path, &acllen);
320 if (IS_ERR(pacl)) { 318 if (IS_ERR(pacl)) {
321 rc = PTR_ERR(pacl); 319 rc = PTR_ERR(pacl);
322 cERROR(1, "%s: error %zd getting sec desc", 320 cifs_dbg(VFS, "%s: error %zd getting sec desc\n",
323 __func__, rc); 321 __func__, rc);
324 } else { 322 } else {
325 if (ea_value) { 323 if (ea_value) {
326 if (acllen > buf_size) 324 if (acllen > buf_size)
@@ -332,18 +330,18 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
332 kfree(pacl); 330 kfree(pacl);
333 } 331 }
334#else 332#else
335 cFYI(1, "Query CIFS ACL not supported yet"); 333 cifs_dbg(FYI, "Query CIFS ACL not supported yet\n");
336#endif /* CONFIG_CIFS_ACL */ 334#endif /* CONFIG_CIFS_ACL */
337 } else if (strncmp(ea_name, 335 } else if (strncmp(ea_name,
338 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) { 336 XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) {
339 cFYI(1, "Trusted xattr namespace not supported yet"); 337 cifs_dbg(FYI, "Trusted xattr namespace not supported yet\n");
340 } else if (strncmp(ea_name, 338 } else if (strncmp(ea_name,
341 XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) { 339 XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) {
342 cFYI(1, "Security xattr namespace not supported yet"); 340 cifs_dbg(FYI, "Security xattr namespace not supported yet\n");
343 } else 341 } else
344 cFYI(1, 342 cifs_dbg(FYI,
345 "illegal xattr request %s (only user namespace supported)", 343 "illegal xattr request %s (only user namespace supported)\n",
346 ea_name); 344 ea_name);
347 345
348 /* We could add an additional check for streams ie 346 /* We could add an additional check for streams ie
349 if proc/fs/cifs/streamstoxattr is set then 347 if proc/fs/cifs/streamstoxattr is set then