Commit 2e378f3e authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6

Pull CIFS fixes from Steve French:
 "A set of cifs cleanup fixes.

  The only big one of this set optimizes the cifs error logging,
  renaming cFYI and cERROR macros to cifs_dbg, and in the process makes
  it clearer and reduces module size."

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: small variable name cleanup
  CIFS: fix error return code in cifs_atomic_open()
  cifs: store the real expected sequence number in the mid
  cifs: on send failure, readjust server sequence number downward
  cifs: remove ENOSPC handling in smb_sendv
  [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg
  fs: cifs: use kmemdup instead of kmalloc + memcpy
  cifs: replaced kmalloc + memset with kzalloc
  cifs: ignore the unc= and prefixpath= mount options
parents ce8a5dbd b13ce4bb
...@@ -506,11 +506,11 @@ decode_negTokenInit(unsigned char *security_blob, int length, ...@@ -506,11 +506,11 @@ decode_negTokenInit(unsigned char *security_blob, int length,
/* GSSAPI header */ /* GSSAPI header */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding negTokenInit header"); cifs_dbg(FYI, "Error decoding negTokenInit header\n");
return 0; return 0;
} else if ((cls != ASN1_APL) || (con != ASN1_CON) } else if ((cls != ASN1_APL) || (con != ASN1_CON)
|| (tag != ASN1_EOC)) { || (tag != ASN1_EOC)) {
cFYI(1, "cls = %d con = %d tag = %d", cls, con, tag); cifs_dbg(FYI, "cls = %d con = %d tag = %d\n", cls, con, tag);
return 0; return 0;
} }
...@@ -531,52 +531,52 @@ decode_negTokenInit(unsigned char *security_blob, int length, ...@@ -531,52 +531,52 @@ decode_negTokenInit(unsigned char *security_blob, int length,
/* SPNEGO OID not present or garbled -- bail out */ /* SPNEGO OID not present or garbled -- bail out */
if (!rc) { if (!rc) {
cFYI(1, "Error decoding negTokenInit header"); cifs_dbg(FYI, "Error decoding negTokenInit header\n");
return 0; return 0;
} }
/* SPNEGO */ /* SPNEGO */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding negTokenInit"); cifs_dbg(FYI, "Error decoding negTokenInit\n");
return 0; return 0;
} else if ((cls != ASN1_CTX) || (con != ASN1_CON) } else if ((cls != ASN1_CTX) || (con != ASN1_CON)
|| (tag != ASN1_EOC)) { || (tag != ASN1_EOC)) {
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0", cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
cls, con, tag, end, *end); cls, con, tag, end, *end);
return 0; return 0;
} }
/* negTokenInit */ /* negTokenInit */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding negTokenInit"); cifs_dbg(FYI, "Error decoding negTokenInit\n");
return 0; return 0;
} else if ((cls != ASN1_UNI) || (con != ASN1_CON) } else if ((cls != ASN1_UNI) || (con != ASN1_CON)
|| (tag != ASN1_SEQ)) { || (tag != ASN1_SEQ)) {
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1", cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
cls, con, tag, end, *end); cls, con, tag, end, *end);
return 0; return 0;
} }
/* sequence */ /* sequence */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding 2nd part of negTokenInit"); cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n");
return 0; return 0;
} else if ((cls != ASN1_CTX) || (con != ASN1_CON) } else if ((cls != ASN1_CTX) || (con != ASN1_CON)
|| (tag != ASN1_EOC)) { || (tag != ASN1_EOC)) {
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0", cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
cls, con, tag, end, *end); cls, con, tag, end, *end);
return 0; return 0;
} }
/* sequence of */ /* sequence of */
if (asn1_header_decode if (asn1_header_decode
(&ctx, &sequence_end, &cls, &con, &tag) == 0) { (&ctx, &sequence_end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding 2nd part of negTokenInit"); cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n");
return 0; return 0;
} else if ((cls != ASN1_UNI) || (con != ASN1_CON) } else if ((cls != ASN1_UNI) || (con != ASN1_CON)
|| (tag != ASN1_SEQ)) { || (tag != ASN1_SEQ)) {
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1", cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
cls, con, tag, end, *end); cls, con, tag, end, *end);
return 0; return 0;
} }
...@@ -584,15 +584,15 @@ decode_negTokenInit(unsigned char *security_blob, int length, ...@@ -584,15 +584,15 @@ decode_negTokenInit(unsigned char *security_blob, int length,
while (!asn1_eoc_decode(&ctx, sequence_end)) { while (!asn1_eoc_decode(&ctx, sequence_end)) {
rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag); rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag);
if (!rc) { if (!rc) {
cFYI(1, "Error decoding negTokenInit hdr exit2"); cifs_dbg(FYI, "Error decoding negTokenInit hdr exit2\n");
return 0; return 0;
} }
if ((tag == ASN1_OJI) && (con == ASN1_PRI)) { if ((tag == ASN1_OJI) && (con == ASN1_PRI)) {
if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) { if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) {
cFYI(1, "OID len = %d oid = 0x%lx 0x%lx " cifs_dbg(FYI, "OID len = %d oid = 0x%lx 0x%lx 0x%lx 0x%lx\n",
"0x%lx 0x%lx", oidlen, *oid, oidlen, *oid, *(oid + 1), *(oid + 2),
*(oid + 1), *(oid + 2), *(oid + 3)); *(oid + 3));
if (compare_oid(oid, oidlen, MSKRB5_OID, if (compare_oid(oid, oidlen, MSKRB5_OID,
MSKRB5_OID_LEN)) MSKRB5_OID_LEN))
...@@ -610,7 +610,7 @@ decode_negTokenInit(unsigned char *security_blob, int length, ...@@ -610,7 +610,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
kfree(oid); kfree(oid);
} }
} else { } else {
cFYI(1, "Should be an oid what is going on?"); cifs_dbg(FYI, "Should be an oid what is going on?\n");
} }
} }
......
...@@ -92,7 +92,7 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data, ...@@ -92,7 +92,7 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data,
break; break;
default: default:
cERROR(1, "Unknown network family '%d'", sa->sa_family); cifs_dbg(VFS, "Unknown network family '%d'\n", sa->sa_family);
key_len = 0; key_len = 0;
break; break;
} }
...@@ -152,7 +152,7 @@ static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer, ...@@ -152,7 +152,7 @@ static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer,
sharename = extract_sharename(tcon->treeName); sharename = extract_sharename(tcon->treeName);
if (IS_ERR(sharename)) { if (IS_ERR(sharename)) {
cFYI(1, "%s: couldn't extract sharename", __func__); cifs_dbg(FYI, "%s: couldn't extract sharename\n", __func__);
sharename = NULL; sharename = NULL;
return 0; return 0;
} }
...@@ -302,7 +302,7 @@ static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data) ...@@ -302,7 +302,7 @@ static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data)
pagevec_init(&pvec, 0); pagevec_init(&pvec, 0);
first = 0; first = 0;
cFYI(1, "%s: cifs inode 0x%p now uncached", __func__, cifsi); cifs_dbg(FYI, "%s: cifs inode 0x%p now uncached\n", __func__, cifsi);
for (;;) { for (;;) {
nr_pages = pagevec_lookup(&pvec, nr_pages = pagevec_lookup(&pvec,
......
...@@ -57,15 +57,32 @@ cifs_dump_mem(char *label, void *data, int length) ...@@ -57,15 +57,32 @@ cifs_dump_mem(char *label, void *data, int length)
} }
} }
#ifdef CONFIG_CIFS_DEBUG
void cifs_vfs_err(const char *fmt, ...)
{
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
printk(KERN_ERR "CIFS VFS: %pV", &vaf);
va_end(args);
}
#endif
void cifs_dump_detail(void *buf) void cifs_dump_detail(void *buf)
{ {
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
struct smb_hdr *smb = (struct smb_hdr *)buf; struct smb_hdr *smb = (struct smb_hdr *)buf;
cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d\n",
smb->Command, smb->Status.CifsError, smb->Command, smb->Status.CifsError,
smb->Flags, smb->Flags2, smb->Mid, smb->Pid); smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
cERROR(1, "smb buf %p len %u", smb, smbCalcSize(smb)); cifs_dbg(VFS, "smb buf %p len %u\n", smb, smbCalcSize(smb));
#endif /* CONFIG_CIFS_DEBUG2 */ #endif /* CONFIG_CIFS_DEBUG2 */
} }
...@@ -78,25 +95,25 @@ void cifs_dump_mids(struct TCP_Server_Info *server) ...@@ -78,25 +95,25 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
if (server == NULL) if (server == NULL)
return; return;
cERROR(1, "Dump pending requests:"); cifs_dbg(VFS, "Dump pending requests:\n");
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
list_for_each(tmp, &server->pending_mid_q) { list_for_each(tmp, &server->pending_mid_q) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu", cifs_dbg(VFS, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu\n",
mid_entry->mid_state, mid_entry->mid_state,
le16_to_cpu(mid_entry->command), le16_to_cpu(mid_entry->command),
mid_entry->pid, mid_entry->pid,
mid_entry->callback_data, mid_entry->callback_data,
mid_entry->mid); mid_entry->mid);
#ifdef CONFIG_CIFS_STATS2 #ifdef CONFIG_CIFS_STATS2
cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld", cifs_dbg(VFS, "IsLarge: %d buf: %p time rcv: %ld now: %ld\n",
mid_entry->large_buf, mid_entry->large_buf,
mid_entry->resp_buf, mid_entry->resp_buf,
mid_entry->when_received, mid_entry->when_received,
jiffies); jiffies);
#endif /* STATS2 */ #endif /* STATS2 */
cERROR(1, "IsMult: %d IsEnd: %d", mid_entry->multiRsp, cifs_dbg(VFS, "IsMult: %d IsEnd: %d\n",
mid_entry->multiEnd); mid_entry->multiRsp, mid_entry->multiEnd);
if (mid_entry->resp_buf) { if (mid_entry->resp_buf) {
cifs_dump_detail(mid_entry->resp_buf); cifs_dump_detail(mid_entry->resp_buf);
cifs_dump_mem("existing buf: ", cifs_dump_mem("existing buf: ",
...@@ -603,7 +620,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file, ...@@ -603,7 +620,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
global_secflags = CIFSSEC_MAX; global_secflags = CIFSSEC_MAX;
return count; return count;
} else if (!isdigit(c)) { } else if (!isdigit(c)) {
cERROR(1, "invalid flag %c", c); cifs_dbg(VFS, "invalid flag %c\n", c);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -611,16 +628,16 @@ static ssize_t cifs_security_flags_proc_write(struct file *file, ...@@ -611,16 +628,16 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
flags = simple_strtoul(flags_string, NULL, 0); flags = simple_strtoul(flags_string, NULL, 0);
cFYI(1, "sec flags 0x%x", flags); cifs_dbg(FYI, "sec flags 0x%x\n", flags);
if (flags <= 0) { if (flags <= 0) {
cERROR(1, "invalid security flags %s", flags_string); cifs_dbg(VFS, "invalid security flags %s\n", flags_string);
return -EINVAL; return -EINVAL;
} }
if (flags & ~CIFSSEC_MASK) { if (flags & ~CIFSSEC_MASK) {
cERROR(1, "attempt to set unsupported security flags 0x%x", cifs_dbg(VFS, "attempt to set unsupported security flags 0x%x\n",
flags & ~CIFSSEC_MASK); flags & ~CIFSSEC_MASK);
return -EINVAL; return -EINVAL;
} }
/* flags look ok - update the global security flags for cifs module */ /* 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,9 +645,9 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
if (global_secflags & CIFSSEC_MUST_SIGN) { if (global_secflags & CIFSSEC_MUST_SIGN) {
/* requiring signing implies signing is allowed */ /* requiring signing implies signing is allowed */
global_secflags |= CIFSSEC_MAY_SIGN; global_secflags |= CIFSSEC_MAY_SIGN;
cFYI(1, "packet signing now required"); cifs_dbg(FYI, "packet signing now required\n");
} else if ((global_secflags & CIFSSEC_MAY_SIGN) == 0) { } else if ((global_secflags & CIFSSEC_MAY_SIGN) == 0) {
cFYI(1, "packet signing disabled"); cifs_dbg(FYI, "packet signing disabled\n");
} }
/* BB should we turn on MAY flags for other MUST options? */ /* BB should we turn on MAY flags for other MUST options? */
return count; return count;
......
...@@ -25,18 +25,20 @@ ...@@ -25,18 +25,20 @@
void cifs_dump_mem(char *label, void *data, int length); void cifs_dump_mem(char *label, void *data, int length);
void cifs_dump_detail(void *); void cifs_dump_detail(void *);
void cifs_dump_mids(struct TCP_Server_Info *); void cifs_dump_mids(struct TCP_Server_Info *);
#ifdef CONFIG_CIFS_DEBUG2
#define DBG2 2
#else
#define DBG2 0
#endif
extern int traceSMB; /* flag which enables the function below */ extern int traceSMB; /* flag which enables the function below */
void dump_smb(void *, int); void dump_smb(void *, int);
#define CIFS_INFO 0x01 #define CIFS_INFO 0x01
#define CIFS_RC 0x02 #define CIFS_RC 0x02
#define CIFS_TIMER 0x04 #define CIFS_TIMER 0x04
#define VFS 1
#define FYI 2
extern int cifsFYI; extern int cifsFYI;
#ifdef CONFIG_CIFS_DEBUG2
#define NOISY 4
#else
#define NOISY 0
#endif
/* /*
* debug ON * debug ON
...@@ -44,31 +46,21 @@ extern int cifsFYI; ...@@ -44,31 +46,21 @@ extern int cifsFYI;
*/ */
#ifdef CONFIG_CIFS_DEBUG #ifdef CONFIG_CIFS_DEBUG
/* information message: e.g., configuration, major event */ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
#define cifsfyi(fmt, ...) \
do { \
if (cifsFYI & CIFS_INFO) \
printk(KERN_DEBUG "%s: " fmt "\n", \
__FILE__, ##__VA_ARGS__); \
} while (0)
#define cFYI(set, fmt, ...) \
do { \
if (set) \
cifsfyi(fmt, ##__VA_ARGS__); \
} while (0)
#define cifswarn(fmt, ...) \ /* information message: e.g., configuration, major event */
printk(KERN_WARNING fmt "\n", ##__VA_ARGS__) #define cifs_dbg(type, fmt, ...) \
/* error event message: e.g., i/o error */
#define cifserror(fmt, ...) \
printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
#define cERROR(set, fmt, ...) \
do { \ do { \
if (set) \ if (type == FYI) { \
cifserror(fmt, ##__VA_ARGS__); \ if (cifsFYI & CIFS_INFO) { \
printk(KERN_DEBUG "%s: " fmt, \
__FILE__, ##__VA_ARGS__); \
} \
} else if (type == VFS) { \
cifs_vfs_err(fmt, ##__VA_ARGS__); \
} else if (type == NOISY && type != 0) { \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
} \
} while (0) } while (0)
/* /*
...@@ -76,27 +68,11 @@ do { \ ...@@ -76,27 +68,11 @@ do { \
* --------- * ---------
*/ */
#else /* _CIFS_DEBUG */ #else /* _CIFS_DEBUG */
#define cifsfyi(fmt, ...) \ #define cifs_dbg(type, fmt, ...) \
do { \ do { \
if (0) \ if (0) \
printk(KERN_DEBUG "%s: " fmt "\n", \ printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
__FILE__, ##__VA_ARGS__); \
} while (0) } while (0)
#define cFYI(set, fmt, ...) \ #endif
do { \
if (0 && set) \
cifsfyi(fmt, ##__VA_ARGS__); \
} while (0)
#define cifserror(fmt, ...) \
do { \
if (0) \
printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
} while (0)
#define cERROR(set, fmt, ...) \
do { \
if (0 && set) \
cifserror(fmt, ##__VA_ARGS__); \
} while (0)
#endif /* _CIFS_DEBUG */
#endif /* _H_CIFS_DEBUG */ #endif /* _H_CIFS_DEBUG */
...@@ -84,8 +84,8 @@ static char *cifs_get_share_name(const char *node_name) ...@@ -84,8 +84,8 @@ static char *cifs_get_share_name(const char *node_name)
/* find server name end */ /* find server name end */
pSep = memchr(UNC+2, '\\', len-2); pSep = memchr(UNC+2, '\\', len-2);
if (!pSep) { if (!pSep) {
cERROR(1, "%s: no server name end in node name: %s", cifs_dbg(VFS, "%s: no server name end in node name: %s\n",
__func__, node_name); __func__, node_name);
kfree(UNC); kfree(UNC);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
...@@ -141,8 +141,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata, ...@@ -141,8 +141,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
rc = dns_resolve_server_name_to_ip(*devname, &srvIP); rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
if (rc < 0) { if (rc < 0) {
cFYI(1, "%s: Failed to resolve server part of %s to IP: %d", cifs_dbg(FYI, "%s: Failed to resolve server part of %s to IP: %d\n",
__func__, *devname, rc); __func__, *devname, rc);
goto compose_mount_options_err; goto compose_mount_options_err;
} }
...@@ -216,8 +216,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata, ...@@ -216,8 +216,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
strcat(mountdata, fullpath + ref->path_consumed); strcat(mountdata, fullpath + ref->path_consumed);
} }
/*cFYI(1, "%s: parent mountdata: %s", __func__,sb_mountdata);*/ /*cifs_dbg(FYI, "%s: parent mountdata: %s\n", __func__, sb_mountdata);*/
/*cFYI(1, "%s: submount mountdata: %s", __func__, mountdata );*/ /*cifs_dbg(FYI, "%s: submount mountdata: %s\n", __func__, mountdata );*/
compose_mount_options_out: compose_mount_options_out:
kfree(srvIP); kfree(srvIP);
...@@ -260,11 +260,12 @@ static struct vfsmount *cifs_dfs_do_refmount(struct cifs_sb_info *cifs_sb, ...@@ -260,11 +260,12 @@ static struct vfsmount *cifs_dfs_do_refmount(struct cifs_sb_info *cifs_sb,
static void dump_referral(const struct dfs_info3_param *ref) static void dump_referral(const struct dfs_info3_param *ref)
{ {
cFYI(1, "DFS: ref path: %s", ref->path_name); cifs_dbg(FYI, "DFS: ref path: %s\n", ref->path_name);
cFYI(1, "DFS: node path: %s", ref->node_name); cifs_dbg(FYI, "DFS: node path: %s\n", ref->node_name);
cFYI(1, "DFS: fl: %hd, srv_type: %hd", ref->flags, ref->server_type); cifs_dbg(FYI, "DFS: fl: %hd, srv_type: %hd\n",
cFYI(1, "DFS: ref_flags: %hd, path_consumed: %hd", ref->ref_flag, ref->flags, ref->server_type);
ref->path_consumed); cifs_dbg(FYI, "DFS: ref_flags: %hd, path_consumed: %hd\n",
ref->ref_flag, ref->path_consumed);
} }
/* /*
...@@ -283,7 +284,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) ...@@ -283,7 +284,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
struct vfsmount *mnt; struct vfsmount *mnt;
struct tcon_link *tlink; struct tcon_link *tlink;
cFYI(1, "in %s", __func__); cifs_dbg(FYI, "in %s\n", __func__);
BUG_ON(IS_ROOT(mntpt)); BUG_ON(IS_ROOT(mntpt));
/* /*
...@@ -320,15 +321,15 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) ...@@ -320,15 +321,15 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
/* connect to a node */ /* connect to a node */
len = strlen(referrals[i].node_name); len = strlen(referrals[i].node_name);
if (len < 2) { if (len < 2) {
cERROR(1, "%s: Net Address path too short: %s", cifs_dbg(VFS, "%s: Net Address path too short: %s\n",
__func__, referrals[i].node_name); __func__, referrals[i].node_name);
mnt = ERR_PTR(-EINVAL); mnt = ERR_PTR(-EINVAL);
break; break;
} }
mnt = cifs_dfs_do_refmount(cifs_sb, mnt = cifs_dfs_do_refmount(cifs_sb,
full_path, referrals + i); full_path, referrals + i);
cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, cifs_dbg(FYI, "%s: cifs_dfs_do_refmount:%s , mnt:%p\n",
referrals[i].node_name, mnt); __func__, referrals[i].node_name, mnt);
if (!IS_ERR(mnt)) if (!IS_ERR(mnt))
goto success; goto success;
} }
...@@ -343,7 +344,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) ...@@ -343,7 +344,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
free_full_path: free_full_path:
kfree(full_path); kfree(full_path);
cdda_exit: cdda_exit:
cFYI(1, "leaving %s" , __func__); cifs_dbg(FYI, "leaving %s\n" , __func__);
return mnt; return mnt;
} }
...@@ -354,11 +355,11 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path) ...@@ -354,11 +355,11 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path)
{ {
struct vfsmount *newmnt; struct vfsmount *newmnt;
cFYI(1, "in %s", __func__); cifs_dbg(FYI, "in %s\n", __func__);
newmnt = cifs_dfs_do_automount(path->dentry); newmnt = cifs_dfs_do_automount(path->dentry);
if (IS_ERR(newmnt)) { if (IS_ERR(newmnt)) {
cFYI(1, "leaving %s [automount failed]" , __func__); cifs_dbg(FYI, "leaving %s [automount failed]\n" , __func__);
return newmnt; return newmnt;
} }
...@@ -366,7 +367,7 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path) ...@@ -366,7 +367,7 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path)
mnt_set_expiry(newmnt, &cifs_dfs_automount_list); mnt_set_expiry(newmnt, &cifs_dfs_automount_list);
schedule_delayed_work(&cifs_dfs_automount_task, schedule_delayed_work(&cifs_dfs_automount_task,
cifs_dfs_mountpoint_expiry_timeout); cifs_dfs_mountpoint_expiry_timeout);
cFYI(1, "leaving %s [ok]" , __func__); cifs_dbg(FYI, "leaving %s [ok]\n" , __func__);
return newmnt; return newmnt;
} }
......
...@@ -37,12 +37,11 @@ cifs_spnego_key_instantiate(struct key *key, struct key_preparsed_payload *prep) ...@@ -37,12 +37,11 @@ cifs_spnego_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
int ret; int ret;
ret = -ENOMEM; ret = -ENOMEM;
payload = kmalloc(prep->datalen, GFP_KERNEL); payload = kmemdup(prep->data, prep->datalen, GFP_KERNEL);
if (!payload) if (!payload)
goto error; goto error;
/* attach the data */ /* attach the data */
memcpy(payload, prep->data, prep->datalen);
key->payload.data = payload; key->payload.data = payload;
ret = 0; ret = 0;
...@@ -164,7 +163,7 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo) ...@@ -164,7 +163,7 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
dp = description + strlen(description); dp = description + strlen(description);
sprintf(dp, ";pid=0x%x", current->pid); sprintf(dp, ";pid=0x%x", current->pid);
cFYI(1, "key description = %s", description); cifs_dbg(FYI, "key description = %s\n", description);
spnego_key = request_key(&cifs_spnego_key_type, description, ""); spnego_key = request_key(&cifs_spnego_key_type, description, "");
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
......
...@@ -227,8 +227,8 @@ cifs_strtoUTF16(__le16 *to, const char *from, int len, ...@@ -227,8 +227,8 @@ cifs_strtoUTF16(__le16 *to, const char *from, int len,
for (i = 0; len && *from; i++, from += charlen, len -= charlen) { for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
charlen = codepage->char2uni(from, len, &wchar_to); charlen = codepage->char2uni(from, len, &wchar_to);
if (charlen < 1) { if (charlen < 1) {
cERROR(1, "strtoUTF16: char2uni of 0x%x returned %d", cifs_dbg(VFS, "strtoUTF16: char2uni of 0x%x returned %d\n",
*from, charlen); *from, charlen);
/* A question mark */ /* A question mark */
wchar_to = 0x003f; wchar_to = 0x003f;
charlen = 1; charlen = 1;
......
This diff is collapsed.
This diff is collapsed.
...@@ -161,7 +161,7 @@ cifs_read_super(struct super_block *sb) ...@@ -161,7 +161,7 @@ cifs_read_super(struct super_block *sb)
#ifdef CONFIG_CIFS_NFSD_EXPORT #ifdef CONFIG_CIFS_NFSD_EXPORT
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
cFYI(1, "export ops supported"); cifs_dbg(FYI, "export ops supported\n");
sb->s_export_op = &cifs_export_ops; sb->s_export_op = &cifs_export_ops;
} }
#endif /* CONFIG_CIFS_NFSD_EXPORT */ #endif /* CONFIG_CIFS_NFSD_EXPORT */
...@@ -169,7 +169,7 @@ cifs_read_super(struct super_block *sb) ...@@ -169,7 +169,7 @@ cifs_read_super(struct super_block *sb)
return 0; return 0;
out_no_root: out_no_root:
cERROR(1, "cifs_read_super: get root inode failed"); cifs_dbg(VFS, "%s: get root inode failed\n", __func__);
return rc; return rc;
} }
...@@ -502,7 +502,7 @@ static void cifs_umount_begin(struct super_block *sb) ...@@ -502,7 +502,7 @@ static void cifs_umount_begin(struct super_block *sb)
/* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */ /* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
/* cancel_notify_requests(tcon); */ /* cancel_notify_requests(tcon); */
if (tcon->ses && tcon->ses->server) { if (tcon->ses && tcon->ses->server) {
cFYI(1, "wake up tasks now - umount begin not complete"); cifs_dbg(FYI, "wake up tasks now - umount begin not complete\n");
wake_up_all(&tcon->ses->server->request_q); wake_up_all(&tcon->ses->server->request_q);
wake_up_all(&tcon->ses->server->response_q); wake_up_all(&tcon->ses->server->response_q);
msleep(1); /* yield */ msleep(1); /* yield */
...@@ -573,7 +573,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) ...@@ -573,7 +573,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
if (full_path == NULL) if (full_path == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cFYI(1, "Get root dentry for %s", full_path); cifs_dbg(FYI, "Get root dentry for %s\n", full_path);
sep = CIFS_DIR_SEP(cifs_sb); sep = CIFS_DIR_SEP(cifs_sb);
dentry = dget(sb->s_root); dentry = dget(sb->s_root);
...@@ -632,7 +632,7 @@ cifs_do_mount(struct file_system_type *fs_type, ...@@ -632,7 +632,7 @@ cifs_do_mount(struct file_system_type *fs_type,
struct cifs_mnt_data mnt_data; struct cifs_mnt_data mnt_data;
struct dentry *root; struct dentry *root;
cFYI(1, "Devname: %s flags: %d ", dev_name, flags); cifs_dbg(FYI, "Devname: %s flags: %d\n", dev_name, flags);
volume_info = cifs_get_volume_info((char *)data, dev_name); volume_info = cifs_get_volume_info((char *)data, dev_name);
if (IS_ERR(volume_info)) if (IS_ERR(volume_info))
...@@ -655,7 +655,8 @@ cifs_do_mount(struct file_system_type *fs_type, ...@@ -655,7 +655,8 @@ cifs_do_mount(struct file_system_type *fs_type,
rc = cifs_mount(cifs_sb, volume_info); rc = cifs_mount(cifs_sb, volume_info);
if (rc) { if (rc) {
if (!(flags & MS_SILENT)) if (!(flags & MS_SILENT))
cERROR(1, "cifs_mount failed w/return code = %d", rc); cifs_dbg(VFS, "cifs_mount failed w/return code = %d\n",
rc);
root = ERR_PTR(rc); root = ERR_PTR(rc);
goto out_mountdata; goto out_mountdata;
} }
...@@ -675,7 +676,7 @@ cifs_do_mount(struct file_system_type *fs_type, ...@@ -675,7 +676,7 @@ cifs_do_mount(struct file_system_type *fs_type,
} }
if (sb->s_root) { if (sb->s_root) {
cFYI(1, "Use existing superblock"); cifs_dbg(FYI, "Use existing superblock\n");
cifs_umount(cifs_sb); cifs_umount(cifs_sb);
} else { } else {
rc = cifs_read_super(sb); rc = cifs_read_super(sb);
...@@ -691,7 +692,7 @@ cifs_do_mount(struct file_system_type *fs_type, ...@@ -691,7 +692,7 @@ cifs_do_mount(struct file_system_type *fs_type,
if (IS_ERR(root)) if (IS_ERR(root))
goto out_super; goto out_super;
cFYI(1, "dentry root is: %p", root); cifs_dbg(FYI, "dentry root is: %p\n", root);
goto out; goto out;
out_super: out_super:
...@@ -723,7 +724,8 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -723,7 +724,8 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
rc = filemap_fdatawrite(inode->i_mapping); rc = filemap_fdatawrite(inode->i_mapping);
if (rc) if (rc)
cFYI(1, "cifs_file_aio_write: %d rc on %p inode", rc, inode); cifs_dbg(FYI, "cifs_file_aio_write: %d rc on %p inode\n",
rc, inode);
return written; return written;
} }
...@@ -1030,7 +1032,10 @@ cifs_init_request_bufs(void) ...@@ -1030,7 +1032,10 @@ cifs_init_request_bufs(void)
} else { } else {
CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/ CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/
} }
/* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */ /*
cifs_dbg(VFS, "CIFSMaxBufSize %d 0x%x\n",
CIFSMaxBufSize, CIFSMaxBufSize);
*/
cifs_req_cachep = kmem_cache_create("cifs_request", cifs_req_cachep = kmem_cache_create("cifs_request",
CIFSMaxBufSize + max_hdr_size, 0, CIFSMaxBufSize + max_hdr_size, 0,
SLAB_HWCACHE_ALIGN, NULL); SLAB_HWCACHE_ALIGN, NULL);
...@@ -1041,7 +1046,7 @@ cifs_init_request_bufs(void) ...@@ -1041,7 +1046,7 @@ cifs_init_request_bufs(void)
cifs_min_rcv = 1; cifs_min_rcv = 1;
else if (cifs_min_rcv > 64) { else if (cifs_min_rcv > 64) {
cifs_min_rcv = 64; cifs_min_rcv = 64;
cERROR(1, "cifs_min_rcv set to maximum (64)"); cifs_dbg(VFS, "cifs_min_rcv set to maximum (64)\n");
} }
cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv, cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
...@@ -1072,7 +1077,7 @@ cifs_init_request_bufs(void) ...@@ -1072,7 +1077,7 @@ cifs_init_request_bufs(void)
cifs_min_small = 2; cifs_min_small = 2;
else if (cifs_min_small > 256) { else if (cifs_min_small > 256) {
cifs_min_small = 256; cifs_min_small = 256;
cFYI(1, "cifs_min_small set to maximum (256)"); cifs_dbg(FYI, "cifs_min_small set to maximum (256)\n");
} }
cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small, cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small,
...@@ -1163,10 +1168,11 @@ init_cifs(void) ...@@ -1163,10 +1168,11 @@ init_cifs(void)
if (cifs_max_pending < 2) { if (cifs_max_pending < 2) {
cifs_max_pending = 2; cifs_max_pending = 2;
cFYI(1, "cifs_max_pending set to min of 2"); cifs_dbg(FYI, "cifs_max_pending set to min of 2\n");
} else if (cifs_max_pending > CIFS_MAX_REQ) { } else if (cifs_max_pending > CIFS_MAX_REQ) {
cifs_max_pending = CIFS_MAX_REQ; cifs_max_pending = CIFS_MAX_REQ;
cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ); cifs_dbg(FYI, "cifs_max_pending set to max of %u\n",
CIFS_MAX_REQ);
} }
cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
...@@ -1235,7 +1241,7 @@ init_cifs(void) ...@@ -1235,7 +1241,7 @@ init_cifs(void)
static void __exit static void __exit
exit_cifs(void) exit_cifs(void)
{ {
cFYI(DBG2, "exit_cifs"); cifs_dbg(NOISY, "exit_cifs\n");
unregister_filesystem(&cifs_fs_type); unregister_filesystem(&cifs_fs_type);
cifs_dfs_release_automount_timer(); cifs_dfs_release_automount_timer();
#ifdef CONFIG_CIFS_ACL #ifdef CONFIG_CIFS_ACL
......
...@@ -45,17 +45,17 @@ extern void _free_xid(unsigned int); ...@@ -45,17 +45,17 @@ extern void _free_xid(unsigned int);
#define get_xid() \ #define get_xid() \
({ \ ({ \
unsigned int __xid = _get_xid(); \ unsigned int __xid = _get_xid(); \
cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d", \ cifs_dbg(FYI, "CIFS VFS: in %s as Xid: %u with uid: %d\n", \
__func__, __xid, \ __func__, __xid, \
from_kuid(&init_user_ns, current_fsuid())); \ from_kuid(&init_user_ns, current_fsuid())); \
__xid; \ __xid; \
}) })
#define free_xid(curr_xid) \ #define free_xid(curr_xid) \
do { \ do { \
_free_xid(curr_xid); \ _free_xid(curr_xid); \
cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d", \ cifs_dbg(FYI, "CIFS VFS: leaving %s (xid = %u) rc = %d\n", \
__func__, curr_xid, (int)rc); \ __func__, curr_xid, (int)rc); \
} while (0) } while (0)
extern int init_cifs_idmap(void); extern int init_cifs_idmap(void);
extern void exit_cifs_idmap(void); extern void exit_cifs_idmap(void);
......
This diff is collapsed.
This diff is collapsed.
...@@ -102,7 +102,7 @@ build_path_from_dentry(struct dentry *direntry) ...@@ -102,7 +102,7 @@ build_path_from_dentry(struct dentry *direntry)
namelen += (1 + temp->d_name.len); namelen += (1 + temp->d_name.len);
temp = temp->d_parent; temp = temp->d_parent;
if (temp == NULL) { if (temp == NULL) {
cERROR(1, "corrupt dentry"); cifs_dbg(VFS, "corrupt dentry\n");
rcu_read_unlock(); rcu_read_unlock();
return NULL; return NULL;
} }
...@@ -124,12 +124,12 @@ build_path_from_dentry(struct dentry *direntry) ...@@ -124,12 +124,12 @@ build_path_from_dentry(struct dentry *direntry)
full_path[namelen] = dirsep; full_path[namelen] = dirsep;
strncpy(full_path + namelen + 1, temp->d_name.name, strncpy(full_path + namelen + 1, temp->d_name.name,
temp->d_name.len); temp->d_name.len);
cFYI(0, "name: %s", full_path + namelen); cifs_dbg(FYI, "name: %s\n", full_path + namelen);
} }
spin_unlock(&temp->d_lock); spin_unlock(&temp->d_lock);
temp = temp->d_parent; temp = temp->d_parent;
if (temp == NULL) { if (temp == NULL) {
cERROR(1, "corrupt dentry"); cifs_dbg(VFS, "corrupt dentry\n");
rcu_read_unlock(); rcu_read_unlock();
kfree(full_path); kfree(full_path);
return NULL; return NULL;
...@@ -137,8 +137,8 @@ build_path_from_dentry(struct dentry *direntry) ...@@ -137,8 +137,8 @@ build_path_from_dentry(struct dentry *direntry)
} }
rcu_read_unlock(); rcu_read_unlock();
if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) { if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) {
cFYI(1, "did not end path lookup where expected. namelen=%d " cifs_dbg(FYI, "did not end path lookup where expected. namelen=%ddfsplen=%d\n",
"dfsplen=%d", namelen, dfsplen); namelen, dfsplen);
/* presumably this is only possible if racing with a rename /* presumably this is only possible if racing with a rename
of one of the parent directories (we can not lock the dentries of one of the parent directories (we can not lock the dentries
above us to prevent this, but retrying should be harmless) */ above us to prevent this, but retrying should be harmless) */
...@@ -178,7 +178,7 @@ check_name(struct dentry *direntry) ...@@ -178,7 +178,7 @@ check_name(struct dentry *direntry)
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) { if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
for (i = 0; i < direntry->d_name.len; i++) { for (i = 0; i < direntry->d_name.len; i++) {
if (direntry->d_name.name[i] == '\\') { if (direntry->d_name.name[i] == '\\') {
cFYI(1, "Invalid file name"); cifs_dbg(FYI, "Invalid file name\n");
return -EINVAL; return -EINVAL;
} }
} }
...@@ -291,7 +291,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid, ...@@ -291,7 +291,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
else if ((oflags & O_CREAT) == O_CREAT) else if ((oflags & O_CREAT) == O_CREAT)
disposition = FILE_OPEN_IF; disposition = FILE_OPEN_IF;
else else
cFYI(1, "Create flag not set in create function"); cifs_dbg(FYI, "Create flag not set in create function\n");
/* /*
* BB add processing to set equivalent of mode - e.g. via CreateX with * 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,7 +323,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
desired_access, create_options, fid, oplock, desired_access, create_options, fid, oplock,
buf, cifs_sb); buf, cifs_sb);
if (rc) { if (rc) {
cFYI(1, "cifs_create returned 0x%x", rc); cifs_dbg(FYI, "cifs_create returned 0x%x\n", rc);
goto out; goto out;
} }
...@@ -389,7 +389,8 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid, ...@@ -389,7 +389,8 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
cifs_create_set_dentry: cifs_create_set_dentry:
if (rc != 0) { if (rc != 0) {
cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); cifs_dbg(FYI, "Create worked, get_inode_info failed rc = %d\n",
rc);
if (server->ops->close) if (server->ops->close)
server->ops->close(xid, tcon, fid); server->ops->close(xid, tcon, fid);
goto out; goto out;
...@@ -452,12 +453,14 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, ...@@ -452,12 +453,14 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
xid = get_xid(); xid = get_xid();
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
inode, direntry->d_name.name, direntry); inode, direntry->d_name.name, direntry);
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
if (IS_ERR(tlink)) if (IS_ERR(tlink)) {
rc = PTR_ERR(tlink);
goto out_free_xid; goto out_free_xid;
}
tcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink);
server = tcon->ses->server; server = tcon->ses->server;
...@@ -518,8 +521,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode, ...@@ -518,8 +521,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
__u32 oplock; __u32 oplock;
int created = FILE_CREATED; int created = FILE_CREATED;
cFYI(1, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p", cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n",
inode, direntry->d_name.name, direntry); inode, direntry->d_name.name, direntry);
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
rc = PTR_ERR(tlink); rc = PTR_ERR(tlink);
...@@ -613,7 +616,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, ...@@ -613,7 +616,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
goto mknod_out; goto mknod_out;
cFYI(1, "sfu compat create special file"); cifs_dbg(FYI, "sfu compat create special file\n");
buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
if (buf == NULL) { if (buf == NULL) {
...@@ -688,8 +691,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -688,8 +691,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
xid = get_xid(); xid = get_xid();
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
parent_dir_inode, direntry->d_name.name, direntry); parent_dir_inode, direntry->d_name.name, direntry);
/* check whether path exists */ /* check whether path exists */
...@@ -715,11 +718,12 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -715,11 +718,12 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
} }
if (direntry->d_inode != NULL) { if (direntry->d_inode != NULL) {
cFYI(1, "non-NULL inode in lookup"); cifs_dbg(FYI, "non-NULL inode in lookup\n");
} else { } else {
cFYI(1, "NULL inode in lookup"); cifs_dbg(FYI, "NULL inode in lookup\n");
} }
cFYI(1, "Full path: %s inode = 0x%p", full_path, direntry->d_inode); cifs_dbg(FYI, "Full path: %s inode = 0x%p\n",
full_path, direntry->d_inode);
if (pTcon->unix_ext) { if (pTcon->unix_ext) {
rc = cifs_get_inode_info_unix(&newInode, full_path, rc = cifs_get_inode_info_unix(&newInode, full_path,
...@@ -742,7 +746,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -742,7 +746,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
/* if it was once a directory (but how can we tell?) we could do /* if it was once a directory (but how can we tell?) we could do
shrink_dcache_parent(direntry); */ shrink_dcache_parent(direntry); */
} else if (rc != -EACCES) { } else if (rc != -EACCES) {
cERROR(1, "Unexpected lookup error %d", rc); cifs_dbg(VFS, "Unexpected lookup error %d\n", rc);
/* We special case check for Access Denied - since that /* We special case check for Access Denied - since that
is a common return code */ is a common return code */
} }
...@@ -807,7 +811,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags) ...@@ -807,7 +811,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
{ {
int rc = 0; int rc = 0;
cFYI(1, "In cifs d_delete, name = %s", direntry->d_name.name); cifs_dbg(FYI, "In cifs d_delete, name = %s\n", direntry->d_name.name);
return rc; return rc;
} */ } */
......
...@@ -55,7 +55,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) ...@@ -55,7 +55,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
len = strlen(unc); len = strlen(unc);
if (len < 3) { if (len < 3) {
cFYI(1, "%s: unc is too short: %s", __func__, unc); cifs_dbg(FYI, "%s: unc is too short: %s\n", __func__, unc);
return -EINVAL; return -EINVAL;
} }
...@@ -68,8 +68,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) ...@@ -68,8 +68,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
if (sep) if (sep)
len = sep - hostname; len = sep - hostname;
else else
cFYI(1, "%s: probably server name is whole unc: %s", cifs_dbg(FYI, "%s: probably server name is whole unc: %s\n",
__func__, unc); __func__, unc);
/* Try to interpret hostname as an IPv4 or IPv6 address */ /* Try to interpret hostname as an IPv4 or IPv6 address */
rc = cifs_convert_address((struct sockaddr *)&ss, hostname, len); 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,11 +79,11 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
/* Perform the upcall */ /* Perform the upcall */
rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL); rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL);
if (rc < 0) if (rc < 0)
cFYI(1, "%s: unable to resolve: %*.*s", cifs_dbg(FYI, "%s: unable to resolve: %*.*s\n",
__func__, len, len, hostname); __func__, len, len, hostname);
else else
cFYI(1, "%s: resolved: %*.*s to %s", cifs_dbg(FYI, "%s: resolved: %*.*s to %s\n",
__func__, len, len, hostname, *ip_addr); __func__, len, len, hostname, *ip_addr);
return rc; return rc;
name_is_IP_address: name_is_IP_address:
...@@ -92,7 +92,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) ...@@ -92,7 +92,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
return -ENOMEM; return -ENOMEM;
memcpy(name, hostname, len); memcpy(name, hostname, len);
name[len] = 0; name[len] = 0;
cFYI(1, "%s: unc is IP, skipping dns upcall: %s", __func__, name); cifs_dbg(FYI, "%s: unc is IP, skipping dns upcall: %s\n",
__func__, name);
*ip_addr = name; *ip_addr = name;
return 0; return 0;
} }
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
static struct dentry *cifs_get_parent(struct dentry *dentry) static struct dentry *cifs_get_parent(struct dentry *dentry)
{ {
/* BB need to add code here eventually to enable export via NFSD */ /* BB need to add code here eventually to enable export via NFSD */
cFYI(1, "get parent for %p", dentry); cifs_dbg(FYI, "get parent for %p\n", dentry);
return ERR_PTR(-EACCES); return ERR_PTR(-EACCES);
} }
......
This diff is collapsed.
...@@ -28,14 +28,14 @@ void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) ...@@ -28,14 +28,14 @@ void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server)
server->fscache = server->fscache =
fscache_acquire_cookie(cifs_fscache_netfs.primary_index, fscache_acquire_cookie(cifs_fscache_netfs.primary_index,
&cifs_fscache_server_index_def, server); &cifs_fscache_server_index_def, server);
cFYI(1, "%s: (0x%p/0x%p)", __func__, server, cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
server->fscache); __func__, server, server->fscache);
} }
void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server)
{ {
cFYI(1, "%s: (0x%p/0x%p)", __func__, server, cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
server->fscache); __func__, server, server->fscache);
fscache_relinquish_cookie(server->fscache, 0); fscache_relinquish_cookie(server->fscache, 0);
server->fscache = NULL; server->fscache = NULL;
} }
...@@ -47,13 +47,13 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon) ...@@ -47,13 +47,13 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
tcon->fscache = tcon->fscache =
fscache_acquire_cookie(server->fscache, fscache_acquire_cookie(server->fscache,
&cifs_fscache_super_index_def, tcon); &cifs_fscache_super_index_def, tcon);
cFYI(1, "%s: (0x%p/0x%p)", __func__, server->fscache, cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
tcon->fscache); __func__, server->fscache, tcon->fscache);
} }
void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon)
{ {
cFYI(1, "%s: (0x%p)", __func__, tcon->fscache); cifs_dbg(FYI, "%s: (0x%p)\n", __func__, tcon->fscache);
fscache_relinquish_cookie(tcon->fscache, 0); fscache_relinquish_cookie(tcon->fscache, 0);
tcon->fscache = NULL; tcon->fscache = NULL;
} }
...@@ -70,8 +70,8 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode) ...@@ -70,8 +70,8 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode)
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) {
cifsi->fscache = fscache_acquire_cookie(tcon->fscache, cifsi->fscache = fscache_acquire_cookie(tcon->fscache,
&cifs_fscache_inode_object_def, cifsi); &cifs_fscache_inode_object_def, cifsi);
cFYI(1, "%s: got FH cookie (0x%p/0x%p)", __func__, cifs_dbg(FYI, "%s: got FH cookie (0x%p/0x%p)\n",
tcon->fscache, cifsi->fscache); __func__, tcon->fscache, cifsi->fscache);
} }
} }
...@@ -80,7 +80,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode) ...@@ -80,7 +80,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode)
struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsInodeInfo *cifsi = CIFS_I(inode);
if (cifsi->fscache) { if (cifsi->fscache) {
cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache);
fscache_relinquish_cookie(cifsi->fscache, 0); fscache_relinquish_cookie(cifsi->fscache, 0);
cifsi->fscache = NULL; cifsi->fscache = NULL;
} }
...@@ -91,7 +91,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode) ...@@ -91,7 +91,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode)
struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsInodeInfo *cifsi = CIFS_I(inode);
if (cifsi->fscache) { if (cifsi->fscache) {
cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache);
fscache_uncache_all_inode_pages(cifsi->fscache, inode); fscache_uncache_all_inode_pages(cifsi->fscache, inode);
fscache_relinquish_cookie(cifsi->fscache, 1); fscache_relinquish_cookie(cifsi->fscache, 1);
cifsi->fscache = NULL; cifsi->fscache = NULL;
...@@ -120,8 +120,8 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode) ...@@ -120,8 +120,8 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode)
cifs_sb_master_tcon(cifs_sb)->fscache, cifs_sb_master_tcon(cifs_sb)->fscache,
&cifs_fscache_inode_object_def, &cifs_fscache_inode_object_def,
cifsi); cifsi);
cFYI(1, "%s: new cookie 0x%p oldcookie 0x%p", cifs_dbg(FYI, "%s: new cookie 0x%p oldcookie 0x%p\n",
__func__, cifsi->fscache, old); __func__, cifsi->fscache, old);
} }
} }
...@@ -131,8 +131,8 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) ...@@ -131,8 +131,8 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsInodeInfo *cifsi = CIFS_I(inode);
cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
cifsi->fscache); __func__, page, cifsi->fscache);
if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) if (!fscache_maybe_release_page(cifsi->fscache, page, gfp))
return 0; return 0;
} }
...@@ -143,7 +143,7 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) ...@@ -143,7 +143,7 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx,
int error) int error)
{ {
cFYI(1, "%s: (0x%p/%d)", __func__, page, error); cifs_dbg(FYI, "%s: (0x%p/%d)\n", __func__, page, error);
if (!error) if (!error)
SetPageUptodate(page); SetPageUptodate(page);
unlock_page(page); unlock_page(page);
...@@ -156,8 +156,8 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page) ...@@ -156,8 +156,8 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
{ {
int ret; int ret;
cFYI(1, "%s: (fsc:%p, p:%p, i:0x%p", __func__, cifs_dbg(FYI, "%s: (fsc:%p, p:%p, i:0x%p\n",
CIFS_I(inode)->fscache, page, inode); __func__, CIFS_I(inode)->fscache, page, inode);
ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page,
cifs_readpage_from_fscache_complete, cifs_readpage_from_fscache_complete,
NULL, NULL,
...@@ -165,15 +165,15 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page) ...@@ -165,15 +165,15 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
switch (ret) { switch (ret) {
case 0: /* page found in fscache, read submitted */ case 0: /* page found in fscache, read submitted */
cFYI(1, "%s: submitted", __func__); cifs_dbg(FYI, "%s: submitted\n", __func__);
return ret; return ret;
case -ENOBUFS: /* page won't be cached */ case -ENOBUFS: /* page won't be cached */
case -ENODATA: /* page not in cache */ case -ENODATA: /* page not in cache */
cFYI(1, "%s: %d", __func__, ret); cifs_dbg(FYI, "%s: %d\n", __func__, ret);
return 1; return 1;
default: default:
cERROR(1, "unknown error ret = %d", ret); cifs_dbg(VFS, "unknown error ret = %d\n", ret);
} }
return ret; return ret;
} }
...@@ -188,8 +188,8 @@ int __cifs_readpages_from_fscache(struct inode *inode, ...@@ -188,8 +188,8 @@ int __cifs_readpages_from_fscache(struct inode *inode,
{ {
int ret; int ret;
cFYI(1, "%s: (0x%p/%u/0x%p)", __func__, cifs_dbg(FYI, "%s: (0x%p/%u/0x%p)\n",
CIFS_I(inode)->fscache, *nr_pages, inode); __func__, CIFS_I(inode)->fscache, *nr_pages, inode);
ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping,
pages, nr_pages, pages, nr_pages,
cifs_readpage_from_fscache_complete, cifs_readpage_from_fscache_complete,
...@@ -197,16 +197,16 @@ int __cifs_readpages_from_fscache(struct inode *inode, ...@@ -197,16 +197,16 @@ int __cifs_readpages_from_fscache(struct inode *inode,
mapping_gfp_mask(mapping)); mapping_gfp_mask(mapping));
switch (ret) { switch (ret) {
case 0: /* read submitted to the cache for all pages */ case 0: /* read submitted to the cache for all pages */
cFYI(1, "%s: submitted", __func__); cifs_dbg(FYI, "%s: submitted\n", __func__);
return ret; return ret;
case -ENOBUFS: /* some pages are not cached and can't be */ case -ENOBUFS: /* some pages are not cached and can't be */
case -ENODATA: /* some pages are not cached */ case -ENODATA: /* some pages are not cached */
cFYI(1, "%s: no page", __func__); cifs_dbg(FYI, "%s: no page\n", __func__);
return 1; return 1;
default: default:
cFYI(1, "unknown error ret = %d", ret); cifs_dbg(FYI, "unknown error ret = %d\n", ret);
} }
return ret; return ret;
...@@ -216,8 +216,8 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) ...@@ -216,8 +216,8 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
{ {
int ret; int ret;
cFYI(1, "%s: (fsc: %p, p: %p, i: %p)", __func__, cifs_dbg(FYI, "%s: (fsc: %p, p: %p, i: %p)\n",
CIFS_I(inode)->fscache, page, inode); __func__, CIFS_I(inode)->fscache, page, inode);
ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL);
if (ret != 0) if (ret != 0)
fscache_uncache_page(CIFS_I(inode)->fscache, page); fscache_uncache_page(CIFS_I(inode)->fscache, page);
...@@ -228,7 +228,7 @@ void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) ...@@ -228,7 +228,7 @@ void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode)
struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsInodeInfo *cifsi = CIFS_I(inode);
struct fscache_cookie *cookie = cifsi->fscache; struct fscache_cookie *cookie = cifsi->fscache;
cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cookie); cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", __func__, page, cookie);
fscache_wait_on_page_write(cookie, page); fscache_wait_on_page_write(cookie, page);
fscache_uncache_page(cookie, page); fscache_uncache_page(cookie, page);
} }
......
This diff is collapsed.
...@@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
xid = get_xid(); xid = get_xid();
cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg); cifs_dbg(FYI, "ioctl file %p cmd %u arg %lu\n", filep, command, arg);
cifs_sb = CIFS_SB(inode->i_sb); cifs_sb = CIFS_SB(inode->i_sb);
...@@ -83,11 +83,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -83,11 +83,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
* &ExtAttrMask); * &ExtAttrMask);
*/ */
} }
cFYI(1, "set flags not implemented yet"); cifs_dbg(FYI, "set flags not implemented yet\n");
break; break;
#endif /* CONFIG_CIFS_POSIX */ #endif /* CONFIG_CIFS_POSIX */
default: default:
cFYI(1, "unsupported ioctl"); cifs_dbg(FYI, "unsupported ioctl\n");
break; break;
} }
......
...@@ -56,14 +56,14 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash) ...@@ -56,14 +56,14 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
md5 = crypto_alloc_shash("md5", 0, 0); md5 = crypto_alloc_shash("md5", 0, 0);
if (IS_ERR(md5)) { if (IS_ERR(md5)) {
rc = PTR_ERR(md5); rc = PTR_ERR(md5);
cERROR(1, "%s: Crypto md5 allocation error %d", __func__, rc); cifs_dbg(VFS, "%s: Crypto md5 allocation error %d\n",
__func__, rc);
return rc; return rc;
} }
size = sizeof(struct shash_desc) + crypto_shash_descsize(md5); size = sizeof(struct shash_desc) + crypto_shash_descsize(md5);
sdescmd5 = kmalloc(size, GFP_KERNEL); sdescmd5 = kmalloc(size, GFP_KERNEL);
if (!sdescmd5) { if (!sdescmd5) {
rc = -ENOMEM; rc = -ENOMEM;
cERROR(1, "%s: Memory allocation failure", __func__);
goto symlink_hash_err; goto symlink_hash_err;
} }
sdescmd5->shash.tfm = md5; sdescmd5->shash.tfm = md5;
...@@ -71,17 +71,17 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash) ...@@ -71,17 +71,17 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
rc = crypto_shash_init(&sdescmd5->shash); rc = crypto_shash_init(&sdescmd5->shash);
if (rc) { if (rc) {
cERROR(1, "%s: Could not init md5 shash", __func__); cifs_dbg(VFS, "%s: Could not init md5 shash\n", __func__);
goto symlink_hash_err; goto symlink_hash_err;
} }
rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len); rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with link_str", __func__); cifs_dbg(VFS, "%s: Could not update with link_str\n", __func__);
goto symlink_hash_err; goto symlink_hash_err;
} }
rc = crypto_shash_final(&sdescmd5->shash, md5_hash); rc = crypto_shash_final(&sdescmd5->shash, md5_hash);
if (rc) if (rc)
cERROR(1, "%s: Could not generate md5 hash", __func__); cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
symlink_hash_err: symlink_hash_err:
crypto_free_shash(md5); crypto_free_shash(md5);
...@@ -115,7 +115,7 @@ CIFSParseMFSymlink(const u8 *buf, ...@@ -115,7 +115,7 @@ CIFSParseMFSymlink(const u8 *buf,
rc = symlink_hash(link_len, link_str, md5_hash); rc = symlink_hash(link_len, link_str, md5_hash);
if (rc) { if (rc) {
cFYI(1, "%s: MD5 hash failure: %d", __func__, rc); cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
return rc; return rc;
} }
...@@ -154,7 +154,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str) ...@@ -154,7 +154,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str)
rc = symlink_hash(link_len, link_str, md5_hash); rc = symlink_hash(link_len, link_str, md5_hash);
if (rc) { if (rc) {
cFYI(1, "%s: MD5 hash failure: %d", __func__, rc); cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
return rc; return rc;
} }
...@@ -521,7 +521,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) ...@@ -521,7 +521,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
if (!full_path) if (!full_path)
goto out; goto out;
cFYI(1, "Full path: %s inode = 0x%p", full_path, inode); cifs_dbg(FYI, "Full path: %s inode = 0x%p\n", full_path, inode);
rc = -EACCES; rc = -EACCES;
/* /*
...@@ -578,8 +578,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) ...@@ -578,8 +578,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
goto symlink_exit; goto symlink_exit;
} }
cFYI(1, "Full path: %s", full_path); cifs_dbg(FYI, "Full path: %s\n", full_path);
cFYI(1, "symname is %s", symname); cifs_dbg(FYI, "symname is %s\n", symname);
/* BB what if DFS and this volume is on different share? BB */ /* BB what if DFS and this volume is on different share? BB */
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) 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,8 +601,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
inode->i_sb, xid, NULL); inode->i_sb, xid, NULL);
if (rc != 0) { if (rc != 0) {
cFYI(1, "Create symlink ok, getinodeinfo fail rc = %d", cifs_dbg(FYI, "Create symlink ok, getinodeinfo fail rc = %d\n",
rc); rc);
} else { } else {
d_instantiate(direntry, newinode); d_instantiate(direntry, newinode);
} }
......
This diff is collapsed.
...@@ -150,8 +150,8 @@ cifs_inet_pton(const int address_family, const char *cp, int len, void *dst) ...@@ -150,8 +150,8 @@ cifs_inet_pton(const int address_family, const char *cp, int len, void *dst)
else if (address_family == AF_INET6) else if (address_family == AF_INET6)
ret = in6_pton(cp, len, dst , '\\', NULL); ret = in6_pton(cp, len, dst , '\\', NULL);
cFYI(DBG2, "address conversion returned %d for %*.*s", cifs_dbg(NOISY, "address conversion returned %d for %*.*s\n",
ret, len, len, cp); ret, len, len, cp);
if (ret > 0) if (ret > 0)
ret = 1; ret = 1;
return ret; return ret;
...@@ -887,7 +887,7 @@ map_smb_to_linux_error(char *buf, bool logErr) ...@@ -887,7 +887,7 @@ map_smb_to_linux_error(char *buf, bool logErr)
} }
/* else ERRHRD class errors or junk - return EIO */ /* else ERRHRD class errors or junk - return EIO */
cFYI(1, "Mapping smb error code 0x%x to POSIX err %d", cifs_dbg(FYI, "Mapping smb error code 0x%x to POSIX err %d\n",
le32_to_cpu(smb->Status.CifsError), rc); le32_to_cpu(smb->Status.CifsError), rc);
/* generic corrective action e.g. reconnect SMB session on /* 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,20 +951,20 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
SMB_TIME *st = (SMB_TIME *)&time; SMB_TIME *st = (SMB_TIME *)&time;
SMB_DATE *sd = (SMB_DATE *)&date; SMB_DATE *sd = (SMB_DATE *)&date;
cFYI(1, "date %d time %d", date, time); cifs_dbg(FYI, "date %d time %d\n", date, time);
sec = 2 * st->TwoSeconds; sec = 2 * st->TwoSeconds;
min = st->Minutes; min = st->Minutes;
if ((sec > 59) || (min > 59)) if ((sec > 59) || (min > 59))
cERROR(1, "illegal time min %d sec %d", min, sec); cifs_dbg(VFS, "illegal time min %d sec %d\n", min, sec);
sec += (min * 60); sec += (min * 60);
sec += 60 * 60 * st->Hours; sec += 60 * 60 * st->Hours;
if (st->Hours > 24) if (st->Hours > 24)
cERROR(1, "illegal hours %d", st->Hours); cifs_dbg(VFS, "illegal hours %d\n", st->Hours);
days = sd->Day; days = sd->Day;
month = sd->Month; month = sd->Month;
if ((days > 31) || (month > 12)) { if ((days > 31) || (month > 12)) {
cERROR(1, "illegal date, month %d day: %d", month, days); cifs_dbg(VFS, "illegal date, month %d day: %d\n", month, days);
if (month > 12) if (month > 12)
month = 12; month = 12;
} }
...@@ -990,7 +990,7 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset) ...@@ -990,7 +990,7 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
ts.tv_sec = sec + offset; ts.tv_sec = sec + offset;
/* cFYI(1, "sec after cnvrt dos to unix time %d",sec); */ /* cifs_dbg(FYI, "sec after cnvrt dos to unix time %d\n",sec); */
ts.tv_nsec = 0; ts.tv_nsec = 0;
return ts; return ts;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -43,13 +43,13 @@ smb2_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock) ...@@ -43,13 +43,13 @@ smb2_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock)
if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE) { if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE) {
cinode->clientCanCacheAll = true; cinode->clientCanCacheAll = true;
cinode->clientCanCacheRead = true; cinode->clientCanCacheRead = true;
cFYI(1, "Exclusive Oplock granted on inode %p", cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n",
&cinode->vfs_inode); &cinode->vfs_inode);
} else if (oplock == SMB2_OPLOCK_LEVEL_II) { } else if (oplock == SMB2_OPLOCK_LEVEL_II) {
cinode->clientCanCacheAll = false; cinode->clientCanCacheAll = false;
cinode->clientCanCacheRead = true; cinode->clientCanCacheRead = true;
cFYI(1, "Level II Oplock granted on inode %p", cifs_dbg(FYI, "Level II Oplock granted on inode %p\n",
&cinode->vfs_inode); &cinode->vfs_inode);
} else { } else {
cinode->clientCanCacheAll = false; cinode->clientCanCacheAll = false;
cinode->clientCanCacheRead = false; cinode->clientCanCacheRead = false;
......
...@@ -92,7 +92,7 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -92,7 +92,7 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon,
(FILE_BASIC_INFO *)data); (FILE_BASIC_INFO *)data);
break; break;
default: default:
cERROR(1, "Invalid command"); cifs_dbg(VFS, "Invalid command\n");
break; break;
} }
......
...@@ -2472,7 +2472,7 @@ map_smb2_to_linux_error(char *buf, bool log_err) ...@@ -2472,7 +2472,7 @@ map_smb2_to_linux_error(char *buf, bool log_err)
/* on error mapping not found - return EIO */ /* on error mapping not found - return EIO */
cFYI(1, "Mapping SMB2 status code %d to POSIX err %d", cifs_dbg(FYI, "Mapping SMB2 status code %d to POSIX err %d\n",
smb2err, rc); smb2err, rc);
return rc; return rc;
......
This diff is collapsed.
...@@ -38,13 +38,13 @@ change_conf(struct TCP_Server_Info *server) ...@@ -38,13 +38,13 @@ change_conf(struct TCP_Server_Info *server)
case 1: case 1:
server->echoes = false; server->echoes = false;
server->oplocks = false; server->oplocks = false;
cERROR(1, "disabling echoes and oplocks"); cifs_dbg(VFS, "disabling echoes and oplocks\n");
break; break;
case 2: case 2:
server->echoes = true; server->echoes = true;
server->oplocks = false; server->oplocks = false;
server->echo_credits = 1; server->echo_credits = 1;
cFYI(1, "disabling oplocks"); cifs_dbg(FYI, "disabling oplocks\n");
break; break;
default: default:
server->echoes = true; server->echoes = true;
...@@ -147,10 +147,10 @@ smb2_dump_detail(void *buf) ...@@ -147,10 +147,10 @@ smb2_dump_detail(void *buf)
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
struct smb2_hdr *smb = (struct smb2_hdr *)buf; struct smb2_hdr *smb = (struct smb2_hdr *)buf;
cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d", cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d\n",
smb->Command, smb->Status, smb->Flags, smb->MessageId, smb->Command, smb->Status, smb->Flags, smb->MessageId,
smb->ProcessId); smb->ProcessId);
cERROR(1, "smb buf %p len %u", smb, smb2_calc_size(smb)); cifs_dbg(VFS, "smb buf %p len %u\n", smb, smb2_calc_size(smb));
#endif #endif
} }
...@@ -436,7 +436,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -436,7 +436,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
&oplock, NULL); &oplock, NULL);
kfree(utf16_path); kfree(utf16_path);
if (rc) { if (rc) {
cERROR(1, "open dir failed"); cifs_dbg(VFS, "open dir failed\n");
return rc; return rc;
} }
...@@ -448,7 +448,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -448,7 +448,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
rc = SMB2_query_directory(xid, tcon, persistent_fid, volatile_fid, 0, rc = SMB2_query_directory(xid, tcon, persistent_fid, volatile_fid, 0,
srch_inf); srch_inf);
if (rc) { if (rc) {
cERROR(1, "query directory failed"); cifs_dbg(VFS, "query directory failed\n");
SMB2_close(xid, tcon, persistent_fid, volatile_fid); SMB2_close(xid, tcon, persistent_fid, volatile_fid);
} }
return rc; return rc;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment