[CIFS] Neaten cERROR and cFYI macros, reduce text space

Neaten cERROR and cFYI macros, reduce text space
~2.5K

Convert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space
Surround macros with do {} while
Add parentheses to macros
Make statement expression macro from macro with assign
Remove now unnecessary parentheses from cFYI and cERROR uses

defconfig with CIFS support old
$ size fs/cifs/built-in.o
   text	   data	    bss	    dec	    hex	filename
 156012	   1760	    148	 157920	  268e0	fs/cifs/built-in.o

defconfig with CIFS support old
$ size fs/cifs/built-in.o
   text	   data	    bss	    dec	    hex	filename
 153508	   1760	    148	 155416	  25f18	fs/cifs/built-in.o

allyesconfig old:
$ size fs/cifs/built-in.o
   text	   data	    bss	    dec	    hex	filename
 309138	   3864	  74824	 387826	  5eaf2	fs/cifs/built-in.o

allyesconfig new
$ size fs/cifs/built-in.o
   text	   data	    bss	    dec	    hex	filename
 305655	   3864	  74824	 384343	  5dd57	fs/cifs/built-in.o

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
Joe Perches 2010-04-21 03:50:45 +00:00 committed by Steve French
parent 315e995c63
commit b6b38f704a
25 changed files with 845 additions and 835 deletions

View File

@ -510,11 +510,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")); cFYI(1, "Error decoding negTokenInit header");
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)); cFYI(1, "cls = %d con = %d tag = %d", cls, con, tag);
return 0; return 0;
} }
@ -535,56 +535,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")); cFYI(1, "Error decoding negTokenInit header");
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")); cFYI(1, "Error decoding negTokenInit");
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, cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0",
("cls = %d con = %d tag = %d end = %p (%d) exit 0", 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")); cFYI(1, "Error decoding negTokenInit");
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, cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1",
("cls = %d con = %d tag = %d end = %p (%d) exit 1", 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")); cFYI(1, "Error decoding 2nd part of negTokenInit");
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, cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0",
("cls = %d con = %d tag = %d end = %p (%d) exit 0", 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")); cFYI(1, "Error decoding 2nd part of negTokenInit");
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, cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1",
("cls = %d con = %d tag = %d end = %p (%d) exit 1", cls, con, tag, end, *end);
cls, con, tag, end, *end));
return 0; return 0;
} }
@ -592,16 +588,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, cFYI(1, "Error decoding negTokenInit hdr exit2");
("Error decoding negTokenInit hdr exit2"));
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 " cFYI(1, "OID len = %d oid = 0x%lx 0x%lx "
"0x%lx 0x%lx", oidlen, *oid, "0x%lx 0x%lx", oidlen, *oid,
*(oid + 1), *(oid + 2), *(oid + 3))); *(oid + 1), *(oid + 2), *(oid + 3));
if (compare_oid(oid, oidlen, MSKRB5_OID, if (compare_oid(oid, oidlen, MSKRB5_OID,
MSKRB5_OID_LEN) && MSKRB5_OID_LEN) &&
@ -622,7 +617,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?")); cFYI(1, "Should be an oid what is going on?");
} }
} }
@ -632,47 +627,47 @@ decode_negTokenInit(unsigned char *security_blob, int length,
no mechListMic (e.g. NTLMSSP instead of KRB5) */ no mechListMic (e.g. NTLMSSP instead of KRB5) */
if (ctx.error == ASN1_ERR_DEC_EMPTY) if (ctx.error == ASN1_ERR_DEC_EMPTY)
goto decode_negtoken_exit; goto decode_negtoken_exit;
cFYI(1, ("Error decoding last part negTokenInit exit3")); cFYI(1, "Error decoding last part negTokenInit exit3");
return 0; return 0;
} else if ((cls != ASN1_CTX) || (con != ASN1_CON)) { } else if ((cls != ASN1_CTX) || (con != ASN1_CON)) {
/* tag = 3 indicating mechListMIC */ /* tag = 3 indicating mechListMIC */
cFYI(1, ("Exit 4 cls = %d con = %d tag = %d end = %p (%d)", cFYI(1, "Exit 4 cls = %d con = %d tag = %d end = %p (%d)",
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 last part negTokenInit exit5")); cFYI(1, "Error decoding last part negTokenInit exit5");
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)", cFYI(1, "cls = %d con = %d tag = %d end = %p (%d)",
cls, con, tag, end, *end)); cls, con, tag, end, *end);
} }
/* sequence of */ /* sequence of */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, ("Error decoding last part negTokenInit exit 7")); cFYI(1, "Error decoding last part negTokenInit exit 7");
return 0; return 0;
} else if ((cls != ASN1_CTX) || (con != ASN1_CON)) { } else if ((cls != ASN1_CTX) || (con != ASN1_CON)) {
cFYI(1, ("Exit 8 cls = %d con = %d tag = %d end = %p (%d)", cFYI(1, "Exit 8 cls = %d con = %d tag = %d end = %p (%d)",
cls, con, tag, end, *end)); cls, con, tag, end, *end);
return 0; return 0;
} }
/* general string */ /* general string */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, ("Error decoding last part negTokenInit exit9")); cFYI(1, "Error decoding last part negTokenInit exit9");
return 0; return 0;
} else if ((cls != ASN1_UNI) || (con != ASN1_PRI) } else if ((cls != ASN1_UNI) || (con != ASN1_PRI)
|| (tag != ASN1_GENSTR)) { || (tag != ASN1_GENSTR)) {
cFYI(1, ("Exit10 cls = %d con = %d tag = %d end = %p (%d)", cFYI(1, "Exit10 cls = %d con = %d tag = %d end = %p (%d)",
cls, con, tag, end, *end)); cls, con, tag, end, *end);
return 0; return 0;
} }
cFYI(1, ("Need to call asn1_octets_decode() function for %s", cFYI(1, "Need to call asn1_octets_decode() function for %s",
ctx.pointer)); /* is this UTF-8 or ASCII? */ ctx.pointer); /* is this UTF-8 or ASCII? */
decode_negtoken_exit: decode_negtoken_exit:
if (use_kerberos) if (use_kerberos)
*secType = Kerberos; *secType = Kerberos;

View File

@ -60,10 +60,10 @@ cifs_dump_mem(char *label, void *data, int length)
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
void cifs_dump_detail(struct smb_hdr *smb) void cifs_dump_detail(struct smb_hdr *smb)
{ {
cERROR(1, ("Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d",
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 %d", smb, smbCalcSize_LE(smb))); cERROR(1, "smb buf %p len %d", smb, smbCalcSize_LE(smb));
} }
@ -75,25 +75,25 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
if (server == NULL) if (server == NULL)
return; return;
cERROR(1, ("Dump pending requests:")); cERROR(1, "Dump pending requests:");
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 Tsk: %p Mid %d", cERROR(1, "State: %d Cmd: %d Pid: %d Tsk: %p Mid %d",
mid_entry->midState, mid_entry->midState,
(int)mid_entry->command, (int)mid_entry->command,
mid_entry->pid, mid_entry->pid,
mid_entry->tsk, mid_entry->tsk,
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", cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld",
mid_entry->largeBuf, mid_entry->largeBuf,
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, cERROR(1, "IsMult: %d IsEnd: %d", mid_entry->multiRsp,
mid_entry->multiEnd)); 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: ",
@ -750,7 +750,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
extended_security = CIFSSEC_MAX; extended_security = CIFSSEC_MAX;
return count; return count;
} else if (!isdigit(c)) { } else if (!isdigit(c)) {
cERROR(1, ("invalid flag %c", c)); cERROR(1, "invalid flag %c", c);
return -EINVAL; return -EINVAL;
} }
} }
@ -758,16 +758,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)); cFYI(1, "sec flags 0x%x", flags);
if (flags <= 0) { if (flags <= 0) {
cERROR(1, ("invalid security flags %s", flags_string)); cERROR(1, "invalid security flags %s", flags_string);
return -EINVAL; return -EINVAL;
} }
if (flags & ~CIFSSEC_MASK) { if (flags & ~CIFSSEC_MASK) {
cERROR(1, ("attempt to set unsupported security flags 0x%x", cERROR(1, "attempt to set unsupported security flags 0x%x",
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 */
@ -775,9 +775,9 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
if (extended_security & CIFSSEC_MUST_SIGN) { if (extended_security & CIFSSEC_MUST_SIGN) {
/* requiring signing implies signing is allowed */ /* requiring signing implies signing is allowed */
extended_security |= CIFSSEC_MAY_SIGN; extended_security |= CIFSSEC_MAY_SIGN;
cFYI(1, ("packet signing now required")); cFYI(1, "packet signing now required");
} else if ((extended_security & CIFSSEC_MAY_SIGN) == 0) { } else if ((extended_security & CIFSSEC_MAY_SIGN) == 0) {
cFYI(1, ("packet signing disabled")); cFYI(1, "packet signing disabled");
} }
/* 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;

View File

@ -43,34 +43,54 @@ void dump_smb(struct smb_hdr *, int);
*/ */
#ifdef CIFS_DEBUG #ifdef CIFS_DEBUG
/* information message: e.g., configuration, major event */ /* information message: e.g., configuration, major event */
extern int cifsFYI; extern int cifsFYI;
#define cifsfyi(format,arg...) if (cifsFYI & CIFS_INFO) printk(KERN_DEBUG " " __FILE__ ": " format "\n" "" , ## arg) #define cifsfyi(fmt, arg...) \
do { \
if (cifsFYI & CIFS_INFO) \
printk(KERN_DEBUG "%s: " fmt "\n", __FILE__, ##arg); \
} while (0)
#define cFYI(button,prspec) if (button) cifsfyi prspec #define cFYI(set, fmt, arg...) \
do { \
if (set) \
cifsfyi(fmt, ##arg); \
} while (0)
#define cifswarn(format, arg...) printk(KERN_WARNING ": " format "\n" , ## arg) #define cifswarn(fmt, arg...) \
printk(KERN_WARNING fmt "\n", ##arg)
/* debug event message: */ /* debug event message: */
extern int cifsERROR; extern int cifsERROR;
#define cEVENT(format,arg...) if (cifsERROR) printk(KERN_EVENT __FILE__ ": " format "\n" , ## arg) #define cEVENT(fmt, arg...) \
do { \
if (cifsERROR) \
printk(KERN_EVENT "%s: " fmt "\n", __FILE__, ##arg); \
} while (0)
/* error event message: e.g., i/o error */ /* error event message: e.g., i/o error */
#define cifserror(format,arg...) if (cifsERROR) printk(KERN_ERR " CIFS VFS: " format "\n" "" , ## arg) #define cifserror(fmt, arg...) \
do { \
if (cifsERROR) \
printk(KERN_ERR "CIFS VFS: " fmt "\n", ##arg); \
} while (0)
#define cERROR(button, prspec) if (button) cifserror prspec #define cERROR(set, fmt, arg...) \
do { \
if (set) \
cifserror(fmt, ##arg); \
} while (0)
/* /*
* debug OFF * debug OFF
* --------- * ---------
*/ */
#else /* _CIFS_DEBUG */ #else /* _CIFS_DEBUG */
#define cERROR(button, prspec) #define cERROR(set, fmt, arg...)
#define cEVENT(format, arg...) #define cEVENT(fmt, arg...)
#define cFYI(button, prspec) #define cFYI(set, fmt, arg...)
#define cifserror(format, arg...) #define cifserror(fmt, arg...)
#endif /* _CIFS_DEBUG */ #endif /* _CIFS_DEBUG */
#endif /* _H_CIFS_DEBUG */ #endif /* _H_CIFS_DEBUG */

View File

@ -85,8 +85,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", cERROR(1, "%s: no server name end in node name: %s",
__func__, node_name)); __func__, node_name);
kfree(UNC); kfree(UNC);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
@ -142,8 +142,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) {
cERROR(1, ("%s: Failed to resolve server part of %s to IP: %d", cERROR(1, "%s: Failed to resolve server part of %s to IP: %d",
__func__, *devname, rc)); __func__, *devname, rc);
goto compose_mount_options_err; goto compose_mount_options_err;
} }
/* md_len = strlen(...) + 12 for 'sep+prefixpath=' /* md_len = strlen(...) + 12 for 'sep+prefixpath='
@ -217,8 +217,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));*/ /*cFYI(1, "%s: parent mountdata: %s", __func__,sb_mountdata);*/
/*cFYI(1, ("%s: submount mountdata: %s", __func__, mountdata ));*/ /*cFYI(1, "%s: submount mountdata: %s", __func__, mountdata );*/
compose_mount_options_out: compose_mount_options_out:
kfree(srvIP); kfree(srvIP);
@ -294,11 +294,11 @@ static int add_mount_helper(struct vfsmount *newmnt, struct nameidata *nd,
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)); cFYI(1, "DFS: ref path: %s", ref->path_name);
cFYI(1, ("DFS: node path: %s", ref->node_name)); cFYI(1, "DFS: node path: %s", ref->node_name);
cFYI(1, ("DFS: fl: %hd, srv_type: %hd", ref->flags, ref->server_type)); cFYI(1, "DFS: fl: %hd, srv_type: %hd", ref->flags, ref->server_type);
cFYI(1, ("DFS: ref_flags: %hd, path_consumed: %hd", ref->ref_flag, cFYI(1, "DFS: ref_flags: %hd, path_consumed: %hd", ref->ref_flag,
ref->path_consumed)); ref->path_consumed);
} }
@ -314,7 +314,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
int rc = 0; int rc = 0;
struct vfsmount *mnt = ERR_PTR(-ENOENT); struct vfsmount *mnt = ERR_PTR(-ENOENT);
cFYI(1, ("in %s", __func__)); cFYI(1, "in %s", __func__);
BUG_ON(IS_ROOT(dentry)); BUG_ON(IS_ROOT(dentry));
xid = GetXid(); xid = GetXid();
@ -352,15 +352,15 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
/* 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", cERROR(1, "%s: Net Address path too short: %s",
__func__, referrals[i].node_name)); __func__, referrals[i].node_name);
rc = -EINVAL; rc = -EINVAL;
goto out_err; goto out_err;
} }
mnt = cifs_dfs_do_refmount(nd->path.mnt, mnt = cifs_dfs_do_refmount(nd->path.mnt,
nd->path.dentry, referrals + i); nd->path.dentry, referrals + i);
cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__,
referrals[i].node_name, mnt)); referrals[i].node_name, mnt);
/* complete mount procedure if we accured submount */ /* complete mount procedure if we accured submount */
if (!IS_ERR(mnt)) if (!IS_ERR(mnt))
@ -378,7 +378,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
FreeXid(xid); FreeXid(xid);
free_dfs_info_array(referrals, num_referrals); free_dfs_info_array(referrals, num_referrals);
kfree(full_path); kfree(full_path);
cFYI(1, ("leaving %s" , __func__)); cFYI(1, "leaving %s" , __func__);
return ERR_PTR(rc); return ERR_PTR(rc);
out_err: out_err:
path_put(&nd->path); path_put(&nd->path);

View File

@ -149,7 +149,7 @@ cifs_get_spnego_key(struct cifsSesInfo *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)); cFYI(1, "key description = %s", 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

View File

@ -200,9 +200,8 @@ cifs_strtoUCS(__le16 *to, const char *from, int len,
/* works for 2.4.0 kernel or later */ /* works for 2.4.0 kernel or later */
charlen = codepage->char2uni(from, len, &wchar_to[i]); charlen = codepage->char2uni(from, len, &wchar_to[i]);
if (charlen < 1) { if (charlen < 1) {
cERROR(1, cERROR(1, "strtoUCS: char2uni of %d returned %d",
("strtoUCS: char2uni of %d returned %d", (int)*from, charlen);
(int)*from, charlen));
/* A question mark */ /* A question mark */
to[i] = cpu_to_le16(0x003f); to[i] = cpu_to_le16(0x003f);
charlen = 1; charlen = 1;

View File

@ -87,11 +87,11 @@ int match_sid(struct cifs_sid *ctsid)
continue; /* all sub_auth values do not match */ continue; /* all sub_auth values do not match */
} }
cFYI(1, ("matching sid: %s\n", wksidarr[i].sidname)); cFYI(1, "matching sid: %s\n", wksidarr[i].sidname);
return 0; /* sids compare/match */ return 0; /* sids compare/match */
} }
cFYI(1, ("No matching sid")); cFYI(1, "No matching sid");
return -1; return -1;
} }
@ -208,14 +208,14 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
*pbits_to_set &= ~S_IXUGO; *pbits_to_set &= ~S_IXUGO;
return; return;
} else if (type != ACCESS_ALLOWED) { } else if (type != ACCESS_ALLOWED) {
cERROR(1, ("unknown access control type %d", type)); cERROR(1, "unknown access control type %d", type);
return; return;
} }
/* else ACCESS_ALLOWED type */ /* else ACCESS_ALLOWED type */
if (flags & GENERIC_ALL) { if (flags & GENERIC_ALL) {
*pmode |= (S_IRWXUGO & (*pbits_to_set)); *pmode |= (S_IRWXUGO & (*pbits_to_set));
cFYI(DBG2, ("all perms")); cFYI(DBG2, "all perms");
return; return;
} }
if ((flags & GENERIC_WRITE) || if ((flags & GENERIC_WRITE) ||
@ -228,7 +228,7 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS)) ((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS))
*pmode |= (S_IXUGO & (*pbits_to_set)); *pmode |= (S_IXUGO & (*pbits_to_set));
cFYI(DBG2, ("access flags 0x%x mode now 0x%x", flags, *pmode)); cFYI(DBG2, "access flags 0x%x mode now 0x%x", flags, *pmode);
return; return;
} }
@ -257,7 +257,7 @@ static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
if (mode & S_IXUGO) if (mode & S_IXUGO)
*pace_flags |= SET_FILE_EXEC_RIGHTS; *pace_flags |= SET_FILE_EXEC_RIGHTS;
cFYI(DBG2, ("mode: 0x%x, access flags now 0x%x", mode, *pace_flags)); cFYI(DBG2, "mode: 0x%x, access flags now 0x%x", mode, *pace_flags);
return; return;
} }
@ -297,24 +297,24 @@ static void dump_ace(struct cifs_ace *pace, char *end_of_acl)
/* validate that we do not go past end of acl */ /* validate that we do not go past end of acl */
if (le16_to_cpu(pace->size) < 16) { if (le16_to_cpu(pace->size) < 16) {
cERROR(1, ("ACE too small, %d", le16_to_cpu(pace->size))); cERROR(1, "ACE too small %d", le16_to_cpu(pace->size));
return; return;
} }
if (end_of_acl < (char *)pace + le16_to_cpu(pace->size)) { if (end_of_acl < (char *)pace + le16_to_cpu(pace->size)) {
cERROR(1, ("ACL too small to parse ACE")); cERROR(1, "ACL too small to parse ACE");
return; return;
} }
num_subauth = pace->sid.num_subauth; num_subauth = pace->sid.num_subauth;
if (num_subauth) { if (num_subauth) {
int i; int i;
cFYI(1, ("ACE revision %d num_auth %d type %d flags %d size %d", cFYI(1, "ACE revision %d num_auth %d type %d flags %d size %d",
pace->sid.revision, pace->sid.num_subauth, pace->type, pace->sid.revision, pace->sid.num_subauth, pace->type,
pace->flags, le16_to_cpu(pace->size))); pace->flags, le16_to_cpu(pace->size));
for (i = 0; i < num_subauth; ++i) { for (i = 0; i < num_subauth; ++i) {
cFYI(1, ("ACE sub_auth[%d]: 0x%x", i, cFYI(1, "ACE sub_auth[%d]: 0x%x", i,
le32_to_cpu(pace->sid.sub_auth[i]))); le32_to_cpu(pace->sid.sub_auth[i]));
} }
/* BB add length check to make sure that we do not have huge /* BB add length check to make sure that we do not have huge
@ -347,13 +347,13 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
/* validate that we do not go past end of acl */ /* validate that we do not go past end of acl */
if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) { if (end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {
cERROR(1, ("ACL too small to parse DACL")); cERROR(1, "ACL too small to parse DACL");
return; return;
} }
cFYI(DBG2, ("DACL revision %d size %d num aces %d", cFYI(DBG2, "DACL revision %d size %d num aces %d",
le16_to_cpu(pdacl->revision), le16_to_cpu(pdacl->size), le16_to_cpu(pdacl->revision), le16_to_cpu(pdacl->size),
le32_to_cpu(pdacl->num_aces))); le32_to_cpu(pdacl->num_aces));
/* reset rwx permissions for user/group/other. /* reset rwx permissions for user/group/other.
Also, if num_aces is 0 i.e. DACL has no ACEs, Also, if num_aces is 0 i.e. DACL has no ACEs,
@ -437,25 +437,25 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl)
/* validate that we do not go past end of ACL - sid must be at least 8 /* validate that we do not go past end of ACL - sid must be at least 8
bytes long (assuming no sub-auths - e.g. the null SID */ bytes long (assuming no sub-auths - e.g. the null SID */
if (end_of_acl < (char *)psid + 8) { if (end_of_acl < (char *)psid + 8) {
cERROR(1, ("ACL too small to parse SID %p", psid)); cERROR(1, "ACL too small to parse SID %p", psid);
return -EINVAL; return -EINVAL;
} }
if (psid->num_subauth) { if (psid->num_subauth) {
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
int i; int i;
cFYI(1, ("SID revision %d num_auth %d", cFYI(1, "SID revision %d num_auth %d",
psid->revision, psid->num_subauth)); psid->revision, psid->num_subauth);
for (i = 0; i < psid->num_subauth; i++) { for (i = 0; i < psid->num_subauth; i++) {
cFYI(1, ("SID sub_auth[%d]: 0x%x ", i, cFYI(1, "SID sub_auth[%d]: 0x%x ", i,
le32_to_cpu(psid->sub_auth[i]))); le32_to_cpu(psid->sub_auth[i]));
} }
/* BB add length check to make sure that we do not have huge /* BB add length check to make sure that we do not have huge
num auths and therefore go off the end */ num auths and therefore go off the end */
cFYI(1, ("RID 0x%x", cFYI(1, "RID 0x%x",
le32_to_cpu(psid->sub_auth[psid->num_subauth-1]))); le32_to_cpu(psid->sub_auth[psid->num_subauth-1]));
#endif #endif
} }
@ -482,11 +482,11 @@ static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,
le32_to_cpu(pntsd->gsidoffset)); le32_to_cpu(pntsd->gsidoffset));
dacloffset = le32_to_cpu(pntsd->dacloffset); dacloffset = le32_to_cpu(pntsd->dacloffset);
dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset); dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);
cFYI(DBG2, ("revision %d type 0x%x ooffset 0x%x goffset 0x%x " cFYI(DBG2, "revision %d type 0x%x ooffset 0x%x goffset 0x%x "
"sacloffset 0x%x dacloffset 0x%x", "sacloffset 0x%x dacloffset 0x%x",
pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset), pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset),
le32_to_cpu(pntsd->gsidoffset), le32_to_cpu(pntsd->gsidoffset),
le32_to_cpu(pntsd->sacloffset), dacloffset)); le32_to_cpu(pntsd->sacloffset), dacloffset);
/* cifs_dump_mem("owner_sid: ", owner_sid_ptr, 64); */ /* cifs_dump_mem("owner_sid: ", owner_sid_ptr, 64); */
rc = parse_sid(owner_sid_ptr, end_of_acl); rc = parse_sid(owner_sid_ptr, end_of_acl);
if (rc) if (rc)
@ -500,7 +500,7 @@ static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,
parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr, parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr,
group_sid_ptr, fattr); group_sid_ptr, fattr);
else else
cFYI(1, ("no ACL")); /* BB grant all or default perms? */ cFYI(1, "no ACL"); /* BB grant all or default perms? */
/* cifscred->uid = owner_sid_ptr->rid; /* cifscred->uid = owner_sid_ptr->rid;
cifscred->gid = group_sid_ptr->rid; cifscred->gid = group_sid_ptr->rid;
@ -563,7 +563,7 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
FreeXid(xid); FreeXid(xid);
cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen)); cFYI(1, "GetCIFSACL rc = %d ACL len %d", rc, *pacllen);
return pntsd; return pntsd;
} }
@ -581,12 +581,12 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
&fid, &oplock, NULL, cifs_sb->local_nls, &fid, &oplock, NULL, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc) { if (rc) {
cERROR(1, ("Unable to open file to get ACL")); cERROR(1, "Unable to open file to get ACL");
goto out; goto out;
} }
rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen); rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen);
cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen)); cFYI(1, "GetCIFSACL rc = %d ACL len %d", rc, *pacllen);
CIFSSMBClose(xid, cifs_sb->tcon, fid); CIFSSMBClose(xid, cifs_sb->tcon, fid);
out: out:
@ -621,7 +621,7 @@ static int set_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb, __u16 fid,
rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen); rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen);
FreeXid(xid); FreeXid(xid);
cFYI(DBG2, ("SetCIFSACL rc = %d", rc)); cFYI(DBG2, "SetCIFSACL rc = %d", rc);
return rc; return rc;
} }
@ -638,12 +638,12 @@ static int set_cifs_acl_by_path(struct cifs_sb_info *cifs_sb, const char *path,
&fid, &oplock, NULL, cifs_sb->local_nls, &fid, &oplock, NULL, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc) { if (rc) {
cERROR(1, ("Unable to open file to set ACL")); cERROR(1, "Unable to open file to set ACL");
goto out; goto out;
} }
rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen); rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen);
cFYI(DBG2, ("SetCIFSACL rc = %d", rc)); cFYI(DBG2, "SetCIFSACL rc = %d", rc);
CIFSSMBClose(xid, cifs_sb->tcon, fid); CIFSSMBClose(xid, cifs_sb->tcon, fid);
out: out:
@ -659,7 +659,7 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
struct cifsFileInfo *open_file; struct cifsFileInfo *open_file;
int rc; int rc;
cFYI(DBG2, ("set ACL for %s from mode 0x%x", path, inode->i_mode)); cFYI(DBG2, "set ACL for %s from mode 0x%x", path, inode->i_mode);
open_file = find_readable_file(CIFS_I(inode)); open_file = find_readable_file(CIFS_I(inode));
if (!open_file) if (!open_file)
@ -679,7 +679,7 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
u32 acllen = 0; u32 acllen = 0;
int rc = 0; int rc = 0;
cFYI(DBG2, ("converting ACL to mode for %s", path)); cFYI(DBG2, "converting ACL to mode for %s", path);
if (pfid) if (pfid)
pntsd = get_cifs_acl_by_fid(cifs_sb, *pfid, &acllen); pntsd = get_cifs_acl_by_fid(cifs_sb, *pfid, &acllen);
@ -690,7 +690,7 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
if (pntsd) if (pntsd)
rc = parse_sec_desc(pntsd, acllen, fattr); rc = parse_sec_desc(pntsd, acllen, fattr);
if (rc) if (rc)
cFYI(1, ("parse sec desc failed rc = %d", rc)); cFYI(1, "parse sec desc failed rc = %d", rc);
kfree(pntsd); kfree(pntsd);
return; return;
@ -704,7 +704,7 @@ int mode_to_acl(struct inode *inode, const char *path, __u64 nmode)
struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */ struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */
struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */ struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
cFYI(DBG2, ("set ACL from mode for %s", path)); cFYI(DBG2, "set ACL from mode for %s", path);
/* Get the security descriptor */ /* Get the security descriptor */
pntsd = get_cifs_acl(CIFS_SB(inode->i_sb), inode, path, &secdesclen); pntsd = get_cifs_acl(CIFS_SB(inode->i_sb), inode, path, &secdesclen);
@ -721,19 +721,19 @@ int mode_to_acl(struct inode *inode, const char *path, __u64 nmode)
DEFSECDESCLEN : secdesclen; DEFSECDESCLEN : secdesclen;
pnntsd = kmalloc(secdesclen, GFP_KERNEL); pnntsd = kmalloc(secdesclen, GFP_KERNEL);
if (!pnntsd) { if (!pnntsd) {
cERROR(1, ("Unable to allocate security descriptor")); cERROR(1, "Unable to allocate security descriptor");
kfree(pntsd); kfree(pntsd);
return -ENOMEM; return -ENOMEM;
} }
rc = build_sec_desc(pntsd, pnntsd, inode, nmode); rc = build_sec_desc(pntsd, pnntsd, inode, nmode);
cFYI(DBG2, ("build_sec_desc rc: %d", rc)); cFYI(DBG2, "build_sec_desc rc: %d", rc);
if (!rc) { if (!rc) {
/* Set the security descriptor */ /* Set the security descriptor */
rc = set_cifs_acl(pnntsd, secdesclen, inode, path); rc = set_cifs_acl(pnntsd, secdesclen, inode, path);
cFYI(DBG2, ("set_cifs_acl rc: %d", rc)); cFYI(DBG2, "set_cifs_acl rc: %d", rc);
} }
kfree(pnntsd); kfree(pnntsd);

View File

@ -103,7 +103,7 @@ static int cifs_calc_signature2(const struct kvec *iov, int n_vec,
if (iov[i].iov_len == 0) if (iov[i].iov_len == 0)
continue; continue;
if (iov[i].iov_base == NULL) { if (iov[i].iov_base == NULL) {
cERROR(1, ("null iovec entry")); cERROR(1, "null iovec entry");
return -EIO; return -EIO;
} }
/* The first entry includes a length field (which does not get /* The first entry includes a length field (which does not get
@ -181,8 +181,8 @@ int cifs_verify_signature(struct smb_hdr *cifs_pdu,
/* Do not need to verify session setups with signature "BSRSPYL " */ /* Do not need to verify session setups with signature "BSRSPYL " */
if (memcmp(cifs_pdu->Signature.SecuritySignature, "BSRSPYL ", 8) == 0) if (memcmp(cifs_pdu->Signature.SecuritySignature, "BSRSPYL ", 8) == 0)
cFYI(1, ("dummy signature received for smb command 0x%x", cFYI(1, "dummy signature received for smb command 0x%x",
cifs_pdu->Command)); cifs_pdu->Command);
/* save off the origiginal signature so we can modify the smb and check /* save off the origiginal signature so we can modify the smb and check
its signature against what the server sent */ its signature against what the server sent */
@ -398,7 +398,7 @@ void setup_ntlmv2_rsp(struct cifsSesInfo *ses, char *resp_buf,
/* calculate buf->ntlmv2_hash */ /* calculate buf->ntlmv2_hash */
rc = calc_ntlmv2_hash(ses, nls_cp); rc = calc_ntlmv2_hash(ses, nls_cp);
if (rc) if (rc)
cERROR(1, ("could not get v2 hash rc %d", rc)); cERROR(1, "could not get v2 hash rc %d", rc);
CalcNTLMv2_response(ses, resp_buf); CalcNTLMv2_response(ses, resp_buf);
/* now calculate the MAC key for NTLMv2 */ /* now calculate the MAC key for NTLMv2 */

View File

@ -128,8 +128,7 @@ cifs_read_super(struct super_block *sb, void *data,
if (rc) { if (rc) {
if (!silent) if (!silent)
cERROR(1, cERROR(1, "cifs_mount failed w/return code = %d", rc);
("cifs_mount failed w/return code = %d", rc));
goto out_mount_failed; goto out_mount_failed;
} }
@ -160,7 +159,7 @@ cifs_read_super(struct super_block *sb, void *data,
#ifdef CONFIG_CIFS_EXPERIMENTAL #ifdef CONFIG_CIFS_EXPERIMENTAL
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")); cFYI(1, "export ops supported");
sb->s_export_op = &cifs_export_ops; sb->s_export_op = &cifs_export_ops;
} }
#endif /* EXPERIMENTAL */ #endif /* EXPERIMENTAL */
@ -168,7 +167,7 @@ cifs_read_super(struct super_block *sb, void *data,
return 0; return 0;
out_no_root: out_no_root:
cERROR(1, ("cifs_read_super: get root inode failed")); cERROR(1, "cifs_read_super: get root inode failed");
if (inode) if (inode)
iput(inode); iput(inode);
@ -194,10 +193,10 @@ cifs_put_super(struct super_block *sb)
int rc = 0; int rc = 0;
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
cFYI(1, ("In cifs_put_super")); cFYI(1, "In cifs_put_super");
cifs_sb = CIFS_SB(sb); cifs_sb = CIFS_SB(sb);
if (cifs_sb == NULL) { if (cifs_sb == NULL) {
cFYI(1, ("Empty cifs superblock info passed to unmount")); cFYI(1, "Empty cifs superblock info passed to unmount");
return; return;
} }
@ -205,7 +204,7 @@ cifs_put_super(struct super_block *sb)
rc = cifs_umount(sb, cifs_sb); rc = cifs_umount(sb, cifs_sb);
if (rc) if (rc)
cERROR(1, ("cifs_umount failed with return code %d", rc)); cERROR(1, "cifs_umount failed with return code %d", rc);
#ifdef CONFIG_CIFS_DFS_UPCALL #ifdef CONFIG_CIFS_DFS_UPCALL
if (cifs_sb->mountdata) { if (cifs_sb->mountdata) {
kfree(cifs_sb->mountdata); kfree(cifs_sb->mountdata);
@ -439,7 +438,7 @@ int cifs_xquota_set(struct super_block *sb, int quota_type, qid_t qid,
xid = GetXid(); xid = GetXid();
if (pTcon) { if (pTcon) {
cFYI(1, ("set type: 0x%x id: %d", quota_type, qid)); cFYI(1, "set type: 0x%x id: %d", quota_type, qid);
} else } else
rc = -EIO; rc = -EIO;
@ -462,7 +461,7 @@ int cifs_xquota_get(struct super_block *sb, int quota_type, qid_t qid,
xid = GetXid(); xid = GetXid();
if (pTcon) { if (pTcon) {
cFYI(1, ("set type: 0x%x id: %d", quota_type, qid)); cFYI(1, "set type: 0x%x id: %d", quota_type, qid);
} else } else
rc = -EIO; rc = -EIO;
@ -484,7 +483,7 @@ int cifs_xstate_set(struct super_block *sb, unsigned int flags, int operation)
xid = GetXid(); xid = GetXid();
if (pTcon) { if (pTcon) {
cFYI(1, ("flags: 0x%x operation: 0x%x", flags, operation)); cFYI(1, "flags: 0x%x operation: 0x%x", flags, operation);
} else } else
rc = -EIO; rc = -EIO;
@ -506,7 +505,7 @@ int cifs_xstate_get(struct super_block *sb, struct fs_quota_stat *qstats)
xid = GetXid(); xid = GetXid();
if (pTcon) { if (pTcon) {
cFYI(1, ("pqstats %p", qstats)); cFYI(1, "pqstats %p", qstats);
} else } else
rc = -EIO; rc = -EIO;
@ -548,7 +547,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")); cFYI(1, "wake up tasks now - umount begin not complete");
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 */
@ -599,7 +598,7 @@ cifs_get_sb(struct file_system_type *fs_type,
int rc; int rc;
struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL); struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL);
cFYI(1, ("Devname: %s flags: %d ", dev_name, flags)); cFYI(1, "Devname: %s flags: %d ", dev_name, flags);
if (IS_ERR(sb)) if (IS_ERR(sb))
return PTR_ERR(sb); return PTR_ERR(sb);
@ -868,7 +867,7 @@ 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)); */ /* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */
cifs_req_cachep = kmem_cache_create("cifs_request", cifs_req_cachep = kmem_cache_create("cifs_request",
CIFSMaxBufSize + CIFSMaxBufSize +
MAX_CIFS_HDR_SIZE, 0, MAX_CIFS_HDR_SIZE, 0,
@ -880,7 +879,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)")); cERROR(1, "cifs_min_rcv set to maximum (64)");
} }
cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv, cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
@ -911,7 +910,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)")); cFYI(1, "cifs_min_small set to maximum (256)");
} }
cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small, cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small,
@ -1009,10 +1008,10 @@ 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")); cFYI(1, "cifs_max_pending set to min of 2");
} else if (cifs_max_pending > 256) { } else if (cifs_max_pending > 256) {
cifs_max_pending = 256; cifs_max_pending = 256;
cFYI(1, ("cifs_max_pending set to max of 256")); cFYI(1, "cifs_max_pending set to max of 256");
} }
rc = cifs_init_inodecache(); rc = cifs_init_inodecache();
@ -1070,7 +1069,7 @@ init_cifs(void)
static void __exit static void __exit
exit_cifs(void) exit_cifs(void)
{ {
cFYI(DBG2, ("exit_cifs")); cFYI(DBG2, "exit_cifs");
cifs_proc_clean(); cifs_proc_clean();
#ifdef CONFIG_CIFS_DFS_UPCALL #ifdef CONFIG_CIFS_DFS_UPCALL
cifs_dfs_release_automount_timer(); cifs_dfs_release_automount_timer();

View File

@ -39,8 +39,20 @@ extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
unsigned int /* length */); unsigned int /* length */);
extern unsigned int _GetXid(void); extern unsigned int _GetXid(void);
extern void _FreeXid(unsigned int); extern void _FreeXid(unsigned int);
#define GetXid() (int)_GetXid(); cFYI(1,("CIFS VFS: in %s as Xid: %d with uid: %d",__func__, xid,current_fsuid())); #define GetXid() \
#define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__func__,curr_xid,(int)rc));} ({ \
int __xid = (int)_GetXid(); \
cFYI(1, "CIFS VFS: in %s as Xid: %d with uid: %d", \
__func__, __xid, current_fsuid()); \
__xid; \
})
#define FreeXid(curr_xid) \
do { \
_FreeXid(curr_xid); \
cFYI(1, "CIFS VFS: leaving %s (xid = %d) rc = %d", \
__func__, curr_xid, (int)rc); \
} while (0)
extern char *build_path_from_dentry(struct dentry *); extern char *build_path_from_dentry(struct dentry *);
extern char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb); extern char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb);
extern char *build_wildcard_path_from_dentry(struct dentry *direntry); extern char *build_wildcard_path_from_dentry(struct dentry *direntry);

File diff suppressed because it is too large Load Diff

View File

@ -135,7 +135,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
server->maxBuf = 0; server->maxBuf = 0;
cFYI(1, ("Reconnecting tcp session")); cFYI(1, "Reconnecting tcp session");
/* before reconnecting the tcp session, mark the smb session (uid) /* before reconnecting the tcp session, mark the smb session (uid)
and the tid bad so they are not used until reconnected */ and the tid bad so they are not used until reconnected */
@ -153,12 +153,12 @@ cifs_reconnect(struct TCP_Server_Info *server)
/* do not want to be sending data on a socket we are freeing */ /* do not want to be sending data on a socket we are freeing */
mutex_lock(&server->srv_mutex); mutex_lock(&server->srv_mutex);
if (server->ssocket) { if (server->ssocket) {
cFYI(1, ("State: 0x%x Flags: 0x%lx", server->ssocket->state, cFYI(1, "State: 0x%x Flags: 0x%lx", server->ssocket->state,
server->ssocket->flags)); server->ssocket->flags);
kernel_sock_shutdown(server->ssocket, SHUT_WR); kernel_sock_shutdown(server->ssocket, SHUT_WR);
cFYI(1, ("Post shutdown state: 0x%x Flags: 0x%lx", cFYI(1, "Post shutdown state: 0x%x Flags: 0x%lx",
server->ssocket->state, server->ssocket->state,
server->ssocket->flags)); server->ssocket->flags);
sock_release(server->ssocket); sock_release(server->ssocket);
server->ssocket = NULL; server->ssocket = NULL;
} }
@ -187,7 +187,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
else else
rc = ipv4_connect(server); rc = ipv4_connect(server);
if (rc) { if (rc) {
cFYI(1, ("reconnect error %d", rc)); cFYI(1, "reconnect error %d", rc);
msleep(3000); msleep(3000);
} else { } else {
atomic_inc(&tcpSesReconnectCount); atomic_inc(&tcpSesReconnectCount);
@ -223,7 +223,7 @@ static int check2ndT2(struct smb_hdr *pSMB, unsigned int maxBufSize)
/* check for plausible wct, bcc and t2 data and parm sizes */ /* check for plausible wct, bcc and t2 data and parm sizes */
/* check for parm and data offset going beyond end of smb */ /* check for parm and data offset going beyond end of smb */
if (pSMB->WordCount != 10) { /* coalesce_t2 depends on this */ if (pSMB->WordCount != 10) { /* coalesce_t2 depends on this */
cFYI(1, ("invalid transact2 word count")); cFYI(1, "invalid transact2 word count");
return -EINVAL; return -EINVAL;
} }
@ -237,15 +237,15 @@ static int check2ndT2(struct smb_hdr *pSMB, unsigned int maxBufSize)
if (remaining == 0) if (remaining == 0)
return 0; return 0;
else if (remaining < 0) { else if (remaining < 0) {
cFYI(1, ("total data %d smaller than data in frame %d", cFYI(1, "total data %d smaller than data in frame %d",
total_data_size, data_in_this_rsp)); total_data_size, data_in_this_rsp);
return -EINVAL; return -EINVAL;
} else { } else {
cFYI(1, ("missing %d bytes from transact2, check next response", cFYI(1, "missing %d bytes from transact2, check next response",
remaining)); remaining);
if (total_data_size > maxBufSize) { if (total_data_size > maxBufSize) {
cERROR(1, ("TotalDataSize %d is over maximum buffer %d", cERROR(1, "TotalDataSize %d is over maximum buffer %d",
total_data_size, maxBufSize)); total_data_size, maxBufSize);
return -EINVAL; return -EINVAL;
} }
return remaining; return remaining;
@ -267,7 +267,7 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
total_data_size = le16_to_cpu(pSMBt->t2_rsp.TotalDataCount); total_data_size = le16_to_cpu(pSMBt->t2_rsp.TotalDataCount);
if (total_data_size != le16_to_cpu(pSMB2->t2_rsp.TotalDataCount)) { if (total_data_size != le16_to_cpu(pSMB2->t2_rsp.TotalDataCount)) {
cFYI(1, ("total data size of primary and secondary t2 differ")); cFYI(1, "total data size of primary and secondary t2 differ");
} }
total_in_buf = le16_to_cpu(pSMBt->t2_rsp.DataCount); total_in_buf = le16_to_cpu(pSMBt->t2_rsp.DataCount);
@ -282,7 +282,7 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
total_in_buf2 = le16_to_cpu(pSMB2->t2_rsp.DataCount); total_in_buf2 = le16_to_cpu(pSMB2->t2_rsp.DataCount);
if (remaining < total_in_buf2) { if (remaining < total_in_buf2) {
cFYI(1, ("transact2 2nd response contains too much data")); cFYI(1, "transact2 2nd response contains too much data");
} }
/* find end of first SMB data area */ /* find end of first SMB data area */
@ -311,7 +311,7 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
pTargetSMB->smb_buf_length = byte_count; pTargetSMB->smb_buf_length = byte_count;
if (remaining == total_in_buf2) { if (remaining == total_in_buf2) {
cFYI(1, ("found the last secondary response")); cFYI(1, "found the last secondary response");
return 0; /* we are done */ return 0; /* we are done */
} else /* more responses to go */ } else /* more responses to go */
return 1; return 1;
@ -339,7 +339,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
int reconnect; int reconnect;
current->flags |= PF_MEMALLOC; current->flags |= PF_MEMALLOC;
cFYI(1, ("Demultiplex PID: %d", task_pid_nr(current))); cFYI(1, "Demultiplex PID: %d", task_pid_nr(current));
length = atomic_inc_return(&tcpSesAllocCount); length = atomic_inc_return(&tcpSesAllocCount);
if (length > 1) if (length > 1)
@ -353,7 +353,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
if (bigbuf == NULL) { if (bigbuf == NULL) {
bigbuf = cifs_buf_get(); bigbuf = cifs_buf_get();
if (!bigbuf) { if (!bigbuf) {
cERROR(1, ("No memory for large SMB response")); cERROR(1, "No memory for large SMB response");
msleep(3000); msleep(3000);
/* retry will check if exiting */ /* retry will check if exiting */
continue; continue;
@ -366,7 +366,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
if (smallbuf == NULL) { if (smallbuf == NULL) {
smallbuf = cifs_small_buf_get(); smallbuf = cifs_small_buf_get();
if (!smallbuf) { if (!smallbuf) {
cERROR(1, ("No memory for SMB response")); cERROR(1, "No memory for SMB response");
msleep(1000); msleep(1000);
/* retry will check if exiting */ /* retry will check if exiting */
continue; continue;
@ -391,9 +391,9 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
if (server->tcpStatus == CifsExiting) { if (server->tcpStatus == CifsExiting) {
break; break;
} else if (server->tcpStatus == CifsNeedReconnect) { } else if (server->tcpStatus == CifsNeedReconnect) {
cFYI(1, ("Reconnect after server stopped responding")); cFYI(1, "Reconnect after server stopped responding");
cifs_reconnect(server); cifs_reconnect(server);
cFYI(1, ("call to reconnect done")); cFYI(1, "call to reconnect done");
csocket = server->ssocket; csocket = server->ssocket;
continue; continue;
} else if ((length == -ERESTARTSYS) || (length == -EAGAIN)) { } else if ((length == -ERESTARTSYS) || (length == -EAGAIN)) {
@ -411,7 +411,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
continue; continue;
} else if (length <= 0) { } else if (length <= 0) {
if (server->tcpStatus == CifsNew) { if (server->tcpStatus == CifsNew) {
cFYI(1, ("tcp session abend after SMBnegprot")); cFYI(1, "tcp session abend after SMBnegprot");
/* some servers kill the TCP session rather than /* some servers kill the TCP session rather than
returning an SMB negprot error, in which returning an SMB negprot error, in which
case reconnecting here is not going to help, case reconnecting here is not going to help,
@ -419,18 +419,18 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
break; break;
} }
if (!try_to_freeze() && (length == -EINTR)) { if (!try_to_freeze() && (length == -EINTR)) {
cFYI(1, ("cifsd thread killed")); cFYI(1, "cifsd thread killed");
break; break;
} }
cFYI(1, ("Reconnect after unexpected peek error %d", cFYI(1, "Reconnect after unexpected peek error %d",
length)); length);
cifs_reconnect(server); cifs_reconnect(server);
csocket = server->ssocket; csocket = server->ssocket;
wake_up(&server->response_q); wake_up(&server->response_q);
continue; continue;
} else if (length < pdu_length) { } else if (length < pdu_length) {
cFYI(1, ("requested %d bytes but only got %d bytes", cFYI(1, "requested %d bytes but only got %d bytes",
pdu_length, length)); pdu_length, length);
pdu_length -= length; pdu_length -= length;
msleep(1); msleep(1);
goto incomplete_rcv; goto incomplete_rcv;
@ -450,18 +450,18 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
pdu_length = be32_to_cpu((__force __be32)smb_buffer->smb_buf_length); pdu_length = be32_to_cpu((__force __be32)smb_buffer->smb_buf_length);
smb_buffer->smb_buf_length = pdu_length; smb_buffer->smb_buf_length = pdu_length;
cFYI(1, ("rfc1002 length 0x%x", pdu_length+4)); cFYI(1, "rfc1002 length 0x%x", pdu_length+4);
if (temp == (char) RFC1002_SESSION_KEEP_ALIVE) { if (temp == (char) RFC1002_SESSION_KEEP_ALIVE) {
continue; continue;
} else if (temp == (char)RFC1002_POSITIVE_SESSION_RESPONSE) { } else if (temp == (char)RFC1002_POSITIVE_SESSION_RESPONSE) {
cFYI(1, ("Good RFC 1002 session rsp")); cFYI(1, "Good RFC 1002 session rsp");
continue; continue;
} else if (temp == (char)RFC1002_NEGATIVE_SESSION_RESPONSE) { } else if (temp == (char)RFC1002_NEGATIVE_SESSION_RESPONSE) {
/* we get this from Windows 98 instead of /* we get this from Windows 98 instead of
an error on SMB negprot response */ an error on SMB negprot response */
cFYI(1, ("Negative RFC1002 Session Response Error 0x%x)", cFYI(1, "Negative RFC1002 Session Response Error 0x%x)",
pdu_length)); pdu_length);
if (server->tcpStatus == CifsNew) { if (server->tcpStatus == CifsNew) {
/* if nack on negprot (rather than /* if nack on negprot (rather than
ret of smb negprot error) reconnecting ret of smb negprot error) reconnecting
@ -484,7 +484,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
continue; continue;
} }
} else if (temp != (char) 0) { } else if (temp != (char) 0) {
cERROR(1, ("Unknown RFC 1002 frame")); cERROR(1, "Unknown RFC 1002 frame");
cifs_dump_mem(" Received Data: ", (char *)smb_buffer, cifs_dump_mem(" Received Data: ", (char *)smb_buffer,
length); length);
cifs_reconnect(server); cifs_reconnect(server);
@ -495,8 +495,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
/* else we have an SMB response */ /* else we have an SMB response */
if ((pdu_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) || if ((pdu_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) ||
(pdu_length < sizeof(struct smb_hdr) - 1 - 4)) { (pdu_length < sizeof(struct smb_hdr) - 1 - 4)) {
cERROR(1, ("Invalid size SMB length %d pdu_length %d", cERROR(1, "Invalid size SMB length %d pdu_length %d",
length, pdu_length+4)); length, pdu_length+4);
cifs_reconnect(server); cifs_reconnect(server);
csocket = server->ssocket; csocket = server->ssocket;
wake_up(&server->response_q); wake_up(&server->response_q);
@ -539,8 +539,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
length = 0; length = 0;
continue; continue;
} else if (length <= 0) { } else if (length <= 0) {
cERROR(1, ("Received no data, expecting %d", cERROR(1, "Received no data, expecting %d",
pdu_length - total_read)); pdu_length - total_read);
cifs_reconnect(server); cifs_reconnect(server);
csocket = server->ssocket; csocket = server->ssocket;
reconnect = 1; reconnect = 1;
@ -588,7 +588,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
} }
} else { } else {
if (!isLargeBuf) { if (!isLargeBuf) {
cERROR(1,("1st trans2 resp needs bigbuf")); cERROR(1, "1st trans2 resp needs bigbuf");
/* BB maybe we can fix this up, switch /* BB maybe we can fix this up, switch
to already allocated large buffer? */ to already allocated large buffer? */
} else { } else {
@ -630,8 +630,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
wake_up_process(task_to_wake); wake_up_process(task_to_wake);
} else if (!is_valid_oplock_break(smb_buffer, server) && } else if (!is_valid_oplock_break(smb_buffer, server) &&
!isMultiRsp) { !isMultiRsp) {
cERROR(1, ("No task to wake, unknown frame received! " cERROR(1, "No task to wake, unknown frame received! "
"NumMids %d", midCount.counter)); "NumMids %d", midCount.counter);
cifs_dump_mem("Received Data is: ", (char *)smb_buffer, cifs_dump_mem("Received Data is: ", (char *)smb_buffer,
sizeof(struct smb_hdr)); sizeof(struct smb_hdr));
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
@ -708,8 +708,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
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);
if (mid_entry->midState == MID_REQUEST_SUBMITTED) { if (mid_entry->midState == MID_REQUEST_SUBMITTED) {
cFYI(1, ("Clearing Mid 0x%x - waking up ", cFYI(1, "Clearing Mid 0x%x - waking up ",
mid_entry->mid)); mid_entry->mid);
task_to_wake = mid_entry->tsk; task_to_wake = mid_entry->tsk;
if (task_to_wake) if (task_to_wake)
wake_up_process(task_to_wake); wake_up_process(task_to_wake);
@ -728,7 +728,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
to wait at least 45 seconds before giving up to wait at least 45 seconds before giving up
on a request getting a response and going ahead on a request getting a response and going ahead
and killing cifsd */ and killing cifsd */
cFYI(1, ("Wait for exit from demultiplex thread")); cFYI(1, "Wait for exit from demultiplex thread");
msleep(46000); msleep(46000);
/* if threads still have not exited they are probably never /* if threads still have not exited they are probably never
coming home not much else we can do but free the memory */ coming home not much else we can do but free the memory */
@ -849,7 +849,7 @@ cifs_parse_mount_options(char *options, const char *devname,
separator[0] = options[4]; separator[0] = options[4];
options += 5; options += 5;
} else { } else {
cFYI(1, ("Null separator not allowed")); cFYI(1, "Null separator not allowed");
} }
} }
@ -974,7 +974,7 @@ cifs_parse_mount_options(char *options, const char *devname,
} }
} else if (strnicmp(data, "sec", 3) == 0) { } else if (strnicmp(data, "sec", 3) == 0) {
if (!value || !*value) { if (!value || !*value) {
cERROR(1, ("no security value specified")); cERROR(1, "no security value specified");
continue; continue;
} else if (strnicmp(value, "krb5i", 5) == 0) { } else if (strnicmp(value, "krb5i", 5) == 0) {
vol->secFlg |= CIFSSEC_MAY_KRB5 | vol->secFlg |= CIFSSEC_MAY_KRB5 |
@ -982,7 +982,7 @@ cifs_parse_mount_options(char *options, const char *devname,
} else if (strnicmp(value, "krb5p", 5) == 0) { } else if (strnicmp(value, "krb5p", 5) == 0) {
/* vol->secFlg |= CIFSSEC_MUST_SEAL | /* vol->secFlg |= CIFSSEC_MUST_SEAL |
CIFSSEC_MAY_KRB5; */ CIFSSEC_MAY_KRB5; */
cERROR(1, ("Krb5 cifs privacy not supported")); cERROR(1, "Krb5 cifs privacy not supported");
return 1; return 1;
} else if (strnicmp(value, "krb5", 4) == 0) { } else if (strnicmp(value, "krb5", 4) == 0) {
vol->secFlg |= CIFSSEC_MAY_KRB5; vol->secFlg |= CIFSSEC_MAY_KRB5;
@ -1014,7 +1014,7 @@ cifs_parse_mount_options(char *options, const char *devname,
} else if (strnicmp(value, "none", 4) == 0) { } else if (strnicmp(value, "none", 4) == 0) {
vol->nullauth = 1; vol->nullauth = 1;
} else { } else {
cERROR(1, ("bad security option: %s", value)); cERROR(1, "bad security option: %s", value);
return 1; return 1;
} }
} else if ((strnicmp(data, "unc", 3) == 0) } else if ((strnicmp(data, "unc", 3) == 0)
@ -1053,7 +1053,7 @@ cifs_parse_mount_options(char *options, const char *devname,
a domain name and need special handling? */ a domain name and need special handling? */
if (strnlen(value, 256) < 256) { if (strnlen(value, 256) < 256) {
vol->domainname = value; vol->domainname = value;
cFYI(1, ("Domain name set")); cFYI(1, "Domain name set");
} else { } else {
printk(KERN_WARNING "CIFS: domain name too " printk(KERN_WARNING "CIFS: domain name too "
"long\n"); "long\n");
@ -1076,7 +1076,7 @@ cifs_parse_mount_options(char *options, const char *devname,
strcpy(vol->prepath+1, value); strcpy(vol->prepath+1, value);
} else } else
strcpy(vol->prepath, value); strcpy(vol->prepath, value);
cFYI(1, ("prefix path %s", vol->prepath)); cFYI(1, "prefix path %s", vol->prepath);
} else { } else {
printk(KERN_WARNING "CIFS: prefix too long\n"); printk(KERN_WARNING "CIFS: prefix too long\n");
return 1; return 1;
@ -1092,7 +1092,7 @@ cifs_parse_mount_options(char *options, const char *devname,
vol->iocharset = value; vol->iocharset = value;
/* if iocharset not set then load_nls_default /* if iocharset not set then load_nls_default
is used by caller */ is used by caller */
cFYI(1, ("iocharset set to %s", value)); cFYI(1, "iocharset set to %s", value);
} else { } else {
printk(KERN_WARNING "CIFS: iocharset name " printk(KERN_WARNING "CIFS: iocharset name "
"too long.\n"); "too long.\n");
@ -1144,14 +1144,14 @@ cifs_parse_mount_options(char *options, const char *devname,
} }
} else if (strnicmp(data, "sockopt", 5) == 0) { } else if (strnicmp(data, "sockopt", 5) == 0) {
if (!value || !*value) { if (!value || !*value) {
cERROR(1, ("no socket option specified")); cERROR(1, "no socket option specified");
continue; continue;
} else if (strnicmp(value, "TCP_NODELAY", 11) == 0) { } else if (strnicmp(value, "TCP_NODELAY", 11) == 0) {
vol->sockopt_tcp_nodelay = 1; vol->sockopt_tcp_nodelay = 1;
} }
} else if (strnicmp(data, "netbiosname", 4) == 0) { } else if (strnicmp(data, "netbiosname", 4) == 0) {
if (!value || !*value || (*value == ' ')) { if (!value || !*value || (*value == ' ')) {
cFYI(1, ("invalid (empty) netbiosname")); cFYI(1, "invalid (empty) netbiosname");
} else { } else {
memset(vol->source_rfc1001_name, 0x20, 15); memset(vol->source_rfc1001_name, 0x20, 15);
for (i = 0; i < 15; i++) { for (i = 0; i < 15; i++) {
@ -1175,7 +1175,7 @@ cifs_parse_mount_options(char *options, const char *devname,
} else if (strnicmp(data, "servern", 7) == 0) { } else if (strnicmp(data, "servern", 7) == 0) {
/* servernetbiosname specified override *SMBSERVER */ /* servernetbiosname specified override *SMBSERVER */
if (!value || !*value || (*value == ' ')) { if (!value || !*value || (*value == ' ')) {
cFYI(1, ("empty server netbiosname specified")); cFYI(1, "empty server netbiosname specified");
} else { } else {
/* last byte, type, is 0x20 for servr type */ /* last byte, type, is 0x20 for servr type */
memset(vol->target_rfc1001_name, 0x20, 16); memset(vol->target_rfc1001_name, 0x20, 16);
@ -1434,7 +1434,7 @@ cifs_find_tcp_session(struct sockaddr_storage *addr, unsigned short int port)
++server->srv_count; ++server->srv_count;
write_unlock(&cifs_tcp_ses_lock); write_unlock(&cifs_tcp_ses_lock);
cFYI(1, ("Existing tcp session with server found")); cFYI(1, "Existing tcp session with server found");
return server; return server;
} }
write_unlock(&cifs_tcp_ses_lock); write_unlock(&cifs_tcp_ses_lock);
@ -1475,7 +1475,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
memset(&addr, 0, sizeof(struct sockaddr_storage)); memset(&addr, 0, sizeof(struct sockaddr_storage));
cFYI(1, ("UNC: %s ip: %s", volume_info->UNC, volume_info->UNCip)); cFYI(1, "UNC: %s ip: %s", volume_info->UNC, volume_info->UNCip);
if (volume_info->UNCip && volume_info->UNC) { if (volume_info->UNCip && volume_info->UNC) {
rc = cifs_convert_address(volume_info->UNCip, &addr); rc = cifs_convert_address(volume_info->UNCip, &addr);
@ -1487,13 +1487,12 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
} else if (volume_info->UNCip) { } else if (volume_info->UNCip) {
/* BB using ip addr as tcp_ses name to connect to the /* BB using ip addr as tcp_ses name to connect to the
DFS root below */ DFS root below */
cERROR(1, ("Connecting to DFS root not implemented yet")); cERROR(1, "Connecting to DFS root not implemented yet");
rc = -EINVAL; rc = -EINVAL;
goto out_err; goto out_err;
} else /* which tcp_sess DFS root would we conect to */ { } else /* which tcp_sess DFS root would we conect to */ {
cERROR(1, cERROR(1, "CIFS mount error: No UNC path (e.g. -o "
("CIFS mount error: No UNC path (e.g. -o " "unc=//192.168.1.100/public) specified");
"unc=//192.168.1.100/public) specified"));
rc = -EINVAL; rc = -EINVAL;
goto out_err; goto out_err;
} }
@ -1540,7 +1539,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
++tcp_ses->srv_count; ++tcp_ses->srv_count;
if (addr.ss_family == AF_INET6) { if (addr.ss_family == AF_INET6) {
cFYI(1, ("attempting ipv6 connect")); cFYI(1, "attempting ipv6 connect");
/* BB should we allow ipv6 on port 139? */ /* BB should we allow ipv6 on port 139? */
/* other OS never observed in Wild doing 139 with v6 */ /* other OS never observed in Wild doing 139 with v6 */
sin_server6->sin6_port = htons(volume_info->port); sin_server6->sin6_port = htons(volume_info->port);
@ -1554,7 +1553,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
rc = ipv4_connect(tcp_ses); rc = ipv4_connect(tcp_ses);
} }
if (rc < 0) { if (rc < 0) {
cERROR(1, ("Error connecting to socket. Aborting operation")); cERROR(1, "Error connecting to socket. Aborting operation");
goto out_err; goto out_err;
} }
@ -1567,7 +1566,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
tcp_ses, "cifsd"); tcp_ses, "cifsd");
if (IS_ERR(tcp_ses->tsk)) { if (IS_ERR(tcp_ses->tsk)) {
rc = PTR_ERR(tcp_ses->tsk); rc = PTR_ERR(tcp_ses->tsk);
cERROR(1, ("error %d create cifsd thread", rc)); cERROR(1, "error %d create cifsd thread", rc);
module_put(THIS_MODULE); module_put(THIS_MODULE);
goto out_err; goto out_err;
} }
@ -1703,8 +1702,7 @@ get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path,
strcpy(temp_unc + 2, pSesInfo->serverName); strcpy(temp_unc + 2, pSesInfo->serverName);
strcpy(temp_unc + 2 + strlen(pSesInfo->serverName), "\\IPC$"); strcpy(temp_unc + 2 + strlen(pSesInfo->serverName), "\\IPC$");
rc = CIFSTCon(xid, pSesInfo, temp_unc, NULL, nls_codepage); rc = CIFSTCon(xid, pSesInfo, temp_unc, NULL, nls_codepage);
cFYI(1, cFYI(1, "CIFS Tcon rc = %d ipc_tid = %d", rc, pSesInfo->ipc_tid);
("CIFS Tcon rc = %d ipc_tid = %d", rc, pSesInfo->ipc_tid));
kfree(temp_unc); kfree(temp_unc);
} }
if (rc == 0) if (rc == 0)
@ -1777,12 +1775,12 @@ ipv4_connect(struct TCP_Server_Info *server)
rc = sock_create_kern(PF_INET, SOCK_STREAM, rc = sock_create_kern(PF_INET, SOCK_STREAM,
IPPROTO_TCP, &socket); IPPROTO_TCP, &socket);
if (rc < 0) { if (rc < 0) {
cERROR(1, ("Error %d creating socket", rc)); cERROR(1, "Error %d creating socket", rc);
return rc; return rc;
} }
/* BB other socket options to set KEEPALIVE, NODELAY? */ /* BB other socket options to set KEEPALIVE, NODELAY? */
cFYI(1, ("Socket created")); cFYI(1, "Socket created");
server->ssocket = socket; server->ssocket = socket;
socket->sk->sk_allocation = GFP_NOFS; socket->sk->sk_allocation = GFP_NOFS;
cifs_reclassify_socket4(socket); cifs_reclassify_socket4(socket);
@ -1827,7 +1825,7 @@ ipv4_connect(struct TCP_Server_Info *server)
if (!connected) { if (!connected) {
if (orig_port) if (orig_port)
server->addr.sockAddr.sin_port = orig_port; server->addr.sockAddr.sin_port = orig_port;
cFYI(1, ("Error %d connecting to server via ipv4", rc)); cFYI(1, "Error %d connecting to server via ipv4", rc);
sock_release(socket); sock_release(socket);
server->ssocket = NULL; server->ssocket = NULL;
return rc; return rc;
@ -1855,12 +1853,12 @@ ipv4_connect(struct TCP_Server_Info *server)
rc = kernel_setsockopt(socket, SOL_TCP, TCP_NODELAY, rc = kernel_setsockopt(socket, SOL_TCP, TCP_NODELAY,
(char *)&val, sizeof(val)); (char *)&val, sizeof(val));
if (rc) if (rc)
cFYI(1, ("set TCP_NODELAY socket option error %d", rc)); cFYI(1, "set TCP_NODELAY socket option error %d", rc);
} }
cFYI(1, ("sndbuf %d rcvbuf %d rcvtimeo 0x%lx", cFYI(1, "sndbuf %d rcvbuf %d rcvtimeo 0x%lx",
socket->sk->sk_sndbuf, socket->sk->sk_sndbuf,
socket->sk->sk_rcvbuf, socket->sk->sk_rcvtimeo)); socket->sk->sk_rcvbuf, socket->sk->sk_rcvtimeo);
/* send RFC1001 sessinit */ /* send RFC1001 sessinit */
if (server->addr.sockAddr.sin_port == htons(RFC1001_PORT)) { if (server->addr.sockAddr.sin_port == htons(RFC1001_PORT)) {
@ -1938,13 +1936,13 @@ ipv6_connect(struct TCP_Server_Info *server)
rc = sock_create_kern(PF_INET6, SOCK_STREAM, rc = sock_create_kern(PF_INET6, SOCK_STREAM,
IPPROTO_TCP, &socket); IPPROTO_TCP, &socket);
if (rc < 0) { if (rc < 0) {
cERROR(1, ("Error %d creating ipv6 socket", rc)); cERROR(1, "Error %d creating ipv6 socket", rc);
socket = NULL; socket = NULL;
return rc; return rc;
} }
/* BB other socket options to set KEEPALIVE, NODELAY? */ /* BB other socket options to set KEEPALIVE, NODELAY? */
cFYI(1, ("ipv6 Socket created")); cFYI(1, "ipv6 Socket created");
server->ssocket = socket; server->ssocket = socket;
socket->sk->sk_allocation = GFP_NOFS; socket->sk->sk_allocation = GFP_NOFS;
cifs_reclassify_socket6(socket); cifs_reclassify_socket6(socket);
@ -1988,7 +1986,7 @@ ipv6_connect(struct TCP_Server_Info *server)
if (!connected) { if (!connected) {
if (orig_port) if (orig_port)
server->addr.sockAddr6.sin6_port = orig_port; server->addr.sockAddr6.sin6_port = orig_port;
cFYI(1, ("Error %d connecting to server via ipv6", rc)); cFYI(1, "Error %d connecting to server via ipv6", rc);
sock_release(socket); sock_release(socket);
server->ssocket = NULL; server->ssocket = NULL;
return rc; return rc;
@ -2007,7 +2005,7 @@ ipv6_connect(struct TCP_Server_Info *server)
rc = kernel_setsockopt(socket, SOL_TCP, TCP_NODELAY, rc = kernel_setsockopt(socket, SOL_TCP, TCP_NODELAY,
(char *)&val, sizeof(val)); (char *)&val, sizeof(val));
if (rc) if (rc)
cFYI(1, ("set TCP_NODELAY socket option error %d", rc)); cFYI(1, "set TCP_NODELAY socket option error %d", rc);
} }
server->ssocket = socket; server->ssocket = socket;
@ -2032,13 +2030,13 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
if (vol_info && vol_info->no_linux_ext) { if (vol_info && vol_info->no_linux_ext) {
tcon->fsUnixInfo.Capability = 0; tcon->fsUnixInfo.Capability = 0;
tcon->unix_ext = 0; /* Unix Extensions disabled */ tcon->unix_ext = 0; /* Unix Extensions disabled */
cFYI(1, ("Linux protocol extensions disabled")); cFYI(1, "Linux protocol extensions disabled");
return; return;
} else if (vol_info) } else if (vol_info)
tcon->unix_ext = 1; /* Unix Extensions supported */ tcon->unix_ext = 1; /* Unix Extensions supported */
if (tcon->unix_ext == 0) { if (tcon->unix_ext == 0) {
cFYI(1, ("Unix extensions disabled so not set on reconnect")); cFYI(1, "Unix extensions disabled so not set on reconnect");
return; return;
} }
@ -2054,12 +2052,11 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
cap &= ~CIFS_UNIX_POSIX_ACL_CAP; cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) { if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) {
if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP)
cERROR(1, ("POSIXPATH support change")); cERROR(1, "POSIXPATH support change");
cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP; cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
} else if ((cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) { } else if ((cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) {
cERROR(1, ("possible reconnect error")); cERROR(1, "possible reconnect error");
cERROR(1, cERROR(1, "server disabled POSIX path support");
("server disabled POSIX path support"));
} }
} }
@ -2067,7 +2064,7 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
if (vol_info && vol_info->no_psx_acl) if (vol_info && vol_info->no_psx_acl)
cap &= ~CIFS_UNIX_POSIX_ACL_CAP; cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
else if (CIFS_UNIX_POSIX_ACL_CAP & cap) { else if (CIFS_UNIX_POSIX_ACL_CAP & cap) {
cFYI(1, ("negotiated posix acl support")); cFYI(1, "negotiated posix acl support");
if (sb) if (sb)
sb->s_flags |= MS_POSIXACL; sb->s_flags |= MS_POSIXACL;
} }
@ -2075,7 +2072,7 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
if (vol_info && vol_info->posix_paths == 0) if (vol_info && vol_info->posix_paths == 0)
cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP; cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
else if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) { else if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
cFYI(1, ("negotiate posix pathnames")); cFYI(1, "negotiate posix pathnames");
if (sb) if (sb)
CIFS_SB(sb)->mnt_cifs_flags |= CIFS_SB(sb)->mnt_cifs_flags |=
CIFS_MOUNT_POSIX_PATHS; CIFS_MOUNT_POSIX_PATHS;
@ -2090,39 +2087,38 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
if (sb && (CIFS_SB(sb)->rsize > 127 * 1024)) { if (sb && (CIFS_SB(sb)->rsize > 127 * 1024)) {
if ((cap & CIFS_UNIX_LARGE_READ_CAP) == 0) { if ((cap & CIFS_UNIX_LARGE_READ_CAP) == 0) {
CIFS_SB(sb)->rsize = 127 * 1024; CIFS_SB(sb)->rsize = 127 * 1024;
cFYI(DBG2, cFYI(DBG2, "larger reads not supported by srv");
("larger reads not supported by srv"));
} }
} }
cFYI(1, ("Negotiate caps 0x%x", (int)cap)); cFYI(1, "Negotiate caps 0x%x", (int)cap);
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
if (cap & CIFS_UNIX_FCNTL_CAP) if (cap & CIFS_UNIX_FCNTL_CAP)
cFYI(1, ("FCNTL cap")); cFYI(1, "FCNTL cap");
if (cap & CIFS_UNIX_EXTATTR_CAP) if (cap & CIFS_UNIX_EXTATTR_CAP)
cFYI(1, ("EXTATTR cap")); cFYI(1, "EXTATTR cap");
if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP)
cFYI(1, ("POSIX path cap")); cFYI(1, "POSIX path cap");
if (cap & CIFS_UNIX_XATTR_CAP) if (cap & CIFS_UNIX_XATTR_CAP)
cFYI(1, ("XATTR cap")); cFYI(1, "XATTR cap");
if (cap & CIFS_UNIX_POSIX_ACL_CAP) if (cap & CIFS_UNIX_POSIX_ACL_CAP)
cFYI(1, ("POSIX ACL cap")); cFYI(1, "POSIX ACL cap");
if (cap & CIFS_UNIX_LARGE_READ_CAP) if (cap & CIFS_UNIX_LARGE_READ_CAP)
cFYI(1, ("very large read cap")); cFYI(1, "very large read cap");
if (cap & CIFS_UNIX_LARGE_WRITE_CAP) if (cap & CIFS_UNIX_LARGE_WRITE_CAP)
cFYI(1, ("very large write cap")); cFYI(1, "very large write cap");
#endif /* CIFS_DEBUG2 */ #endif /* CIFS_DEBUG2 */
if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
if (vol_info == NULL) { if (vol_info == NULL) {
cFYI(1, ("resetting capabilities failed")); cFYI(1, "resetting capabilities failed");
} else } else
cERROR(1, ("Negotiating Unix capabilities " cERROR(1, "Negotiating Unix capabilities "
"with the server failed. Consider " "with the server failed. Consider "
"mounting with the Unix Extensions\n" "mounting with the Unix Extensions\n"
"disabled, if problems are found, " "disabled, if problems are found, "
"by specifying the nounix mount " "by specifying the nounix mount "
"option.")); "option.");
} }
} }
@ -2152,8 +2148,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info,
struct cifs_sb_info *cifs_sb) struct cifs_sb_info *cifs_sb)
{ {
if (pvolume_info->rsize > CIFSMaxBufSize) { if (pvolume_info->rsize > CIFSMaxBufSize) {
cERROR(1, ("rsize %d too large, using MaxBufSize", cERROR(1, "rsize %d too large, using MaxBufSize",
pvolume_info->rsize)); pvolume_info->rsize);
cifs_sb->rsize = CIFSMaxBufSize; cifs_sb->rsize = CIFSMaxBufSize;
} else if ((pvolume_info->rsize) && } else if ((pvolume_info->rsize) &&
(pvolume_info->rsize <= CIFSMaxBufSize)) (pvolume_info->rsize <= CIFSMaxBufSize))
@ -2162,8 +2158,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info,
cifs_sb->rsize = CIFSMaxBufSize; cifs_sb->rsize = CIFSMaxBufSize;
if (pvolume_info->wsize > PAGEVEC_SIZE * PAGE_CACHE_SIZE) { if (pvolume_info->wsize > PAGEVEC_SIZE * PAGE_CACHE_SIZE) {
cERROR(1, ("wsize %d too large, using 4096 instead", cERROR(1, "wsize %d too large, using 4096 instead",
pvolume_info->wsize)); pvolume_info->wsize);
cifs_sb->wsize = 4096; cifs_sb->wsize = 4096;
} else if (pvolume_info->wsize) } else if (pvolume_info->wsize)
cifs_sb->wsize = pvolume_info->wsize; cifs_sb->wsize = pvolume_info->wsize;
@ -2181,7 +2177,7 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info,
if (cifs_sb->rsize < 2048) { if (cifs_sb->rsize < 2048) {
cifs_sb->rsize = 2048; cifs_sb->rsize = 2048;
/* Windows ME may prefer this */ /* Windows ME may prefer this */
cFYI(1, ("readsize set to minimum: 2048")); cFYI(1, "readsize set to minimum: 2048");
} }
/* calculate prepath */ /* calculate prepath */
cifs_sb->prepath = pvolume_info->prepath; cifs_sb->prepath = pvolume_info->prepath;
@ -2199,8 +2195,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info,
cifs_sb->mnt_gid = pvolume_info->linux_gid; cifs_sb->mnt_gid = pvolume_info->linux_gid;
cifs_sb->mnt_file_mode = pvolume_info->file_mode; cifs_sb->mnt_file_mode = pvolume_info->file_mode;
cifs_sb->mnt_dir_mode = pvolume_info->dir_mode; cifs_sb->mnt_dir_mode = pvolume_info->dir_mode;
cFYI(1, ("file mode: 0x%x dir mode: 0x%x", cFYI(1, "file mode: 0x%x dir mode: 0x%x",
cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode)); cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode);
if (pvolume_info->noperm) if (pvolume_info->noperm)
cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_PERM; cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_PERM;
@ -2229,13 +2225,13 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info,
if (pvolume_info->dynperm) if (pvolume_info->dynperm)
cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM;
if (pvolume_info->direct_io) { if (pvolume_info->direct_io) {
cFYI(1, ("mounting share using direct i/o")); cFYI(1, "mounting share using direct i/o");
cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;
} }
if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm)) if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm))
cERROR(1, ("mount option dynperm ignored if cifsacl " cERROR(1, "mount option dynperm ignored if cifsacl "
"mount option supported")); "mount option supported");
} }
static int static int
@ -2344,11 +2340,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
} }
if (volume_info->nullauth) { if (volume_info->nullauth) {
cFYI(1, ("null user")); cFYI(1, "null user");
volume_info->username = ""; volume_info->username = "";
} else if (volume_info->username) { } else if (volume_info->username) {
/* BB fixme parse for domain name here */ /* BB fixme parse for domain name here */
cFYI(1, ("Username: %s", volume_info->username)); cFYI(1, "Username: %s", volume_info->username);
} else { } else {
cifserror("No username specified"); cifserror("No username specified");
/* In userspace mount helper we can get user name from alternate /* In userspace mount helper we can get user name from alternate
@ -2365,8 +2361,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
} else { } else {
cifs_sb->local_nls = load_nls(volume_info->iocharset); cifs_sb->local_nls = load_nls(volume_info->iocharset);
if (cifs_sb->local_nls == NULL) { if (cifs_sb->local_nls == NULL) {
cERROR(1, ("CIFS mount error: iocharset %s not found", cERROR(1, "CIFS mount error: iocharset %s not found",
volume_info->iocharset)); volume_info->iocharset);
rc = -ELIBACC; rc = -ELIBACC;
goto out; goto out;
} }
@ -2381,8 +2377,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
pSesInfo = cifs_find_smb_ses(srvTcp, volume_info->username); pSesInfo = cifs_find_smb_ses(srvTcp, volume_info->username);
if (pSesInfo) { if (pSesInfo) {
cFYI(1, ("Existing smb sess found (status=%d)", cFYI(1, "Existing smb sess found (status=%d)",
pSesInfo->status)); pSesInfo->status);
/* /*
* The existing SMB session already has a reference to srvTcp, * The existing SMB session already has a reference to srvTcp,
* so we can put back the extra one we got before * so we can put back the extra one we got before
@ -2391,13 +2387,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
mutex_lock(&pSesInfo->session_mutex); mutex_lock(&pSesInfo->session_mutex);
if (pSesInfo->need_reconnect) { if (pSesInfo->need_reconnect) {
cFYI(1, ("Session needs reconnect")); cFYI(1, "Session needs reconnect");
rc = cifs_setup_session(xid, pSesInfo, rc = cifs_setup_session(xid, pSesInfo,
cifs_sb->local_nls); cifs_sb->local_nls);
} }
mutex_unlock(&pSesInfo->session_mutex); mutex_unlock(&pSesInfo->session_mutex);
} else if (!rc) { } else if (!rc) {
cFYI(1, ("Existing smb sess not found")); cFYI(1, "Existing smb sess not found");
pSesInfo = sesInfoAlloc(); pSesInfo = sesInfoAlloc();
if (pSesInfo == NULL) { if (pSesInfo == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
@ -2452,12 +2448,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
tcon = cifs_find_tcon(pSesInfo, volume_info->UNC); tcon = cifs_find_tcon(pSesInfo, volume_info->UNC);
if (tcon) { if (tcon) {
cFYI(1, ("Found match on UNC path")); cFYI(1, "Found match on UNC path");
/* existing tcon already has a reference */ /* existing tcon already has a reference */
cifs_put_smb_ses(pSesInfo); cifs_put_smb_ses(pSesInfo);
if (tcon->seal != volume_info->seal) if (tcon->seal != volume_info->seal)
cERROR(1, ("transport encryption setting " cERROR(1, "transport encryption setting "
"conflicts with existing tid")); "conflicts with existing tid");
} else { } else {
tcon = tconInfoAlloc(); tcon = tconInfoAlloc();
if (tcon == NULL) { if (tcon == NULL) {
@ -2477,7 +2473,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
if ((strchr(volume_info->UNC + 3, '\\') == NULL) if ((strchr(volume_info->UNC + 3, '\\') == NULL)
&& (strchr(volume_info->UNC + 3, '/') == NULL)) { && (strchr(volume_info->UNC + 3, '/') == NULL)) {
cERROR(1, ("Missing share name")); cERROR(1, "Missing share name");
rc = -ENODEV; rc = -ENODEV;
goto mount_fail_check; goto mount_fail_check;
} else { } else {
@ -2486,11 +2482,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
* we do on SessSetup and reconnect? */ * we do on SessSetup and reconnect? */
rc = CIFSTCon(xid, pSesInfo, volume_info->UNC, rc = CIFSTCon(xid, pSesInfo, volume_info->UNC,
tcon, cifs_sb->local_nls); tcon, cifs_sb->local_nls);
cFYI(1, ("CIFS Tcon rc = %d", rc)); cFYI(1, "CIFS Tcon rc = %d", rc);
if (volume_info->nodfs) { if (volume_info->nodfs) {
tcon->Flags &= ~SMB_SHARE_IS_IN_DFS; tcon->Flags &= ~SMB_SHARE_IS_IN_DFS;
cFYI(1, ("DFS disabled (%d)", cFYI(1, "DFS disabled (%d)",
tcon->Flags)); tcon->Flags);
} }
} }
if (rc) if (rc)
@ -2544,7 +2540,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) { if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) {
cifs_sb->rsize = 1024 * 127; cifs_sb->rsize = 1024 * 127;
cFYI(DBG2, ("no very large read support, rsize now 127K")); cFYI(DBG2, "no very large read support, rsize now 127K");
} }
if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X)) if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X))
cifs_sb->wsize = min(cifs_sb->wsize, cifs_sb->wsize = min(cifs_sb->wsize,
@ -2593,7 +2589,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
goto mount_fail_check; goto mount_fail_check;
} }
cFYI(1, ("Getting referral for: %s", full_path)); cFYI(1, "Getting referral for: %s", full_path);
rc = get_dfs_path(xid, pSesInfo , full_path + 1, rc = get_dfs_path(xid, pSesInfo , full_path + 1,
cifs_sb->local_nls, &num_referrals, &referrals, cifs_sb->local_nls, &num_referrals, &referrals,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
@ -2778,13 +2774,13 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
if (length == 3) { if (length == 3) {
if ((bcc_ptr[0] == 'I') && (bcc_ptr[1] == 'P') && if ((bcc_ptr[0] == 'I') && (bcc_ptr[1] == 'P') &&
(bcc_ptr[2] == 'C')) { (bcc_ptr[2] == 'C')) {
cFYI(1, ("IPC connection")); cFYI(1, "IPC connection");
tcon->ipc = 1; tcon->ipc = 1;
} }
} else if (length == 2) { } else if (length == 2) {
if ((bcc_ptr[0] == 'A') && (bcc_ptr[1] == ':')) { if ((bcc_ptr[0] == 'A') && (bcc_ptr[1] == ':')) {
/* the most common case */ /* the most common case */
cFYI(1, ("disk share connection")); cFYI(1, "disk share connection");
} }
} }
bcc_ptr += length + 1; bcc_ptr += length + 1;
@ -2797,7 +2793,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
bytes_left, is_unicode, bytes_left, is_unicode,
nls_codepage); nls_codepage);
cFYI(1, ("nativeFileSystem=%s", tcon->nativeFileSystem)); cFYI(1, "nativeFileSystem=%s", tcon->nativeFileSystem);
if ((smb_buffer_response->WordCount == 3) || if ((smb_buffer_response->WordCount == 3) ||
(smb_buffer_response->WordCount == 7)) (smb_buffer_response->WordCount == 7))
@ -2805,7 +2801,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport);
else else
tcon->Flags = 0; tcon->Flags = 0;
cFYI(1, ("Tcon flags: 0x%x ", tcon->Flags)); cFYI(1, "Tcon flags: 0x%x ", tcon->Flags);
} else if ((rc == 0) && tcon == NULL) { } else if ((rc == 0) && tcon == NULL) {
/* all we need to save for IPC$ connection */ /* all we need to save for IPC$ connection */
ses->ipc_tid = smb_buffer_response->Tid; ses->ipc_tid = smb_buffer_response->Tid;
@ -2869,14 +2865,14 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
if (linuxExtEnabled == 0) if (linuxExtEnabled == 0)
pSesInfo->capabilities &= (~CAP_UNIX); pSesInfo->capabilities &= (~CAP_UNIX);
cFYI(1, ("Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d", cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
server->secMode, server->capabilities, server->timeAdj)); server->secMode, server->capabilities, server->timeAdj);
rc = CIFS_SessSetup(xid, pSesInfo, first_time, nls_info); rc = CIFS_SessSetup(xid, pSesInfo, first_time, nls_info);
if (rc) { if (rc) {
cERROR(1, ("Send error in SessSetup = %d", rc)); cERROR(1, "Send error in SessSetup = %d", rc);
} else { } else {
cFYI(1, ("CIFS Session Established successfully")); cFYI(1, "CIFS Session Established successfully");
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
pSesInfo->status = CifsGood; pSesInfo->status = CifsGood;
pSesInfo->need_reconnect = false; pSesInfo->need_reconnect = false;

View File

@ -73,7 +73,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")); cERROR(1, "corrupt dentry");
return NULL; return NULL;
} }
} }
@ -90,19 +90,18 @@ 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)); cFYI(0, "name: %s", full_path + namelen);
} }
temp = temp->d_parent; temp = temp->d_parent;
if (temp == NULL) { if (temp == NULL) {
cERROR(1, ("corrupt dentry")); cERROR(1, "corrupt dentry");
kfree(full_path); kfree(full_path);
return NULL; return NULL;
} }
} }
if (namelen != pplen + dfsplen) { if (namelen != pplen + dfsplen) {
cERROR(1, cERROR(1, "did not end path lookup where expected namelen is %d",
("did not end path lookup where expected namelen is %d", namelen);
namelen));
/* 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) */
@ -173,7 +172,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle,
if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
pCifsInode->clientCanCacheAll = true; pCifsInode->clientCanCacheAll = true;
pCifsInode->clientCanCacheRead = true; pCifsInode->clientCanCacheRead = true;
cFYI(1, ("Exclusive Oplock inode %p", newinode)); cFYI(1, "Exclusive Oplock inode %p", newinode);
} else if ((oplock & 0xF) == OPLOCK_READ) } else if ((oplock & 0xF) == OPLOCK_READ)
pCifsInode->clientCanCacheRead = true; pCifsInode->clientCanCacheRead = true;
} }
@ -192,7 +191,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb); struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb);
struct cifs_fattr fattr; struct cifs_fattr fattr;
cFYI(1, ("posix open %s", full_path)); cFYI(1, "posix open %s", full_path);
presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL);
if (presp_data == NULL) if (presp_data == NULL)
@ -358,7 +357,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
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")); cFYI(1, "Create flag not set in create function");
} }
/* 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
@ -394,7 +393,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
} }
if (rc) { if (rc) {
cFYI(1, ("cifs_create returned 0x%x", rc)); cFYI(1, "cifs_create returned 0x%x", rc);
goto cifs_create_out; goto cifs_create_out;
} }
@ -457,7 +456,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
if (rc == 0) if (rc == 0)
setup_cifs_dentry(tcon, direntry, newinode); setup_cifs_dentry(tcon, direntry, newinode);
else else
cFYI(1, ("Create worked, get_inode_info failed rc = %d", rc)); cFYI(1, "Create worked, get_inode_info failed rc = %d", rc);
/* nfsd case - nfs srv does not set nd */ /* nfsd case - nfs srv does not set nd */
if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) {
@ -531,7 +530,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
u16 fileHandle; u16 fileHandle;
FILE_ALL_INFO *buf; FILE_ALL_INFO *buf;
cFYI(1, ("sfu compat create special file")); cFYI(1, "sfu compat create special file");
buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
if (buf == NULL) { if (buf == NULL) {
@ -616,8 +615,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
xid = GetXid(); xid = GetXid();
cFYI(1, ("parent inode = 0x%p name is: %s and dentry = 0x%p", cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
parent_dir_inode, direntry->d_name.name, direntry)); parent_dir_inode, direntry->d_name.name, direntry);
/* check whether path exists */ /* check whether path exists */
@ -632,7 +631,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
int i; int i;
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")); cFYI(1, "Invalid file name");
FreeXid(xid); FreeXid(xid);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
@ -657,11 +656,11 @@ 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")); cFYI(1, "non-NULL inode in lookup");
} else { } else {
cFYI(1, ("NULL inode in lookup")); cFYI(1, "NULL inode in lookup");
} }
cFYI(1, ("Full path: %s inode = 0x%p", full_path, direntry->d_inode)); cFYI(1, "Full path: %s inode = 0x%p", full_path, direntry->d_inode);
/* Posix open is only called (at lookup time) for file create now. /* Posix open is only called (at lookup time) for file create now.
* For opens (rather than creates), because we do not know if it * For opens (rather than creates), because we do not know if it
@ -723,7 +722,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)); cERROR(1, "Unexpected lookup error %d", 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 */
} }
@ -742,8 +741,8 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
if (cifs_revalidate_dentry(direntry)) if (cifs_revalidate_dentry(direntry))
return 0; return 0;
} else { } else {
cFYI(1, ("neg dentry 0x%p name = %s", cFYI(1, "neg dentry 0x%p name = %s",
direntry, direntry->d_name.name)); direntry, direntry->d_name.name);
if (time_after(jiffies, direntry->d_time + HZ) || if (time_after(jiffies, direntry->d_time + HZ) ||
!lookupCacheEnabled) { !lookupCacheEnabled) {
d_drop(direntry); d_drop(direntry);
@ -758,7 +757,7 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
{ {
int rc = 0; int rc = 0;
cFYI(1, ("In cifs d_delete, name = %s", direntry->d_name.name)); cFYI(1, "In cifs d_delete, name = %s", direntry->d_name.name);
return rc; return rc;
} */ } */

View File

@ -106,14 +106,14 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
/* search for server name delimiter */ /* search for server name delimiter */
len = strlen(unc); len = strlen(unc);
if (len < 3) { if (len < 3) {
cFYI(1, ("%s: unc is too short: %s", __func__, unc)); cFYI(1, "%s: unc is too short: %s", __func__, unc);
return -EINVAL; return -EINVAL;
} }
len -= 2; len -= 2;
name = memchr(unc+2, '\\', len); name = memchr(unc+2, '\\', len);
if (!name) { if (!name) {
cFYI(1, ("%s: probably server name is whole unc: %s", cFYI(1, "%s: probably server name is whole unc: %s",
__func__, unc)); __func__, unc);
} else { } else {
len = (name - unc) - 2/* leading // */; len = (name - unc) - 2/* leading // */;
} }
@ -127,8 +127,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
name[len] = 0; name[len] = 0;
if (is_ip(name)) { if (is_ip(name)) {
cFYI(1, ("%s: it is IP, skipping dns upcall: %s", cFYI(1, "%s: it is IP, skipping dns upcall: %s",
__func__, name)); __func__, name);
data = name; data = name;
goto skip_upcall; goto skip_upcall;
} }
@ -138,7 +138,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
len = rkey->type_data.x[0]; len = rkey->type_data.x[0];
data = rkey->payload.data; data = rkey->payload.data;
} else { } else {
cERROR(1, ("%s: unable to resolve: %s", __func__, name)); cERROR(1, "%s: unable to resolve: %s", __func__, name);
goto out; goto out;
} }
@ -148,10 +148,10 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
if (*ip_addr) { if (*ip_addr) {
memcpy(*ip_addr, data, len + 1); memcpy(*ip_addr, data, len + 1);
if (!IS_ERR(rkey)) if (!IS_ERR(rkey))
cFYI(1, ("%s: resolved: %s to %s", __func__, cFYI(1, "%s: resolved: %s to %s", __func__,
name, name,
*ip_addr *ip_addr
)); );
rc = 0; rc = 0;
} else { } else {
rc = -ENOMEM; rc = -ENOMEM;

View File

@ -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)); cFYI(1, "get parent for %p", dentry);
return ERR_PTR(-EACCES); return ERR_PTR(-EACCES);
} }

View File

@ -136,15 +136,15 @@ cifs_posix_open_inode_helper(struct inode *inode, struct file *file,
if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) && if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) &&
(file->f_path.dentry->d_inode->i_size == (file->f_path.dentry->d_inode->i_size ==
(loff_t)le64_to_cpu(buf->EndOfFile))) { (loff_t)le64_to_cpu(buf->EndOfFile))) {
cFYI(1, ("inode unchanged on server")); cFYI(1, "inode unchanged on server");
} else { } else {
if (file->f_path.dentry->d_inode->i_mapping) { if (file->f_path.dentry->d_inode->i_mapping) {
rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping); rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping);
if (rc != 0) if (rc != 0)
CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc;
} }
cFYI(1, ("invalidating remote inode since open detected it " cFYI(1, "invalidating remote inode since open detected it "
"changed")); "changed");
invalidate_remote_inode(file->f_path.dentry->d_inode); invalidate_remote_inode(file->f_path.dentry->d_inode);
} */ } */
@ -152,8 +152,8 @@ cifs_posix_open_inode_helper(struct inode *inode, struct file *file,
if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
pCifsInode->clientCanCacheAll = true; pCifsInode->clientCanCacheAll = true;
pCifsInode->clientCanCacheRead = true; pCifsInode->clientCanCacheRead = true;
cFYI(1, ("Exclusive Oplock granted on inode %p", cFYI(1, "Exclusive Oplock granted on inode %p",
file->f_path.dentry->d_inode)); file->f_path.dentry->d_inode);
} else if ((oplock & 0xF) == OPLOCK_READ) } else if ((oplock & 0xF) == OPLOCK_READ)
pCifsInode->clientCanCacheRead = true; pCifsInode->clientCanCacheRead = true;
@ -190,8 +190,8 @@ cifs_fill_filedata(struct file *file)
if (file->private_data != NULL) { if (file->private_data != NULL) {
return pCifsFile; return pCifsFile;
} else if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL)) } else if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL))
cERROR(1, ("could not find file instance for " cERROR(1, "could not find file instance for "
"new file %p", file)); "new file %p", file);
return NULL; return NULL;
} }
@ -217,7 +217,7 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) && if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) &&
(file->f_path.dentry->d_inode->i_size == (file->f_path.dentry->d_inode->i_size ==
(loff_t)le64_to_cpu(buf->EndOfFile))) { (loff_t)le64_to_cpu(buf->EndOfFile))) {
cFYI(1, ("inode unchanged on server")); cFYI(1, "inode unchanged on server");
} else { } else {
if (file->f_path.dentry->d_inode->i_mapping) { if (file->f_path.dentry->d_inode->i_mapping) {
/* BB no need to lock inode until after invalidate /* BB no need to lock inode until after invalidate
@ -226,8 +226,8 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
if (rc != 0) if (rc != 0)
CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc;
} }
cFYI(1, ("invalidating remote inode since open detected it " cFYI(1, "invalidating remote inode since open detected it "
"changed")); "changed");
invalidate_remote_inode(file->f_path.dentry->d_inode); invalidate_remote_inode(file->f_path.dentry->d_inode);
} }
@ -242,8 +242,8 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) {
pCifsInode->clientCanCacheAll = true; pCifsInode->clientCanCacheAll = true;
pCifsInode->clientCanCacheRead = true; pCifsInode->clientCanCacheRead = true;
cFYI(1, ("Exclusive Oplock granted on inode %p", cFYI(1, "Exclusive Oplock granted on inode %p",
file->f_path.dentry->d_inode)); file->f_path.dentry->d_inode);
} else if ((*oplock & 0xF) == OPLOCK_READ) } else if ((*oplock & 0xF) == OPLOCK_READ)
pCifsInode->clientCanCacheRead = true; pCifsInode->clientCanCacheRead = true;
@ -285,8 +285,8 @@ int cifs_open(struct inode *inode, struct file *file)
return rc; return rc;
} }
cFYI(1, ("inode = 0x%p file flags are 0x%x for %s", cFYI(1, "inode = 0x%p file flags are 0x%x for %s",
inode, file->f_flags, full_path)); inode, file->f_flags, full_path);
if (oplockEnabled) if (oplockEnabled)
oplock = REQ_OPLOCK; oplock = REQ_OPLOCK;
@ -303,7 +303,7 @@ int cifs_open(struct inode *inode, struct file *file)
cifs_sb->mnt_file_mode /* ignored */, cifs_sb->mnt_file_mode /* ignored */,
oflags, &oplock, &netfid, xid); oflags, &oplock, &netfid, xid);
if (rc == 0) { if (rc == 0) {
cFYI(1, ("posix open succeeded")); cFYI(1, "posix open succeeded");
/* no need for special case handling of setting mode /* no need for special case handling of setting mode
on read only files needed here */ on read only files needed here */
@ -313,12 +313,12 @@ int cifs_open(struct inode *inode, struct file *file)
goto out; goto out;
} else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
if (tcon->ses->serverNOS) if (tcon->ses->serverNOS)
cERROR(1, ("server %s of type %s returned" cERROR(1, "server %s of type %s returned"
" unexpected error on SMB posix open" " unexpected error on SMB posix open"
", disabling posix open support." ", disabling posix open support."
" Check if server update available.", " Check if server update available.",
tcon->ses->serverName, tcon->ses->serverName,
tcon->ses->serverNOS)); tcon->ses->serverNOS);
tcon->broken_posix_open = true; tcon->broken_posix_open = true;
} else if ((rc != -EIO) && (rc != -EREMOTE) && } else if ((rc != -EIO) && (rc != -EREMOTE) &&
(rc != -EOPNOTSUPP)) /* path not found or net err */ (rc != -EOPNOTSUPP)) /* path not found or net err */
@ -386,7 +386,7 @@ int cifs_open(struct inode *inode, struct file *file)
& CIFS_MOUNT_MAP_SPECIAL_CHR); & CIFS_MOUNT_MAP_SPECIAL_CHR);
} }
if (rc) { if (rc) {
cFYI(1, ("cifs_open returned 0x%x", rc)); cFYI(1, "cifs_open returned 0x%x", rc);
goto out; goto out;
} }
@ -469,7 +469,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
} }
if (file->f_path.dentry == NULL) { if (file->f_path.dentry == NULL) {
cERROR(1, ("no valid name if dentry freed")); cERROR(1, "no valid name if dentry freed");
dump_stack(); dump_stack();
rc = -EBADF; rc = -EBADF;
goto reopen_error_exit; goto reopen_error_exit;
@ -477,7 +477,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
inode = file->f_path.dentry->d_inode; inode = file->f_path.dentry->d_inode;
if (inode == NULL) { if (inode == NULL) {
cERROR(1, ("inode not valid")); cERROR(1, "inode not valid");
dump_stack(); dump_stack();
rc = -EBADF; rc = -EBADF;
goto reopen_error_exit; goto reopen_error_exit;
@ -499,8 +499,8 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
return rc; return rc;
} }
cFYI(1, ("inode = 0x%p file flags 0x%x for %s", cFYI(1, "inode = 0x%p file flags 0x%x for %s",
inode, file->f_flags, full_path)); inode, file->f_flags, full_path);
if (oplockEnabled) if (oplockEnabled)
oplock = REQ_OPLOCK; oplock = REQ_OPLOCK;
@ -516,7 +516,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
cifs_sb->mnt_file_mode /* ignored */, cifs_sb->mnt_file_mode /* ignored */,
oflags, &oplock, &netfid, xid); oflags, &oplock, &netfid, xid);
if (rc == 0) { if (rc == 0) {
cFYI(1, ("posix reopen succeeded")); cFYI(1, "posix reopen succeeded");
goto reopen_success; goto reopen_success;
} }
/* fallthrough to retry open the old way on errors, especially /* fallthrough to retry open the old way on errors, especially
@ -537,8 +537,8 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc) { if (rc) {
mutex_unlock(&pCifsFile->fh_mutex); mutex_unlock(&pCifsFile->fh_mutex);
cFYI(1, ("cifs_open returned 0x%x", rc)); cFYI(1, "cifs_open returned 0x%x", rc);
cFYI(1, ("oplock: %d", oplock)); cFYI(1, "oplock: %d", oplock);
} else { } else {
reopen_success: reopen_success:
pCifsFile->netfid = netfid; pCifsFile->netfid = netfid;
@ -570,8 +570,8 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
pCifsInode->clientCanCacheAll = true; pCifsInode->clientCanCacheAll = true;
pCifsInode->clientCanCacheRead = true; pCifsInode->clientCanCacheRead = true;
cFYI(1, ("Exclusive Oplock granted on inode %p", cFYI(1, "Exclusive Oplock granted on inode %p",
file->f_path.dentry->d_inode)); file->f_path.dentry->d_inode);
} else if ((oplock & 0xF) == OPLOCK_READ) { } else if ((oplock & 0xF) == OPLOCK_READ) {
pCifsInode->clientCanCacheRead = true; pCifsInode->clientCanCacheRead = true;
pCifsInode->clientCanCacheAll = false; pCifsInode->clientCanCacheAll = false;
@ -619,8 +619,7 @@ int cifs_close(struct inode *inode, struct file *file)
the struct would be in each open file, the struct would be in each open file,
but this should give enough time to but this should give enough time to
clear the socket */ clear the socket */
cFYI(DBG2, cFYI(DBG2, "close delay, write pending");
("close delay, write pending"));
msleep(timeout); msleep(timeout);
timeout *= 4; timeout *= 4;
} }
@ -653,7 +652,7 @@ int cifs_close(struct inode *inode, struct file *file)
read_lock(&GlobalSMBSeslock); read_lock(&GlobalSMBSeslock);
if (list_empty(&(CIFS_I(inode)->openFileList))) { if (list_empty(&(CIFS_I(inode)->openFileList))) {
cFYI(1, ("closing last open instance for inode %p", inode)); cFYI(1, "closing last open instance for inode %p", inode);
/* if the file is not open we do not know if we can cache info /* if the file is not open we do not know if we can cache info
on this inode, much less write behind and read ahead */ on this inode, much less write behind and read ahead */
CIFS_I(inode)->clientCanCacheRead = false; CIFS_I(inode)->clientCanCacheRead = false;
@ -674,7 +673,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
(struct cifsFileInfo *)file->private_data; (struct cifsFileInfo *)file->private_data;
char *ptmp; char *ptmp;
cFYI(1, ("Closedir inode = 0x%p", inode)); cFYI(1, "Closedir inode = 0x%p", inode);
xid = GetXid(); xid = GetXid();
@ -685,22 +684,22 @@ int cifs_closedir(struct inode *inode, struct file *file)
pTcon = cifs_sb->tcon; pTcon = cifs_sb->tcon;
cFYI(1, ("Freeing private data in close dir")); cFYI(1, "Freeing private data in close dir");
write_lock(&GlobalSMBSeslock); write_lock(&GlobalSMBSeslock);
if (!pCFileStruct->srch_inf.endOfSearch && if (!pCFileStruct->srch_inf.endOfSearch &&
!pCFileStruct->invalidHandle) { !pCFileStruct->invalidHandle) {
pCFileStruct->invalidHandle = true; pCFileStruct->invalidHandle = true;
write_unlock(&GlobalSMBSeslock); write_unlock(&GlobalSMBSeslock);
rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid); rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid);
cFYI(1, ("Closing uncompleted readdir with rc %d", cFYI(1, "Closing uncompleted readdir with rc %d",
rc)); rc);
/* not much we can do if it fails anyway, ignore rc */ /* not much we can do if it fails anyway, ignore rc */
rc = 0; rc = 0;
} else } else
write_unlock(&GlobalSMBSeslock); write_unlock(&GlobalSMBSeslock);
ptmp = pCFileStruct->srch_inf.ntwrk_buf_start; ptmp = pCFileStruct->srch_inf.ntwrk_buf_start;
if (ptmp) { if (ptmp) {
cFYI(1, ("closedir free smb buf in srch struct")); cFYI(1, "closedir free smb buf in srch struct");
pCFileStruct->srch_inf.ntwrk_buf_start = NULL; pCFileStruct->srch_inf.ntwrk_buf_start = NULL;
if (pCFileStruct->srch_inf.smallBuf) if (pCFileStruct->srch_inf.smallBuf)
cifs_small_buf_release(ptmp); cifs_small_buf_release(ptmp);
@ -748,49 +747,49 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
rc = -EACCES; rc = -EACCES;
xid = GetXid(); xid = GetXid();
cFYI(1, ("Lock parm: 0x%x flockflags: " cFYI(1, "Lock parm: 0x%x flockflags: "
"0x%x flocktype: 0x%x start: %lld end: %lld", "0x%x flocktype: 0x%x start: %lld end: %lld",
cmd, pfLock->fl_flags, pfLock->fl_type, pfLock->fl_start, cmd, pfLock->fl_flags, pfLock->fl_type, pfLock->fl_start,
pfLock->fl_end)); pfLock->fl_end);
if (pfLock->fl_flags & FL_POSIX) if (pfLock->fl_flags & FL_POSIX)
cFYI(1, ("Posix")); cFYI(1, "Posix");
if (pfLock->fl_flags & FL_FLOCK) if (pfLock->fl_flags & FL_FLOCK)
cFYI(1, ("Flock")); cFYI(1, "Flock");
if (pfLock->fl_flags & FL_SLEEP) { if (pfLock->fl_flags & FL_SLEEP) {
cFYI(1, ("Blocking lock")); cFYI(1, "Blocking lock");
wait_flag = true; wait_flag = true;
} }
if (pfLock->fl_flags & FL_ACCESS) if (pfLock->fl_flags & FL_ACCESS)
cFYI(1, ("Process suspended by mandatory locking - " cFYI(1, "Process suspended by mandatory locking - "
"not implemented yet")); "not implemented yet");
if (pfLock->fl_flags & FL_LEASE) if (pfLock->fl_flags & FL_LEASE)
cFYI(1, ("Lease on file - not implemented yet")); cFYI(1, "Lease on file - not implemented yet");
if (pfLock->fl_flags & if (pfLock->fl_flags &
(~(FL_POSIX | FL_FLOCK | FL_SLEEP | FL_ACCESS | FL_LEASE))) (~(FL_POSIX | FL_FLOCK | FL_SLEEP | FL_ACCESS | FL_LEASE)))
cFYI(1, ("Unknown lock flags 0x%x", pfLock->fl_flags)); cFYI(1, "Unknown lock flags 0x%x", pfLock->fl_flags);
if (pfLock->fl_type == F_WRLCK) { if (pfLock->fl_type == F_WRLCK) {
cFYI(1, ("F_WRLCK ")); cFYI(1, "F_WRLCK ");
numLock = 1; numLock = 1;
} else if (pfLock->fl_type == F_UNLCK) { } else if (pfLock->fl_type == F_UNLCK) {
cFYI(1, ("F_UNLCK")); cFYI(1, "F_UNLCK");
numUnlock = 1; numUnlock = 1;
/* Check if unlock includes more than /* Check if unlock includes more than
one lock range */ one lock range */
} else if (pfLock->fl_type == F_RDLCK) { } else if (pfLock->fl_type == F_RDLCK) {
cFYI(1, ("F_RDLCK")); cFYI(1, "F_RDLCK");
lockType |= LOCKING_ANDX_SHARED_LOCK; lockType |= LOCKING_ANDX_SHARED_LOCK;
numLock = 1; numLock = 1;
} else if (pfLock->fl_type == F_EXLCK) { } else if (pfLock->fl_type == F_EXLCK) {
cFYI(1, ("F_EXLCK")); cFYI(1, "F_EXLCK");
numLock = 1; numLock = 1;
} else if (pfLock->fl_type == F_SHLCK) { } else if (pfLock->fl_type == F_SHLCK) {
cFYI(1, ("F_SHLCK")); cFYI(1, "F_SHLCK");
lockType |= LOCKING_ANDX_SHARED_LOCK; lockType |= LOCKING_ANDX_SHARED_LOCK;
numLock = 1; numLock = 1;
} else } else
cFYI(1, ("Unknown type of lock")); cFYI(1, "Unknown type of lock");
cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
tcon = cifs_sb->tcon; tcon = cifs_sb->tcon;
@ -833,8 +832,8 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
0 /* wait flag */ ); 0 /* wait flag */ );
pfLock->fl_type = F_UNLCK; pfLock->fl_type = F_UNLCK;
if (rc != 0) if (rc != 0)
cERROR(1, ("Error unlocking previously locked " cERROR(1, "Error unlocking previously locked "
"range %d during test of lock", rc)); "range %d during test of lock", rc);
rc = 0; rc = 0;
} else { } else {
@ -988,9 +987,8 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
pTcon = cifs_sb->tcon; pTcon = cifs_sb->tcon;
/* cFYI(1, /* cFYI(1, " write %d bytes to offset %lld of %s", write_size,
(" write %d bytes to offset %lld of %s", write_size, *poffset, file->f_path.dentry->d_name.name); */
*poffset, file->f_path.dentry->d_name.name)); */
if (file->private_data == NULL) if (file->private_data == NULL)
return -EBADF; return -EBADF;
@ -1091,8 +1089,8 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
pTcon = cifs_sb->tcon; pTcon = cifs_sb->tcon;
cFYI(1, ("write %zd bytes to offset %lld of %s", write_size, cFYI(1, "write %zd bytes to offset %lld of %s", write_size,
*poffset, file->f_path.dentry->d_name.name)); *poffset, file->f_path.dentry->d_name.name);
if (file->private_data == NULL) if (file->private_data == NULL)
return -EBADF; return -EBADF;
@ -1233,7 +1231,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
it being zero) during stress testcases so we need to check for it */ it being zero) during stress testcases so we need to check for it */
if (cifs_inode == NULL) { if (cifs_inode == NULL) {
cERROR(1, ("Null inode passed to cifs_writeable_file")); cERROR(1, "Null inode passed to cifs_writeable_file");
dump_stack(); dump_stack();
return NULL; return NULL;
} }
@ -1277,7 +1275,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
again. Note that it would be bad again. Note that it would be bad
to hold up writepages here (rather than to hold up writepages here (rather than
in caller) with continuous retries */ in caller) with continuous retries */
cFYI(1, ("wp failed on reopen file")); cFYI(1, "wp failed on reopen file");
read_lock(&GlobalSMBSeslock); read_lock(&GlobalSMBSeslock);
/* can not use this handle, no write /* can not use this handle, no write
pending on this one after all */ pending on this one after all */
@ -1353,7 +1351,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to)
else if (bytes_written < 0) else if (bytes_written < 0)
rc = bytes_written; rc = bytes_written;
} else { } else {
cFYI(1, ("No writeable filehandles for inode")); cFYI(1, "No writeable filehandles for inode");
rc = -EIO; rc = -EIO;
} }
@ -1525,7 +1523,7 @@ static int cifs_writepages(struct address_space *mapping,
*/ */
open_file = find_writable_file(CIFS_I(mapping->host)); open_file = find_writable_file(CIFS_I(mapping->host));
if (!open_file) { if (!open_file) {
cERROR(1, ("No writable handles for inode")); cERROR(1, "No writable handles for inode");
rc = -EBADF; rc = -EBADF;
} else { } else {
long_op = cifs_write_timeout(cifsi, offset); long_op = cifs_write_timeout(cifsi, offset);
@ -1538,8 +1536,8 @@ static int cifs_writepages(struct address_space *mapping,
cifs_update_eof(cifsi, offset, bytes_written); cifs_update_eof(cifsi, offset, bytes_written);
if (rc || bytes_written < bytes_to_write) { if (rc || bytes_written < bytes_to_write) {
cERROR(1, ("Write2 ret %d, wrote %d", cERROR(1, "Write2 ret %d, wrote %d",
rc, bytes_written)); rc, bytes_written);
/* BB what if continued retry is /* BB what if continued retry is
requested via mount flags? */ requested via mount flags? */
if (rc == -ENOSPC) if (rc == -ENOSPC)
@ -1600,7 +1598,7 @@ static int cifs_writepage(struct page *page, struct writeback_control *wbc)
/* BB add check for wbc flags */ /* BB add check for wbc flags */
page_cache_get(page); page_cache_get(page);
if (!PageUptodate(page)) if (!PageUptodate(page))
cFYI(1, ("ppw - page not up to date")); cFYI(1, "ppw - page not up to date");
/* /*
* Set the "writeback" flag, and clear "dirty" in the radix tree. * Set the "writeback" flag, and clear "dirty" in the radix tree.
@ -1629,8 +1627,8 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
int rc; int rc;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
cFYI(1, ("write_end for page %p from pos %lld with %d bytes", cFYI(1, "write_end for page %p from pos %lld with %d bytes",
page, pos, copied)); page, pos, copied);
if (PageChecked(page)) { if (PageChecked(page)) {
if (copied == len) if (copied == len)
@ -1686,8 +1684,8 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
xid = GetXid(); xid = GetXid();
cFYI(1, ("Sync file - name: %s datasync: 0x%x", cFYI(1, "Sync file - name: %s datasync: 0x%x",
dentry->d_name.name, datasync)); dentry->d_name.name, datasync);
rc = filemap_write_and_wait(inode->i_mapping); rc = filemap_write_and_wait(inode->i_mapping);
if (rc == 0) { if (rc == 0) {
@ -1711,7 +1709,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
unsigned int rpages = 0; unsigned int rpages = 0;
int rc = 0; int rc = 0;
cFYI(1, ("sync page %p",page)); cFYI(1, "sync page %p",page);
mapping = page->mapping; mapping = page->mapping;
if (!mapping) if (!mapping)
return 0; return 0;
@ -1722,7 +1720,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
/* fill in rpages then /* fill in rpages then
result = cifs_pagein_inode(inode, index, rpages); */ /* BB finish */ result = cifs_pagein_inode(inode, index, rpages); */ /* BB finish */
/* cFYI(1, ("rpages is %d for sync page of Index %ld", rpages, index)); /* cFYI(1, "rpages is %d for sync page of Index %ld", rpages, index);
#if 0 #if 0
if (rc < 0) if (rc < 0)
@ -1756,7 +1754,7 @@ int cifs_flush(struct file *file, fl_owner_t id)
CIFS_I(inode)->write_behind_rc = 0; CIFS_I(inode)->write_behind_rc = 0;
} }
cFYI(1, ("Flush inode %p file %p rc %d", inode, file, rc)); cFYI(1, "Flush inode %p file %p rc %d", inode, file, rc);
return rc; return rc;
} }
@ -1788,7 +1786,7 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
open_file = (struct cifsFileInfo *)file->private_data; open_file = (struct cifsFileInfo *)file->private_data;
if ((file->f_flags & O_ACCMODE) == O_WRONLY) if ((file->f_flags & O_ACCMODE) == O_WRONLY)
cFYI(1, ("attempting read on write only file instance")); cFYI(1, "attempting read on write only file instance");
for (total_read = 0, current_offset = read_data; for (total_read = 0, current_offset = read_data;
read_size > total_read; read_size > total_read;
@ -1869,7 +1867,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
open_file = (struct cifsFileInfo *)file->private_data; open_file = (struct cifsFileInfo *)file->private_data;
if ((file->f_flags & O_ACCMODE) == O_WRONLY) if ((file->f_flags & O_ACCMODE) == O_WRONLY)
cFYI(1, ("attempting read on write only file instance")); cFYI(1, "attempting read on write only file instance");
for (total_read = 0, current_offset = read_data; for (total_read = 0, current_offset = read_data;
read_size > total_read; read_size > total_read;
@ -1920,7 +1918,7 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
xid = GetXid(); xid = GetXid();
rc = cifs_revalidate_file(file); rc = cifs_revalidate_file(file);
if (rc) { if (rc) {
cFYI(1, ("Validation prior to mmap failed, error=%d", rc)); cFYI(1, "Validation prior to mmap failed, error=%d", rc);
FreeXid(xid); FreeXid(xid);
return rc; return rc;
} }
@ -1946,7 +1944,7 @@ static void cifs_copy_cache_pages(struct address_space *mapping,
if (add_to_page_cache_lru(page, mapping, page->index, if (add_to_page_cache_lru(page, mapping, page->index,
GFP_KERNEL)) { GFP_KERNEL)) {
page_cache_release(page); page_cache_release(page);
cFYI(1, ("Add page cache failed")); cFYI(1, "Add page cache failed");
data += PAGE_CACHE_SIZE; data += PAGE_CACHE_SIZE;
bytes_read -= PAGE_CACHE_SIZE; bytes_read -= PAGE_CACHE_SIZE;
continue; continue;
@ -2033,8 +2031,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
/* Read size needs to be in multiples of one page */ /* Read size needs to be in multiples of one page */
read_size = min_t(const unsigned int, read_size, read_size = min_t(const unsigned int, read_size,
cifs_sb->rsize & PAGE_CACHE_MASK); cifs_sb->rsize & PAGE_CACHE_MASK);
cFYI(DBG2, ("rpages: read size 0x%x contiguous pages %d", cFYI(DBG2, "rpages: read size 0x%x contiguous pages %d",
read_size, contig_pages)); read_size, contig_pages);
rc = -EAGAIN; rc = -EAGAIN;
while (rc == -EAGAIN) { while (rc == -EAGAIN) {
if ((open_file->invalidHandle) && if ((open_file->invalidHandle) &&
@ -2061,7 +2059,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
} }
} }
if ((rc < 0) || (smb_read_data == NULL)) { if ((rc < 0) || (smb_read_data == NULL)) {
cFYI(1, ("Read error in readpages: %d", rc)); cFYI(1, "Read error in readpages: %d", rc);
break; break;
} else if (bytes_read > 0) { } else if (bytes_read > 0) {
task_io_account_read(bytes_read); task_io_account_read(bytes_read);
@ -2084,9 +2082,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
/* break; */ /* break; */
} }
} else { } else {
cFYI(1, ("No bytes read (%d) at offset %lld . " cFYI(1, "No bytes read (%d) at offset %lld . "
"Cleaning remaining pages from readahead list", "Cleaning remaining pages from readahead list",
bytes_read, offset)); bytes_read, offset);
/* BB turn off caching and do new lookup on /* BB turn off caching and do new lookup on
file size at server? */ file size at server? */
break; break;
@ -2129,7 +2127,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
if (rc < 0) if (rc < 0)
goto io_error; goto io_error;
else else
cFYI(1, ("Bytes read %d", rc)); cFYI(1, "Bytes read %d", rc);
file->f_path.dentry->d_inode->i_atime = file->f_path.dentry->d_inode->i_atime =
current_fs_time(file->f_path.dentry->d_inode->i_sb); current_fs_time(file->f_path.dentry->d_inode->i_sb);
@ -2161,8 +2159,8 @@ static int cifs_readpage(struct file *file, struct page *page)
return rc; return rc;
} }
cFYI(1, ("readpage %p at offset %d 0x%x\n", cFYI(1, "readpage %p at offset %d 0x%x\n",
page, (int)offset, (int)offset)); page, (int)offset, (int)offset);
rc = cifs_readpage_worker(file, page, &offset); rc = cifs_readpage_worker(file, page, &offset);
@ -2232,7 +2230,7 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping,
struct page *page; struct page *page;
int rc = 0; int rc = 0;
cFYI(1, ("write_begin from %lld len %d", (long long)pos, len)); cFYI(1, "write_begin from %lld len %d", (long long)pos, len);
page = grab_cache_page_write_begin(mapping, index, flags); page = grab_cache_page_write_begin(mapping, index, flags);
if (!page) { if (!page) {
@ -2319,7 +2317,7 @@ cifs_oplock_break(struct slow_work *work)
rc = waitrc; rc = waitrc;
if (rc) if (rc)
cinode->write_behind_rc = rc; cinode->write_behind_rc = rc;
cFYI(1, ("Oplock flush inode %p rc %d", inode, rc)); cFYI(1, "Oplock flush inode %p rc %d", inode, rc);
} }
/* /*
@ -2331,7 +2329,7 @@ cifs_oplock_break(struct slow_work *work)
if (!cfile->closePend && !cfile->oplock_break_cancelled) { if (!cfile->closePend && !cfile->oplock_break_cancelled) {
rc = CIFSSMBLock(0, cifs_sb->tcon, cfile->netfid, 0, 0, 0, 0, rc = CIFSSMBLock(0, cifs_sb->tcon, cfile->netfid, 0, 0, 0, 0,
LOCKING_ANDX_OPLOCK_RELEASE, false); LOCKING_ANDX_OPLOCK_RELEASE, false);
cFYI(1, ("Oplock release rc = %d", rc)); cFYI(1, "Oplock release rc = %d", rc);
} }
} }

View File

@ -144,8 +144,8 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)
else else
cifs_i->time = jiffies; cifs_i->time = jiffies;
cFYI(1, ("inode 0x%p old_time=%ld new_time=%ld", inode, cFYI(1, "inode 0x%p old_time=%ld new_time=%ld", inode,
oldtime, cifs_i->time)); oldtime, cifs_i->time);
cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING; cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING;
@ -227,7 +227,7 @@ cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info,
/* safest to call it a file if we do not know */ /* safest to call it a file if we do not know */
fattr->cf_mode |= S_IFREG; fattr->cf_mode |= S_IFREG;
fattr->cf_dtype = DT_REG; fattr->cf_dtype = DT_REG;
cFYI(1, ("unknown type %d", le32_to_cpu(info->Type))); cFYI(1, "unknown type %d", le32_to_cpu(info->Type));
break; break;
} }
@ -256,7 +256,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb)
{ {
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
cFYI(1, ("creating fake fattr for DFS referral")); cFYI(1, "creating fake fattr for DFS referral");
memset(fattr, 0, sizeof(*fattr)); memset(fattr, 0, sizeof(*fattr));
fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU; fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU;
@ -305,7 +305,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
tcon = cifs_sb->tcon; tcon = cifs_sb->tcon;
cFYI(1, ("Getting info on %s", full_path)); cFYI(1, "Getting info on %s", full_path);
/* could have done a find first instead but this returns more info */ /* could have done a find first instead but this returns more info */
rc = CIFSSMBUnixQPathInfo(xid, tcon, full_path, &find_data, rc = CIFSSMBUnixQPathInfo(xid, tcon, full_path, &find_data,
@ -373,7 +373,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
&bytes_read, &pbuf, &buf_type); &bytes_read, &pbuf, &buf_type);
if ((rc == 0) && (bytes_read >= 8)) { if ((rc == 0) && (bytes_read >= 8)) {
if (memcmp("IntxBLK", pbuf, 8) == 0) { if (memcmp("IntxBLK", pbuf, 8) == 0) {
cFYI(1, ("Block device")); cFYI(1, "Block device");
fattr->cf_mode |= S_IFBLK; fattr->cf_mode |= S_IFBLK;
fattr->cf_dtype = DT_BLK; fattr->cf_dtype = DT_BLK;
if (bytes_read == 24) { if (bytes_read == 24) {
@ -385,7 +385,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
fattr->cf_rdev = MKDEV(mjr, mnr); fattr->cf_rdev = MKDEV(mjr, mnr);
} }
} else if (memcmp("IntxCHR", pbuf, 8) == 0) { } else if (memcmp("IntxCHR", pbuf, 8) == 0) {
cFYI(1, ("Char device")); cFYI(1, "Char device");
fattr->cf_mode |= S_IFCHR; fattr->cf_mode |= S_IFCHR;
fattr->cf_dtype = DT_CHR; fattr->cf_dtype = DT_CHR;
if (bytes_read == 24) { if (bytes_read == 24) {
@ -397,7 +397,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
fattr->cf_rdev = MKDEV(mjr, mnr); fattr->cf_rdev = MKDEV(mjr, mnr);
} }
} else if (memcmp("IntxLNK", pbuf, 7) == 0) { } else if (memcmp("IntxLNK", pbuf, 7) == 0) {
cFYI(1, ("Symlink")); cFYI(1, "Symlink");
fattr->cf_mode |= S_IFLNK; fattr->cf_mode |= S_IFLNK;
fattr->cf_dtype = DT_LNK; fattr->cf_dtype = DT_LNK;
} else { } else {
@ -439,10 +439,10 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
else if (rc > 3) { else if (rc > 3) {
mode = le32_to_cpu(*((__le32 *)ea_value)); mode = le32_to_cpu(*((__le32 *)ea_value));
fattr->cf_mode &= ~SFBITS_MASK; fattr->cf_mode &= ~SFBITS_MASK;
cFYI(1, ("special bits 0%o org mode 0%o", mode, cFYI(1, "special bits 0%o org mode 0%o", mode,
fattr->cf_mode)); fattr->cf_mode);
fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode; fattr->cf_mode = (mode & SFBITS_MASK) | fattr->cf_mode;
cFYI(1, ("special mode bits 0%o", mode)); cFYI(1, "special mode bits 0%o", mode);
} }
return 0; return 0;
@ -548,11 +548,11 @@ int cifs_get_inode_info(struct inode **pinode,
struct cifs_fattr fattr; struct cifs_fattr fattr;
pTcon = cifs_sb->tcon; pTcon = cifs_sb->tcon;
cFYI(1, ("Getting info on %s", full_path)); cFYI(1, "Getting info on %s", full_path);
if ((pfindData == NULL) && (*pinode != NULL)) { if ((pfindData == NULL) && (*pinode != NULL)) {
if (CIFS_I(*pinode)->clientCanCacheRead) { if (CIFS_I(*pinode)->clientCanCacheRead) {
cFYI(1, ("No need to revalidate cached inode sizes")); cFYI(1, "No need to revalidate cached inode sizes");
return rc; return rc;
} }
} }
@ -618,7 +618,7 @@ int cifs_get_inode_info(struct inode **pinode,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc1 || !fattr.cf_uniqueid) { if (rc1 || !fattr.cf_uniqueid) {
cFYI(1, ("GetSrvInodeNum rc %d", rc1)); cFYI(1, "GetSrvInodeNum rc %d", rc1);
fattr.cf_uniqueid = iunique(sb, ROOT_I); fattr.cf_uniqueid = iunique(sb, ROOT_I);
cifs_autodisable_serverino(cifs_sb); cifs_autodisable_serverino(cifs_sb);
} }
@ -634,13 +634,13 @@ int cifs_get_inode_info(struct inode **pinode,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid); tmprc = cifs_sfu_type(&fattr, full_path, cifs_sb, xid);
if (tmprc) if (tmprc)
cFYI(1, ("cifs_sfu_type failed: %d", tmprc)); cFYI(1, "cifs_sfu_type failed: %d", tmprc);
} }
#ifdef CONFIG_CIFS_EXPERIMENTAL #ifdef CONFIG_CIFS_EXPERIMENTAL
/* fill in 0777 bits from ACL */ /* fill in 0777 bits from ACL */
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
cFYI(1, ("Getting mode bits from ACL")); cFYI(1, "Getting mode bits from ACL");
cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid); cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid);
} }
#endif #endif
@ -734,7 +734,7 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
unsigned long hash; unsigned long hash;
struct inode *inode; struct inode *inode;
cFYI(1, ("looking for uniqueid=%llu", fattr->cf_uniqueid)); cFYI(1, "looking for uniqueid=%llu", fattr->cf_uniqueid);
/* hash down to 32-bits on 32-bit arch */ /* hash down to 32-bits on 32-bit arch */
hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid); hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);
@ -780,7 +780,7 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
if (rc && cifs_sb->tcon->ipc) { if (rc && cifs_sb->tcon->ipc) {
cFYI(1, ("ipc connection - fake read inode")); cFYI(1, "ipc connection - fake read inode");
inode->i_mode |= S_IFDIR; inode->i_mode |= S_IFDIR;
inode->i_nlink = 2; inode->i_nlink = 2;
inode->i_op = &cifs_ipc_inode_ops; inode->i_op = &cifs_ipc_inode_ops;
@ -842,7 +842,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid,
* server times. * server times.
*/ */
if (set_time && (attrs->ia_valid & ATTR_CTIME)) { if (set_time && (attrs->ia_valid & ATTR_CTIME)) {
cFYI(1, ("CIFS - CTIME changed")); cFYI(1, "CIFS - CTIME changed");
info_buf.ChangeTime = info_buf.ChangeTime =
cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime)); cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime));
} else } else
@ -877,8 +877,8 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid,
goto out; goto out;
} }
cFYI(1, ("calling SetFileInfo since SetPathInfo for " cFYI(1, "calling SetFileInfo since SetPathInfo for "
"times not supported by this server")); "times not supported by this server");
rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN,
SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, SYNCHRONIZE | FILE_WRITE_ATTRIBUTES,
CREATE_NOT_DIR, &netfid, &oplock, CREATE_NOT_DIR, &netfid, &oplock,
@ -1036,7 +1036,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
struct iattr *attrs = NULL; struct iattr *attrs = NULL;
__u32 dosattr = 0, origattr = 0; __u32 dosattr = 0, origattr = 0;
cFYI(1, ("cifs_unlink, dir=0x%p, dentry=0x%p", dir, dentry)); cFYI(1, "cifs_unlink, dir=0x%p, dentry=0x%p", dir, dentry);
xid = GetXid(); xid = GetXid();
@ -1055,7 +1055,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
rc = CIFSPOSIXDelFile(xid, tcon, full_path, rc = CIFSPOSIXDelFile(xid, tcon, full_path,
SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
cFYI(1, ("posix del rc %d", rc)); cFYI(1, "posix del rc %d", rc);
if ((rc == 0) || (rc == -ENOENT)) if ((rc == 0) || (rc == -ENOENT))
goto psx_del_no_retry; goto psx_del_no_retry;
} }
@ -1129,7 +1129,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
struct inode *newinode = NULL; struct inode *newinode = NULL;
struct cifs_fattr fattr; struct cifs_fattr fattr;
cFYI(1, ("In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode)); cFYI(1, "In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode);
xid = GetXid(); xid = GetXid();
@ -1164,7 +1164,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
kfree(pInfo); kfree(pInfo);
goto mkdir_retry_old; goto mkdir_retry_old;
} else if (rc) { } else if (rc) {
cFYI(1, ("posix mkdir returned 0x%x", rc)); cFYI(1, "posix mkdir returned 0x%x", rc);
d_drop(direntry); d_drop(direntry);
} else { } else {
if (pInfo->Type == cpu_to_le32(-1)) { if (pInfo->Type == cpu_to_le32(-1)) {
@ -1190,12 +1190,12 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
d_instantiate(direntry, newinode); d_instantiate(direntry, newinode);
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
cFYI(1, ("instantiated dentry %p %s to inode %p", cFYI(1, "instantiated dentry %p %s to inode %p",
direntry, direntry->d_name.name, newinode)); direntry, direntry->d_name.name, newinode);
if (newinode->i_nlink != 2) if (newinode->i_nlink != 2)
cFYI(1, ("unexpected number of links %d", cFYI(1, "unexpected number of links %d",
newinode->i_nlink)); newinode->i_nlink);
#endif #endif
} }
kfree(pInfo); kfree(pInfo);
@ -1206,7 +1206,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls, rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc) { if (rc) {
cFYI(1, ("cifs_mkdir returned 0x%x", rc)); cFYI(1, "cifs_mkdir returned 0x%x", rc);
d_drop(direntry); d_drop(direntry);
} else { } else {
mkdir_get_info: mkdir_get_info:
@ -1309,7 +1309,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
char *full_path = NULL; char *full_path = NULL;
struct cifsInodeInfo *cifsInode; struct cifsInodeInfo *cifsInode;
cFYI(1, ("cifs_rmdir, inode = 0x%p", inode)); cFYI(1, "cifs_rmdir, inode = 0x%p", inode);
xid = GetXid(); xid = GetXid();
@ -1673,12 +1673,12 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, nfid, rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, nfid,
npid, false); npid, false);
cifsFileInfo_put(open_file); cifsFileInfo_put(open_file);
cFYI(1, ("SetFSize for attrs rc = %d", rc)); cFYI(1, "SetFSize for attrs rc = %d", rc);
if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
unsigned int bytes_written; unsigned int bytes_written;
rc = CIFSSMBWrite(xid, pTcon, nfid, 0, attrs->ia_size, rc = CIFSSMBWrite(xid, pTcon, nfid, 0, attrs->ia_size,
&bytes_written, NULL, NULL, 1); &bytes_written, NULL, NULL, 1);
cFYI(1, ("Wrt seteof rc %d", rc)); cFYI(1, "Wrt seteof rc %d", rc);
} }
} else } else
rc = -EINVAL; rc = -EINVAL;
@ -1692,7 +1692,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
false, cifs_sb->local_nls, false, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
cFYI(1, ("SetEOF by path (setattrs) rc = %d", rc)); cFYI(1, "SetEOF by path (setattrs) rc = %d", rc);
if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
__u16 netfid; __u16 netfid;
int oplock = 0; int oplock = 0;
@ -1709,7 +1709,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
attrs->ia_size, attrs->ia_size,
&bytes_written, NULL, &bytes_written, NULL,
NULL, 1); NULL, 1);
cFYI(1, ("wrt seteof rc %d", rc)); cFYI(1, "wrt seteof rc %d", rc);
CIFSSMBClose(xid, pTcon, netfid); CIFSSMBClose(xid, pTcon, netfid);
} }
} }
@ -1737,8 +1737,8 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
struct cifs_unix_set_info_args *args = NULL; struct cifs_unix_set_info_args *args = NULL;
struct cifsFileInfo *open_file; struct cifsFileInfo *open_file;
cFYI(1, ("setattr_unix on file %s attrs->ia_valid=0x%x", cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x",
direntry->d_name.name, attrs->ia_valid)); direntry->d_name.name, attrs->ia_valid);
xid = GetXid(); xid = GetXid();
@ -1868,8 +1868,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
xid = GetXid(); xid = GetXid();
cFYI(1, ("setattr on file %s attrs->iavalid 0x%x", cFYI(1, "setattr on file %s attrs->iavalid 0x%x",
direntry->d_name.name, attrs->ia_valid)); direntry->d_name.name, attrs->ia_valid);
if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) { if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) {
/* check if we have permission to change attrs */ /* check if we have permission to change attrs */
@ -1926,7 +1926,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
attrs->ia_valid &= ~ATTR_MODE; attrs->ia_valid &= ~ATTR_MODE;
if (attrs->ia_valid & ATTR_MODE) { if (attrs->ia_valid & ATTR_MODE) {
cFYI(1, ("Mode changed to 0%o", attrs->ia_mode)); cFYI(1, "Mode changed to 0%o", attrs->ia_mode);
mode = attrs->ia_mode; mode = attrs->ia_mode;
} }
@ -2012,7 +2012,7 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
#if 0 #if 0
void cifs_delete_inode(struct inode *inode) void cifs_delete_inode(struct inode *inode)
{ {
cFYI(1, ("In cifs_delete_inode, inode = 0x%p", inode)); cFYI(1, "In cifs_delete_inode, inode = 0x%p", inode);
/* may have to add back in if and when safe distributed caching of /* may have to add back in if and when safe distributed caching of
directories added e.g. via FindNotify */ directories added e.g. via FindNotify */
} }

View File

@ -47,7 +47,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
xid = GetXid(); xid = GetXid();
cFYI(1, ("ioctl file %p cmd %u arg %lu", filep, command, arg)); cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg);
cifs_sb = CIFS_SB(inode->i_sb); cifs_sb = CIFS_SB(inode->i_sb);
@ -64,12 +64,12 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
switch (command) { switch (command) {
case CIFS_IOC_CHECKUMOUNT: case CIFS_IOC_CHECKUMOUNT:
cFYI(1, ("User unmount attempted")); cFYI(1, "User unmount attempted");
if (cifs_sb->mnt_uid == current_uid()) if (cifs_sb->mnt_uid == current_uid())
rc = 0; rc = 0;
else { else {
rc = -EACCES; rc = -EACCES;
cFYI(1, ("uids do not match")); cFYI(1, "uids do not match");
} }
break; break;
#ifdef CONFIG_CIFS_POSIX #ifdef CONFIG_CIFS_POSIX
@ -97,11 +97,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
/* rc= CIFSGetExtAttr(xid,tcon,pSMBFile->netfid, /* rc= CIFSGetExtAttr(xid,tcon,pSMBFile->netfid,
extAttrBits, &ExtAttrMask);*/ extAttrBits, &ExtAttrMask);*/
} }
cFYI(1, ("set flags not implemented yet")); cFYI(1, "set flags not implemented yet");
break; break;
#endif /* CONFIG_CIFS_POSIX */ #endif /* CONFIG_CIFS_POSIX */
default: default:
cFYI(1, ("unsupported ioctl")); cFYI(1, "unsupported ioctl");
break; break;
} }

View File

@ -139,7 +139,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)); cFYI(1, "Full path: %s inode = 0x%p", full_path, inode);
rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path, rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path,
cifs_sb->local_nls); cifs_sb->local_nls);
@ -178,8 +178,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
return rc; return rc;
} }
cFYI(1, ("Full path: %s", full_path)); cFYI(1, "Full path: %s", full_path);
cFYI(1, ("symname is %s", symname)); cFYI(1, "symname is %s", 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 (pTcon->unix_ext) if (pTcon->unix_ext)
@ -198,8 +198,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", cFYI(1, "Create symlink ok, getinodeinfo fail rc = %d",
rc)); rc);
} else { } else {
if (pTcon->nocase) if (pTcon->nocase)
direntry->d_op = &cifs_ci_dentry_ops; direntry->d_op = &cifs_ci_dentry_ops;

View File

@ -51,7 +51,7 @@ _GetXid(void)
if (GlobalTotalActiveXid > GlobalMaxActiveXid) if (GlobalTotalActiveXid > GlobalMaxActiveXid)
GlobalMaxActiveXid = GlobalTotalActiveXid; GlobalMaxActiveXid = GlobalTotalActiveXid;
if (GlobalTotalActiveXid > 65000) if (GlobalTotalActiveXid > 65000)
cFYI(1, ("warning: more than 65000 requests active")); cFYI(1, "warning: more than 65000 requests active");
xid = GlobalCurrentXid++; xid = GlobalCurrentXid++;
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
return xid; return xid;
@ -88,7 +88,7 @@ void
sesInfoFree(struct cifsSesInfo *buf_to_free) sesInfoFree(struct cifsSesInfo *buf_to_free)
{ {
if (buf_to_free == NULL) { if (buf_to_free == NULL) {
cFYI(1, ("Null buffer passed to sesInfoFree")); cFYI(1, "Null buffer passed to sesInfoFree");
return; return;
} }
@ -126,7 +126,7 @@ void
tconInfoFree(struct cifsTconInfo *buf_to_free) tconInfoFree(struct cifsTconInfo *buf_to_free)
{ {
if (buf_to_free == NULL) { if (buf_to_free == NULL) {
cFYI(1, ("Null buffer passed to tconInfoFree")); cFYI(1, "Null buffer passed to tconInfoFree");
return; return;
} }
atomic_dec(&tconInfoAllocCount); atomic_dec(&tconInfoAllocCount);
@ -166,7 +166,7 @@ void
cifs_buf_release(void *buf_to_free) cifs_buf_release(void *buf_to_free)
{ {
if (buf_to_free == NULL) { if (buf_to_free == NULL) {
/* cFYI(1, ("Null buffer passed to cifs_buf_release"));*/ /* cFYI(1, "Null buffer passed to cifs_buf_release");*/
return; return;
} }
mempool_free(buf_to_free, cifs_req_poolp); mempool_free(buf_to_free, cifs_req_poolp);
@ -202,7 +202,7 @@ cifs_small_buf_release(void *buf_to_free)
{ {
if (buf_to_free == NULL) { if (buf_to_free == NULL) {
cFYI(1, ("Null buffer passed to cifs_small_buf_release")); cFYI(1, "Null buffer passed to cifs_small_buf_release");
return; return;
} }
mempool_free(buf_to_free, cifs_sm_req_poolp); mempool_free(buf_to_free, cifs_sm_req_poolp);
@ -345,19 +345,19 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
/* with userid/password pairs found on the smb session */ /* with userid/password pairs found on the smb session */
/* for other target tcp/ip addresses BB */ /* for other target tcp/ip addresses BB */
if (current_fsuid() != treeCon->ses->linux_uid) { if (current_fsuid() != treeCon->ses->linux_uid) {
cFYI(1, ("Multiuser mode and UID " cFYI(1, "Multiuser mode and UID "
"did not match tcon uid")); "did not match tcon uid");
read_lock(&cifs_tcp_ses_lock); read_lock(&cifs_tcp_ses_lock);
list_for_each(temp_item, &treeCon->ses->server->smb_ses_list) { list_for_each(temp_item, &treeCon->ses->server->smb_ses_list) {
ses = list_entry(temp_item, struct cifsSesInfo, smb_ses_list); ses = list_entry(temp_item, struct cifsSesInfo, smb_ses_list);
if (ses->linux_uid == current_fsuid()) { if (ses->linux_uid == current_fsuid()) {
if (ses->server == treeCon->ses->server) { if (ses->server == treeCon->ses->server) {
cFYI(1, ("found matching uid substitute right smb_uid")); cFYI(1, "found matching uid substitute right smb_uid");
buffer->Uid = ses->Suid; buffer->Uid = ses->Suid;
break; break;
} else { } else {
/* BB eventually call cifs_setup_session here */ /* BB eventually call cifs_setup_session here */
cFYI(1, ("local UID found but no smb sess with this server exists")); cFYI(1, "local UID found but no smb sess with this server exists");
} }
} }
} }
@ -394,17 +394,16 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid)
if (smb->Command == SMB_COM_LOCKING_ANDX) if (smb->Command == SMB_COM_LOCKING_ANDX)
return 0; return 0;
else else
cERROR(1, ("Received Request not response")); cERROR(1, "Received Request not response");
} }
} else { /* bad signature or mid */ } else { /* bad signature or mid */
if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff))
cERROR(1, cERROR(1, "Bad protocol string signature header %x",
("Bad protocol string signature header %x", *(unsigned int *) smb->Protocol);
*(unsigned int *) smb->Protocol));
if (mid != smb->Mid) if (mid != smb->Mid)
cERROR(1, ("Mids do not match")); cERROR(1, "Mids do not match");
} }
cERROR(1, ("bad smb detected. The Mid=%d", smb->Mid)); cERROR(1, "bad smb detected. The Mid=%d", smb->Mid);
return 1; return 1;
} }
@ -413,7 +412,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length)
{ {
__u32 len = smb->smb_buf_length; __u32 len = smb->smb_buf_length;
__u32 clc_len; /* calculated length */ __u32 clc_len; /* calculated length */
cFYI(0, ("checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len)); cFYI(0, "checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len);
if (length < 2 + sizeof(struct smb_hdr)) { if (length < 2 + sizeof(struct smb_hdr)) {
if ((length >= sizeof(struct smb_hdr) - 1) if ((length >= sizeof(struct smb_hdr) - 1)
@ -437,15 +436,15 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length)
tmp[sizeof(struct smb_hdr)+1] = 0; tmp[sizeof(struct smb_hdr)+1] = 0;
return 0; return 0;
} }
cERROR(1, ("rcvd invalid byte count (bcc)")); cERROR(1, "rcvd invalid byte count (bcc)");
} else { } else {
cERROR(1, ("Length less than smb header size")); cERROR(1, "Length less than smb header size");
} }
return 1; return 1;
} }
if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cERROR(1, ("smb length greater than MaxBufSize, mid=%d", cERROR(1, "smb length greater than MaxBufSize, mid=%d",
smb->Mid)); smb->Mid);
return 1; return 1;
} }
@ -454,8 +453,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length)
clc_len = smbCalcSize_LE(smb); clc_len = smbCalcSize_LE(smb);
if (4 + len != length) { if (4 + len != length) {
cERROR(1, ("Length read does not match RFC1001 length %d", cERROR(1, "Length read does not match RFC1001 length %d",
len)); len);
return 1; return 1;
} }
@ -466,8 +465,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length)
if (((4 + len) & 0xFFFF) == (clc_len & 0xFFFF)) if (((4 + len) & 0xFFFF) == (clc_len & 0xFFFF))
return 0; /* bcc wrapped */ return 0; /* bcc wrapped */
} }
cFYI(1, ("Calculated size %d vs length %d mismatch for mid %d", cFYI(1, "Calculated size %d vs length %d mismatch for mid %d",
clc_len, 4 + len, smb->Mid)); clc_len, 4 + len, smb->Mid);
/* Windows XP can return a few bytes too much, presumably /* Windows XP can return a few bytes too much, presumably
an illegal pad, at the end of byte range lock responses an illegal pad, at the end of byte range lock responses
so we allow for that three byte pad, as long as actual so we allow for that three byte pad, as long as actual
@ -482,8 +481,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length)
if ((4+len > clc_len) && (len <= clc_len + 512)) if ((4+len > clc_len) && (len <= clc_len + 512))
return 0; return 0;
else { else {
cERROR(1, ("RFC1001 size %d bigger than SMB for Mid=%d", cERROR(1, "RFC1001 size %d bigger than SMB for Mid=%d",
len, smb->Mid)); len, smb->Mid);
return 1; return 1;
} }
} }
@ -501,7 +500,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
struct cifsFileInfo *netfile; struct cifsFileInfo *netfile;
int rc; int rc;
cFYI(1, ("Checking for oplock break or dnotify response")); cFYI(1, "Checking for oplock break or dnotify response");
if ((pSMB->hdr.Command == SMB_COM_NT_TRANSACT) && if ((pSMB->hdr.Command == SMB_COM_NT_TRANSACT) &&
(pSMB->hdr.Flags & SMBFLG_RESPONSE)) { (pSMB->hdr.Flags & SMBFLG_RESPONSE)) {
struct smb_com_transaction_change_notify_rsp *pSMBr = struct smb_com_transaction_change_notify_rsp *pSMBr =
@ -513,15 +512,15 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
pnotify = (struct file_notify_information *) pnotify = (struct file_notify_information *)
((char *)&pSMBr->hdr.Protocol + data_offset); ((char *)&pSMBr->hdr.Protocol + data_offset);
cFYI(1, ("dnotify on %s Action: 0x%x", cFYI(1, "dnotify on %s Action: 0x%x",
pnotify->FileName, pnotify->Action)); pnotify->FileName, pnotify->Action);
/* cifs_dump_mem("Rcvd notify Data: ",buf, /* cifs_dump_mem("Rcvd notify Data: ",buf,
sizeof(struct smb_hdr)+60); */ sizeof(struct smb_hdr)+60); */
return true; return true;
} }
if (pSMBr->hdr.Status.CifsError) { if (pSMBr->hdr.Status.CifsError) {
cFYI(1, ("notify err 0x%d", cFYI(1, "notify err 0x%d",
pSMBr->hdr.Status.CifsError)); pSMBr->hdr.Status.CifsError);
return true; return true;
} }
return false; return false;
@ -535,7 +534,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
large dirty files cached on the client */ large dirty files cached on the client */
if ((NT_STATUS_INVALID_HANDLE) == if ((NT_STATUS_INVALID_HANDLE) ==
le32_to_cpu(pSMB->hdr.Status.CifsError)) { le32_to_cpu(pSMB->hdr.Status.CifsError)) {
cFYI(1, ("invalid handle on oplock break")); cFYI(1, "invalid handle on oplock break");
return true; return true;
} else if (ERRbadfid == } else if (ERRbadfid ==
le16_to_cpu(pSMB->hdr.Status.DosError.Error)) { le16_to_cpu(pSMB->hdr.Status.DosError.Error)) {
@ -547,8 +546,8 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
if (pSMB->hdr.WordCount != 8) if (pSMB->hdr.WordCount != 8)
return false; return false;
cFYI(1, ("oplock type 0x%d level 0x%d", cFYI(1, "oplock type 0x%d level 0x%d",
pSMB->LockType, pSMB->OplockLevel)); pSMB->LockType, pSMB->OplockLevel);
if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE)) if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE))
return false; return false;
@ -579,15 +578,15 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
return true; return true;
} }
cFYI(1, ("file id match, oplock break")); cFYI(1, "file id match, oplock break");
pCifsInode = CIFS_I(netfile->pInode); pCifsInode = CIFS_I(netfile->pInode);
pCifsInode->clientCanCacheAll = false; pCifsInode->clientCanCacheAll = false;
if (pSMB->OplockLevel == 0) if (pSMB->OplockLevel == 0)
pCifsInode->clientCanCacheRead = false; pCifsInode->clientCanCacheRead = false;
rc = slow_work_enqueue(&netfile->oplock_break); rc = slow_work_enqueue(&netfile->oplock_break);
if (rc) { if (rc) {
cERROR(1, ("failed to enqueue oplock " cERROR(1, "failed to enqueue oplock "
"break: %d\n", rc)); "break: %d\n", rc);
} else { } else {
netfile->oplock_break_cancelled = false; netfile->oplock_break_cancelled = false;
} }
@ -597,12 +596,12 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
} }
read_unlock(&GlobalSMBSeslock); read_unlock(&GlobalSMBSeslock);
read_unlock(&cifs_tcp_ses_lock); read_unlock(&cifs_tcp_ses_lock);
cFYI(1, ("No matching file for oplock break")); cFYI(1, "No matching file for oplock break");
return true; return true;
} }
} }
read_unlock(&cifs_tcp_ses_lock); read_unlock(&cifs_tcp_ses_lock);
cFYI(1, ("Can not process oplock break for non-existent connection")); cFYI(1, "Can not process oplock break for non-existent connection");
return true; return true;
} }
@ -721,11 +720,11 @@ cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb)
{ {
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM; cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM;
cERROR(1, ("Autodisabling the use of server inode numbers on " cERROR(1, "Autodisabling the use of server inode numbers on "
"%s. This server doesn't seem to support them " "%s. This server doesn't seem to support them "
"properly. Hardlinks will not be recognized on this " "properly. Hardlinks will not be recognized on this "
"mount. Consider mounting with the \"noserverino\" " "mount. Consider mounting with the \"noserverino\" "
"option to silence this message.", "option to silence this message.",
cifs_sb->tcon->treeName)); cifs_sb->tcon->treeName);
} }
} }

View File

@ -149,7 +149,7 @@ cifs_inet_pton(const int address_family, const char *cp, void *dst)
else if (address_family == AF_INET6) else if (address_family == AF_INET6)
ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL); ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL);
cFYI(DBG2, ("address conversion returned %d for %s", ret, cp)); cFYI(DBG2, "address conversion returned %d for %s", ret, cp);
if (ret > 0) if (ret > 0)
ret = 1; ret = 1;
return ret; return ret;
@ -870,8 +870,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
} }
/* else ERRHRD class errors or junk - return EIO */ /* else ERRHRD class errors or junk - return EIO */
cFYI(1, ("Mapping smb error code %d to POSIX err %d", cFYI(1, "Mapping smb error code %d to POSIX err %d",
smberrcode, rc)); smberrcode, rc);
/* generic corrective action e.g. reconnect SMB session on /* generic corrective action e.g. reconnect SMB session on
* ERRbaduid could be added */ * ERRbaduid could be added */
@ -940,20 +940,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)); cFYI(1, "date %d time %d", 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)); cERROR(1, "illegal time min %d sec %d", 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)); cERROR(1, "illegal hours %d", 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)); cERROR(1, "illegal date, month %d day: %d", month, days);
if (month > 12) if (month > 12)
month = 12; month = 12;
} }
@ -979,7 +979,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)); */ /* cFYI(1, "sec after cnvrt dos to unix time %d",sec); */
ts.tv_nsec = 0; ts.tv_nsec = 0;
return ts; return ts;

View File

@ -47,15 +47,15 @@ static void dump_cifs_file_struct(struct file *file, char *label)
if (file) { if (file) {
cf = file->private_data; cf = file->private_data;
if (cf == NULL) { if (cf == NULL) {
cFYI(1, ("empty cifs private file data")); cFYI(1, "empty cifs private file data");
return; return;
} }
if (cf->invalidHandle) if (cf->invalidHandle)
cFYI(1, ("invalid handle")); cFYI(1, "invalid handle");
if (cf->srch_inf.endOfSearch) if (cf->srch_inf.endOfSearch)
cFYI(1, ("end of search")); cFYI(1, "end of search");
if (cf->srch_inf.emptyDir) if (cf->srch_inf.emptyDir)
cFYI(1, ("empty dir")); cFYI(1, "empty dir");
} }
} }
#else #else
@ -76,7 +76,7 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name,
struct inode *inode; struct inode *inode;
struct super_block *sb = parent->d_inode->i_sb; struct super_block *sb = parent->d_inode->i_sb;
cFYI(1, ("For %s", name->name)); cFYI(1, "For %s", name->name);
if (parent->d_op && parent->d_op->d_hash) if (parent->d_op && parent->d_op->d_hash)
parent->d_op->d_hash(parent, name); parent->d_op->d_hash(parent, name);
@ -214,7 +214,7 @@ int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
fid, fid,
cifs_sb->local_nls); cifs_sb->local_nls);
if (CIFSSMBClose(xid, ptcon, fid)) { if (CIFSSMBClose(xid, ptcon, fid)) {
cFYI(1, ("Error closing temporary reparsepoint open)")); cFYI(1, "Error closing temporary reparsepoint open");
} }
} }
} }
@ -252,7 +252,7 @@ static int initiate_cifs_search(const int xid, struct file *file)
if (full_path == NULL) if (full_path == NULL)
return -ENOMEM; return -ENOMEM;
cFYI(1, ("Full path: %s start at: %lld", full_path, file->f_pos)); cFYI(1, "Full path: %s start at: %lld", full_path, file->f_pos);
ffirst_retry: ffirst_retry:
/* test for Unix extensions */ /* test for Unix extensions */
@ -297,7 +297,7 @@ static int cifs_unicode_bytelen(char *str)
if (ustr[len] == 0) if (ustr[len] == 0)
return len << 1; return len << 1;
} }
cFYI(1, ("Unicode string longer than PATH_MAX found")); cFYI(1, "Unicode string longer than PATH_MAX found");
return len << 1; return len << 1;
} }
@ -314,19 +314,18 @@ static char *nxt_dir_entry(char *old_entry, char *end_of_smb, int level)
pfData->FileNameLength; pfData->FileNameLength;
} else } else
new_entry = old_entry + le32_to_cpu(pDirInfo->NextEntryOffset); new_entry = old_entry + le32_to_cpu(pDirInfo->NextEntryOffset);
cFYI(1, ("new entry %p old entry %p", new_entry, old_entry)); cFYI(1, "new entry %p old entry %p", new_entry, old_entry);
/* validate that new_entry is not past end of SMB */ /* validate that new_entry is not past end of SMB */
if (new_entry >= end_of_smb) { if (new_entry >= end_of_smb) {
cERROR(1, cERROR(1, "search entry %p began after end of SMB %p old entry %p",
("search entry %p began after end of SMB %p old entry %p", new_entry, end_of_smb, old_entry);
new_entry, end_of_smb, old_entry));
return NULL; return NULL;
} else if (((level == SMB_FIND_FILE_INFO_STANDARD) && } else if (((level == SMB_FIND_FILE_INFO_STANDARD) &&
(new_entry + sizeof(FIND_FILE_STANDARD_INFO) > end_of_smb)) (new_entry + sizeof(FIND_FILE_STANDARD_INFO) > end_of_smb))
|| ((level != SMB_FIND_FILE_INFO_STANDARD) && || ((level != SMB_FIND_FILE_INFO_STANDARD) &&
(new_entry + sizeof(FILE_DIRECTORY_INFO) > end_of_smb))) { (new_entry + sizeof(FILE_DIRECTORY_INFO) > end_of_smb))) {
cERROR(1, ("search entry %p extends after end of SMB %p", cERROR(1, "search entry %p extends after end of SMB %p",
new_entry, end_of_smb)); new_entry, end_of_smb);
return NULL; return NULL;
} else } else
return new_entry; return new_entry;
@ -380,8 +379,8 @@ static int cifs_entry_is_dot(char *current_entry, struct cifsFileInfo *cfile)
filename = &pFindData->FileName[0]; filename = &pFindData->FileName[0];
len = pFindData->FileNameLength; len = pFindData->FileNameLength;
} else { } else {
cFYI(1, ("Unknown findfirst level %d", cFYI(1, "Unknown findfirst level %d",
cfile->srch_inf.info_level)); cfile->srch_inf.info_level);
} }
if (filename) { if (filename) {
@ -481,7 +480,7 @@ static int cifs_save_resume_key(const char *current_entry,
len = (unsigned int)pFindData->FileNameLength; len = (unsigned int)pFindData->FileNameLength;
cifsFile->srch_inf.resume_key = pFindData->ResumeKey; cifsFile->srch_inf.resume_key = pFindData->ResumeKey;
} else { } else {
cFYI(1, ("Unknown findfirst level %d", level)); cFYI(1, "Unknown findfirst level %d", level);
return -EINVAL; return -EINVAL;
} }
cifsFile->srch_inf.resume_name_len = len; cifsFile->srch_inf.resume_name_len = len;
@ -525,7 +524,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
is_dir_changed(file)) || is_dir_changed(file)) ||
(index_to_find < first_entry_in_buffer)) { (index_to_find < first_entry_in_buffer)) {
/* close and restart search */ /* close and restart search */
cFYI(1, ("search backing up - close and restart search")); cFYI(1, "search backing up - close and restart search");
write_lock(&GlobalSMBSeslock); write_lock(&GlobalSMBSeslock);
if (!cifsFile->srch_inf.endOfSearch && if (!cifsFile->srch_inf.endOfSearch &&
!cifsFile->invalidHandle) { !cifsFile->invalidHandle) {
@ -535,7 +534,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
} else } else
write_unlock(&GlobalSMBSeslock); write_unlock(&GlobalSMBSeslock);
if (cifsFile->srch_inf.ntwrk_buf_start) { if (cifsFile->srch_inf.ntwrk_buf_start) {
cFYI(1, ("freeing SMB ff cache buf on search rewind")); cFYI(1, "freeing SMB ff cache buf on search rewind");
if (cifsFile->srch_inf.smallBuf) if (cifsFile->srch_inf.smallBuf)
cifs_small_buf_release(cifsFile->srch_inf. cifs_small_buf_release(cifsFile->srch_inf.
ntwrk_buf_start); ntwrk_buf_start);
@ -546,8 +545,8 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
} }
rc = initiate_cifs_search(xid, file); rc = initiate_cifs_search(xid, file);
if (rc) { if (rc) {
cFYI(1, ("error %d reinitiating a search on rewind", cFYI(1, "error %d reinitiating a search on rewind",
rc)); rc);
return rc; return rc;
} }
cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile); cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
@ -555,7 +554,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) && while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) &&
(rc == 0) && !cifsFile->srch_inf.endOfSearch) { (rc == 0) && !cifsFile->srch_inf.endOfSearch) {
cFYI(1, ("calling findnext2")); cFYI(1, "calling findnext2");
rc = CIFSFindNext(xid, pTcon, cifsFile->netfid, rc = CIFSFindNext(xid, pTcon, cifsFile->netfid,
&cifsFile->srch_inf); &cifsFile->srch_inf);
cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile); cifs_save_resume_key(cifsFile->srch_inf.last_entry, cifsFile);
@ -575,7 +574,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry
- cifsFile->srch_inf.entries_in_buffer; - cifsFile->srch_inf.entries_in_buffer;
pos_in_buf = index_to_find - first_entry_in_buffer; pos_in_buf = index_to_find - first_entry_in_buffer;
cFYI(1, ("found entry - pos_in_buf %d", pos_in_buf)); cFYI(1, "found entry - pos_in_buf %d", pos_in_buf);
for (i = 0; (i < (pos_in_buf)) && (current_entry != NULL); i++) { for (i = 0; (i < (pos_in_buf)) && (current_entry != NULL); i++) {
/* go entry by entry figuring out which is first */ /* go entry by entry figuring out which is first */
@ -584,19 +583,19 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
} }
if ((current_entry == NULL) && (i < pos_in_buf)) { if ((current_entry == NULL) && (i < pos_in_buf)) {
/* BB fixme - check if we should flag this error */ /* BB fixme - check if we should flag this error */
cERROR(1, ("reached end of buf searching for pos in buf" cERROR(1, "reached end of buf searching for pos in buf"
" %d index to find %lld rc %d", " %d index to find %lld rc %d",
pos_in_buf, index_to_find, rc)); pos_in_buf, index_to_find, rc);
} }
rc = 0; rc = 0;
*ppCurrentEntry = current_entry; *ppCurrentEntry = current_entry;
} else { } else {
cFYI(1, ("index not in buffer - could not findnext into it")); cFYI(1, "index not in buffer - could not findnext into it");
return 0; return 0;
} }
if (pos_in_buf >= cifsFile->srch_inf.entries_in_buffer) { if (pos_in_buf >= cifsFile->srch_inf.entries_in_buffer) {
cFYI(1, ("can not return entries pos_in_buf beyond last")); cFYI(1, "can not return entries pos_in_buf beyond last");
*num_to_ret = 0; *num_to_ret = 0;
} else } else
*num_to_ret = cifsFile->srch_inf.entries_in_buffer - pos_in_buf; *num_to_ret = cifsFile->srch_inf.entries_in_buffer - pos_in_buf;
@ -656,12 +655,12 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
/* one byte length, no name conversion */ /* one byte length, no name conversion */
len = (unsigned int)pFindData->FileNameLength; len = (unsigned int)pFindData->FileNameLength;
} else { } else {
cFYI(1, ("Unknown findfirst level %d", level)); cFYI(1, "Unknown findfirst level %d", level);
return -EINVAL; return -EINVAL;
} }
if (len > max_len) { if (len > max_len) {
cERROR(1, ("bad search response length %d past smb end", len)); cERROR(1, "bad search response length %d past smb end", len);
return -EINVAL; return -EINVAL;
} }
@ -754,7 +753,7 @@ static int cifs_filldir(char *pfindEntry, struct file *file, filldir_t filldir,
* case already. Why should we be clobbering other errors from it? * case already. Why should we be clobbering other errors from it?
*/ */
if (rc) { if (rc) {
cFYI(1, ("filldir rc = %d", rc)); cFYI(1, "filldir rc = %d", rc);
rc = -EOVERFLOW; rc = -EOVERFLOW;
} }
dput(tmp_dentry); dput(tmp_dentry);
@ -786,7 +785,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
case 0: case 0:
if (filldir(direntry, ".", 1, file->f_pos, if (filldir(direntry, ".", 1, file->f_pos,
file->f_path.dentry->d_inode->i_ino, DT_DIR) < 0) { file->f_path.dentry->d_inode->i_ino, DT_DIR) < 0) {
cERROR(1, ("Filldir for current dir failed")); cERROR(1, "Filldir for current dir failed");
rc = -ENOMEM; rc = -ENOMEM;
break; break;
} }
@ -794,7 +793,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
case 1: case 1:
if (filldir(direntry, "..", 2, file->f_pos, if (filldir(direntry, "..", 2, file->f_pos,
file->f_path.dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) { file->f_path.dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) {
cERROR(1, ("Filldir for parent dir failed")); cERROR(1, "Filldir for parent dir failed");
rc = -ENOMEM; rc = -ENOMEM;
break; break;
} }
@ -807,7 +806,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
if (file->private_data == NULL) { if (file->private_data == NULL) {
rc = initiate_cifs_search(xid, file); rc = initiate_cifs_search(xid, file);
cFYI(1, ("initiate cifs search rc %d", rc)); cFYI(1, "initiate cifs search rc %d", rc);
if (rc) { if (rc) {
FreeXid(xid); FreeXid(xid);
return rc; return rc;
@ -821,7 +820,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
cifsFile = file->private_data; cifsFile = file->private_data;
if (cifsFile->srch_inf.endOfSearch) { if (cifsFile->srch_inf.endOfSearch) {
if (cifsFile->srch_inf.emptyDir) { if (cifsFile->srch_inf.emptyDir) {
cFYI(1, ("End of search, empty dir")); cFYI(1, "End of search, empty dir");
rc = 0; rc = 0;
break; break;
} }
@ -833,16 +832,16 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
rc = find_cifs_entry(xid, pTcon, file, rc = find_cifs_entry(xid, pTcon, file,
&current_entry, &num_to_fill); &current_entry, &num_to_fill);
if (rc) { if (rc) {
cFYI(1, ("fce error %d", rc)); cFYI(1, "fce error %d", rc);
goto rddir2_exit; goto rddir2_exit;
} else if (current_entry != NULL) { } else if (current_entry != NULL) {
cFYI(1, ("entry %lld found", file->f_pos)); cFYI(1, "entry %lld found", file->f_pos);
} else { } else {
cFYI(1, ("could not find entry")); cFYI(1, "could not find entry");
goto rddir2_exit; goto rddir2_exit;
} }
cFYI(1, ("loop through %d times filling dir for net buf %p", cFYI(1, "loop through %d times filling dir for net buf %p",
num_to_fill, cifsFile->srch_inf.ntwrk_buf_start)); num_to_fill, cifsFile->srch_inf.ntwrk_buf_start);
max_len = smbCalcSize((struct smb_hdr *) max_len = smbCalcSize((struct smb_hdr *)
cifsFile->srch_inf.ntwrk_buf_start); cifsFile->srch_inf.ntwrk_buf_start);
end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + max_len; end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + max_len;
@ -851,8 +850,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
for (i = 0; (i < num_to_fill) && (rc == 0); i++) { for (i = 0; (i < num_to_fill) && (rc == 0); i++) {
if (current_entry == NULL) { if (current_entry == NULL) {
/* evaluate whether this case is an error */ /* evaluate whether this case is an error */
cERROR(1, ("past SMB end, num to fill %d i %d", cERROR(1, "past SMB end, num to fill %d i %d",
num_to_fill, i)); num_to_fill, i);
break; break;
} }
/* if buggy server returns . and .. late do /* if buggy server returns . and .. late do
@ -867,8 +866,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
file->f_pos++; file->f_pos++;
if (file->f_pos == if (file->f_pos ==
cifsFile->srch_inf.index_of_last_entry) { cifsFile->srch_inf.index_of_last_entry) {
cFYI(1, ("last entry in buf at pos %lld %s", cFYI(1, "last entry in buf at pos %lld %s",
file->f_pos, tmp_buf)); file->f_pos, tmp_buf);
cifs_save_resume_key(current_entry, cifsFile); cifs_save_resume_key(current_entry, cifsFile);
break; break;
} else } else

View File

@ -284,7 +284,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses,
int len; int len;
char *data = *pbcc_area; char *data = *pbcc_area;
cFYI(1, ("bleft %d", bleft)); cFYI(1, "bleft %d", bleft);
/* /*
* Windows servers do not always double null terminate their final * Windows servers do not always double null terminate their final
@ -301,7 +301,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses,
kfree(ses->serverOS); kfree(ses->serverOS);
ses->serverOS = cifs_strndup_from_ucs(data, bleft, true, nls_cp); ses->serverOS = cifs_strndup_from_ucs(data, bleft, true, nls_cp);
cFYI(1, ("serverOS=%s", ses->serverOS)); cFYI(1, "serverOS=%s", ses->serverOS);
len = (UniStrnlen((wchar_t *) data, bleft / 2) * 2) + 2; len = (UniStrnlen((wchar_t *) data, bleft / 2) * 2) + 2;
data += len; data += len;
bleft -= len; bleft -= len;
@ -310,7 +310,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses,
kfree(ses->serverNOS); kfree(ses->serverNOS);
ses->serverNOS = cifs_strndup_from_ucs(data, bleft, true, nls_cp); ses->serverNOS = cifs_strndup_from_ucs(data, bleft, true, nls_cp);
cFYI(1, ("serverNOS=%s", ses->serverNOS)); cFYI(1, "serverNOS=%s", ses->serverNOS);
len = (UniStrnlen((wchar_t *) data, bleft / 2) * 2) + 2; len = (UniStrnlen((wchar_t *) data, bleft / 2) * 2) + 2;
data += len; data += len;
bleft -= len; bleft -= len;
@ -319,7 +319,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses,
kfree(ses->serverDomain); kfree(ses->serverDomain);
ses->serverDomain = cifs_strndup_from_ucs(data, bleft, true, nls_cp); ses->serverDomain = cifs_strndup_from_ucs(data, bleft, true, nls_cp);
cFYI(1, ("serverDomain=%s", ses->serverDomain)); cFYI(1, "serverDomain=%s", ses->serverDomain);
return; return;
} }
@ -332,7 +332,7 @@ static int decode_ascii_ssetup(char **pbcc_area, int bleft,
int len; int len;
char *bcc_ptr = *pbcc_area; char *bcc_ptr = *pbcc_area;
cFYI(1, ("decode sessetup ascii. bleft %d", bleft)); cFYI(1, "decode sessetup ascii. bleft %d", bleft);
len = strnlen(bcc_ptr, bleft); len = strnlen(bcc_ptr, bleft);
if (len >= bleft) if (len >= bleft)
@ -344,7 +344,7 @@ static int decode_ascii_ssetup(char **pbcc_area, int bleft,
if (ses->serverOS) if (ses->serverOS)
strncpy(ses->serverOS, bcc_ptr, len); strncpy(ses->serverOS, bcc_ptr, len);
if (strncmp(ses->serverOS, "OS/2", 4) == 0) { if (strncmp(ses->serverOS, "OS/2", 4) == 0) {
cFYI(1, ("OS/2 server")); cFYI(1, "OS/2 server");
ses->flags |= CIFS_SES_OS2; ses->flags |= CIFS_SES_OS2;
} }
@ -373,7 +373,7 @@ static int decode_ascii_ssetup(char **pbcc_area, int bleft,
/* BB For newer servers which do not support Unicode, /* BB For newer servers which do not support Unicode,
but thus do return domain here we could add parsing but thus do return domain here we could add parsing
for it later, but it is not very important */ for it later, but it is not very important */
cFYI(1, ("ascii: bytes left %d", bleft)); cFYI(1, "ascii: bytes left %d", bleft);
return rc; return rc;
} }
@ -384,16 +384,16 @@ static int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len,
CHALLENGE_MESSAGE *pblob = (CHALLENGE_MESSAGE *)bcc_ptr; CHALLENGE_MESSAGE *pblob = (CHALLENGE_MESSAGE *)bcc_ptr;
if (blob_len < sizeof(CHALLENGE_MESSAGE)) { if (blob_len < sizeof(CHALLENGE_MESSAGE)) {
cERROR(1, ("challenge blob len %d too small", blob_len)); cERROR(1, "challenge blob len %d too small", blob_len);
return -EINVAL; return -EINVAL;
} }
if (memcmp(pblob->Signature, "NTLMSSP", 8)) { if (memcmp(pblob->Signature, "NTLMSSP", 8)) {
cERROR(1, ("blob signature incorrect %s", pblob->Signature)); cERROR(1, "blob signature incorrect %s", pblob->Signature);
return -EINVAL; return -EINVAL;
} }
if (pblob->MessageType != NtLmChallenge) { if (pblob->MessageType != NtLmChallenge) {
cERROR(1, ("Incorrect message type %d", pblob->MessageType)); cERROR(1, "Incorrect message type %d", pblob->MessageType);
return -EINVAL; return -EINVAL;
} }
@ -583,7 +583,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
type = ses->server->secType; type = ses->server->secType;
cFYI(1, ("sess setup type %d", type)); cFYI(1, "sess setup type %d", type);
ssetup_ntlmssp_authenticate: ssetup_ntlmssp_authenticate:
if (phase == NtLmChallenge) if (phase == NtLmChallenge)
phase = NtLmAuthenticate; /* if ntlmssp, now final phase */ phase = NtLmAuthenticate; /* if ntlmssp, now final phase */
@ -664,7 +664,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
changed to do higher than lanman dialect and changed to do higher than lanman dialect and
we reconnected would we ever calc signing_key? */ we reconnected would we ever calc signing_key? */
cFYI(1, ("Negotiating LANMAN setting up strings")); cFYI(1, "Negotiating LANMAN setting up strings");
/* Unicode not allowed for LANMAN dialects */ /* Unicode not allowed for LANMAN dialects */
ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); ascii_ssetup_strings(&bcc_ptr, ses, nls_cp);
#endif #endif
@ -758,17 +758,17 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
/* check version field to make sure that cifs.upcall is /* check version field to make sure that cifs.upcall is
sending us a response in an expected form */ sending us a response in an expected form */
if (msg->version != CIFS_SPNEGO_UPCALL_VERSION) { if (msg->version != CIFS_SPNEGO_UPCALL_VERSION) {
cERROR(1, ("incorrect version of cifs.upcall (expected" cERROR(1, "incorrect version of cifs.upcall (expected"
" %d but got %d)", " %d but got %d)",
CIFS_SPNEGO_UPCALL_VERSION, msg->version)); CIFS_SPNEGO_UPCALL_VERSION, msg->version);
rc = -EKEYREJECTED; rc = -EKEYREJECTED;
goto ssetup_exit; goto ssetup_exit;
} }
/* bail out if key is too long */ /* bail out if key is too long */
if (msg->sesskey_len > if (msg->sesskey_len >
sizeof(ses->server->mac_signing_key.data.krb5)) { sizeof(ses->server->mac_signing_key.data.krb5)) {
cERROR(1, ("Kerberos signing key too long (%u bytes)", cERROR(1, "Kerberos signing key too long (%u bytes)",
msg->sesskey_len)); msg->sesskey_len);
rc = -EOVERFLOW; rc = -EOVERFLOW;
goto ssetup_exit; goto ssetup_exit;
} }
@ -796,7 +796,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
/* BB: is this right? */ /* BB: is this right? */
ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); ascii_ssetup_strings(&bcc_ptr, ses, nls_cp);
#else /* ! CONFIG_CIFS_UPCALL */ #else /* ! CONFIG_CIFS_UPCALL */
cERROR(1, ("Kerberos negotiated but upcall support disabled!")); cERROR(1, "Kerberos negotiated but upcall support disabled!");
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
#endif /* CONFIG_CIFS_UPCALL */ #endif /* CONFIG_CIFS_UPCALL */
@ -804,12 +804,12 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
#ifdef CONFIG_CIFS_EXPERIMENTAL #ifdef CONFIG_CIFS_EXPERIMENTAL
if (type == RawNTLMSSP) { if (type == RawNTLMSSP) {
if ((pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) == 0) { if ((pSMB->req.hdr.Flags2 & SMBFLG2_UNICODE) == 0) {
cERROR(1, ("NTLMSSP requires Unicode support")); cERROR(1, "NTLMSSP requires Unicode support");
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
} }
cFYI(1, ("ntlmssp session setup phase %d", phase)); cFYI(1, "ntlmssp session setup phase %d", phase);
pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
capabilities |= CAP_EXTENDED_SECURITY; capabilities |= CAP_EXTENDED_SECURITY;
pSMB->req.Capabilities |= cpu_to_le32(capabilities); pSMB->req.Capabilities |= cpu_to_le32(capabilities);
@ -827,7 +827,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
on the response (challenge) */ on the response (challenge) */
smb_buf->Uid = ses->Suid; smb_buf->Uid = ses->Suid;
} else { } else {
cERROR(1, ("invalid phase %d", phase)); cERROR(1, "invalid phase %d", phase);
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
} }
@ -839,12 +839,12 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
} }
unicode_oslm_strings(&bcc_ptr, nls_cp); unicode_oslm_strings(&bcc_ptr, nls_cp);
} else { } else {
cERROR(1, ("secType %d not supported!", type)); cERROR(1, "secType %d not supported!", type);
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
} }
#else #else
cERROR(1, ("secType %d not supported!", type)); cERROR(1, "secType %d not supported!", type);
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
#endif #endif
@ -862,7 +862,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
CIFS_STD_OP /* not long */ | CIFS_LOG_ERROR); CIFS_STD_OP /* not long */ | CIFS_LOG_ERROR);
/* SMB request buf freed in SendReceive2 */ /* SMB request buf freed in SendReceive2 */
cFYI(1, ("ssetup rc from sendrecv2 is %d", rc)); cFYI(1, "ssetup rc from sendrecv2 is %d", rc);
pSMB = (SESSION_SETUP_ANDX *)iov[0].iov_base; pSMB = (SESSION_SETUP_ANDX *)iov[0].iov_base;
smb_buf = (struct smb_hdr *)iov[0].iov_base; smb_buf = (struct smb_hdr *)iov[0].iov_base;
@ -870,7 +870,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
if ((type == RawNTLMSSP) && (smb_buf->Status.CifsError == if ((type == RawNTLMSSP) && (smb_buf->Status.CifsError ==
cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED))) { cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED))) {
if (phase != NtLmNegotiate) { if (phase != NtLmNegotiate) {
cERROR(1, ("Unexpected more processing error")); cERROR(1, "Unexpected more processing error");
goto ssetup_exit; goto ssetup_exit;
} }
/* NTLMSSP Negotiate sent now processing challenge (response) */ /* NTLMSSP Negotiate sent now processing challenge (response) */
@ -882,14 +882,14 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
if ((smb_buf->WordCount != 3) && (smb_buf->WordCount != 4)) { if ((smb_buf->WordCount != 3) && (smb_buf->WordCount != 4)) {
rc = -EIO; rc = -EIO;
cERROR(1, ("bad word count %d", smb_buf->WordCount)); cERROR(1, "bad word count %d", smb_buf->WordCount);
goto ssetup_exit; goto ssetup_exit;
} }
action = le16_to_cpu(pSMB->resp.Action); action = le16_to_cpu(pSMB->resp.Action);
if (action & GUEST_LOGIN) if (action & GUEST_LOGIN)
cFYI(1, ("Guest login")); /* BB mark SesInfo struct? */ cFYI(1, "Guest login"); /* BB mark SesInfo struct? */
ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */ ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */
cFYI(1, ("UID = %d ", ses->Suid)); cFYI(1, "UID = %d ", ses->Suid);
/* response can have either 3 or 4 word count - Samba sends 3 */ /* response can have either 3 or 4 word count - Samba sends 3 */
/* and lanman response is 3 */ /* and lanman response is 3 */
bytes_remaining = BCC(smb_buf); bytes_remaining = BCC(smb_buf);
@ -899,7 +899,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
__u16 blob_len; __u16 blob_len;
blob_len = le16_to_cpu(pSMB->resp.SecurityBlobLength); blob_len = le16_to_cpu(pSMB->resp.SecurityBlobLength);
if (blob_len > bytes_remaining) { if (blob_len > bytes_remaining) {
cERROR(1, ("bad security blob length %d", blob_len)); cERROR(1, "bad security blob length %d", blob_len);
rc = -EINVAL; rc = -EINVAL;
goto ssetup_exit; goto ssetup_exit;
} }
@ -933,7 +933,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
} }
kfree(str_area); kfree(str_area);
if (resp_buf_type == CIFS_SMALL_BUFFER) { if (resp_buf_type == CIFS_SMALL_BUFFER) {
cFYI(1, ("ssetup freeing small buf %p", iov[0].iov_base)); cFYI(1, "ssetup freeing small buf %p", iov[0].iov_base);
cifs_small_buf_release(iov[0].iov_base); cifs_small_buf_release(iov[0].iov_base);
} else if (resp_buf_type == CIFS_LARGE_BUFFER) } else if (resp_buf_type == CIFS_LARGE_BUFFER)
cifs_buf_release(iov[0].iov_base); cifs_buf_release(iov[0].iov_base);

View File

@ -43,7 +43,7 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
struct mid_q_entry *temp; struct mid_q_entry *temp;
if (server == NULL) { if (server == NULL) {
cERROR(1, ("Null TCP session in AllocMidQEntry")); cERROR(1, "Null TCP session in AllocMidQEntry");
return NULL; return NULL;
} }
@ -55,7 +55,7 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
temp->mid = smb_buffer->Mid; /* always LE */ temp->mid = smb_buffer->Mid; /* always LE */
temp->pid = current->pid; temp->pid = current->pid;
temp->command = smb_buffer->Command; temp->command = smb_buffer->Command;
cFYI(1, ("For smb_command %d", temp->command)); cFYI(1, "For smb_command %d", temp->command);
/* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */
/* when mid allocated can be before when sent */ /* when mid allocated can be before when sent */
temp->when_alloc = jiffies; temp->when_alloc = jiffies;
@ -140,7 +140,7 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
total_len += iov[i].iov_len; total_len += iov[i].iov_len;
smb_buffer->smb_buf_length = cpu_to_be32(smb_buffer->smb_buf_length); smb_buffer->smb_buf_length = cpu_to_be32(smb_buffer->smb_buf_length);
cFYI(1, ("Sending smb: total_len %d", total_len)); cFYI(1, "Sending smb: total_len %d", total_len);
dump_smb(smb_buffer, len); dump_smb(smb_buffer, len);
i = 0; i = 0;
@ -168,9 +168,8 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
reconnect which may clear the network problem. reconnect which may clear the network problem.
*/ */
if ((i >= 14) || (!server->noblocksnd && (i > 2))) { if ((i >= 14) || (!server->noblocksnd && (i > 2))) {
cERROR(1, cERROR(1, "sends on sock %p stuck for 15 seconds",
("sends on sock %p stuck for 15 seconds", ssocket);
ssocket));
rc = -EAGAIN; rc = -EAGAIN;
break; break;
} }
@ -184,13 +183,13 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
total_len = 0; total_len = 0;
break; break;
} else if (rc > total_len) { } else if (rc > total_len) {
cERROR(1, ("sent %d requested %d", rc, total_len)); cERROR(1, "sent %d requested %d", rc, total_len);
break; break;
} }
if (rc == 0) { if (rc == 0) {
/* should never happen, letting socket clear before /* should never happen, letting socket clear before
retrying is our only obvious option here */ retrying is our only obvious option here */
cERROR(1, ("tcp sent no data")); cERROR(1, "tcp sent no data");
msleep(500); msleep(500);
continue; continue;
} }
@ -213,8 +212,8 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
} }
if ((total_len > 0) && (total_len != smb_buf_length + 4)) { if ((total_len > 0) && (total_len != smb_buf_length + 4)) {
cFYI(1, ("partial send (%d remaining), terminating session", cFYI(1, "partial send (%d remaining), terminating session",
total_len)); total_len);
/* If we have only sent part of an SMB then the next SMB /* If we have only sent part of an SMB then the next SMB
could be taken as the remainder of this one. We need could be taken as the remainder of this one. We need
to kill the socket so the server throws away the partial to kill the socket so the server throws away the partial
@ -223,7 +222,7 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
} }
if (rc < 0) { if (rc < 0) {
cERROR(1, ("Error %d sending data on socket to server", rc)); cERROR(1, "Error %d sending data on socket to server", rc);
} else } else
rc = 0; rc = 0;
@ -296,7 +295,7 @@ static int allocate_mid(struct cifsSesInfo *ses, struct smb_hdr *in_buf,
} }
if (ses->server->tcpStatus == CifsNeedReconnect) { if (ses->server->tcpStatus == CifsNeedReconnect) {
cFYI(1, ("tcp session dead - return to caller to retry")); cFYI(1, "tcp session dead - return to caller to retry");
return -EAGAIN; return -EAGAIN;
} }
@ -348,7 +347,7 @@ static int wait_for_response(struct cifsSesInfo *ses,
lrt += time_to_wait; lrt += time_to_wait;
if (time_after(jiffies, lrt)) { if (time_after(jiffies, lrt)) {
/* No replies for time_to_wait. */ /* No replies for time_to_wait. */
cERROR(1, ("server not responding")); cERROR(1, "server not responding");
return -1; return -1;
} }
} else { } else {
@ -379,7 +378,7 @@ SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses,
iov[0].iov_len = in_buf->smb_buf_length + 4; iov[0].iov_len = in_buf->smb_buf_length + 4;
flags |= CIFS_NO_RESP; flags |= CIFS_NO_RESP;
rc = SendReceive2(xid, ses, iov, 1, &resp_buf_type, flags); rc = SendReceive2(xid, ses, iov, 1, &resp_buf_type, flags);
cFYI(DBG2, ("SendRcvNoRsp flags %d rc %d", flags, rc)); cFYI(DBG2, "SendRcvNoRsp flags %d rc %d", flags, rc);
return rc; return rc;
} }
@ -402,7 +401,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
if ((ses == NULL) || (ses->server == NULL)) { if ((ses == NULL) || (ses->server == NULL)) {
cifs_small_buf_release(in_buf); cifs_small_buf_release(in_buf);
cERROR(1, ("Null session")); cERROR(1, "Null session");
return -EIO; return -EIO;
} }
@ -471,7 +470,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
else if (long_op == CIFS_BLOCKING_OP) else if (long_op == CIFS_BLOCKING_OP)
timeout = 0x7FFFFFFF; /* large, but not so large as to wrap */ timeout = 0x7FFFFFFF; /* large, but not so large as to wrap */
else { else {
cERROR(1, ("unknown timeout flag %d", long_op)); cERROR(1, "unknown timeout flag %d", long_op);
rc = -EIO; rc = -EIO;
goto out; goto out;
} }
@ -490,8 +489,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
if (midQ->resp_buf == NULL) { if (midQ->resp_buf == NULL) {
cERROR(1, ("No response to cmd %d mid %d", cERROR(1, "No response to cmd %d mid %d",
midQ->command, midQ->mid)); midQ->command, midQ->mid);
if (midQ->midState == MID_REQUEST_SUBMITTED) { if (midQ->midState == MID_REQUEST_SUBMITTED) {
if (ses->server->tcpStatus == CifsExiting) if (ses->server->tcpStatus == CifsExiting)
rc = -EHOSTDOWN; rc = -EHOSTDOWN;
@ -504,7 +503,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
if (rc != -EHOSTDOWN) { if (rc != -EHOSTDOWN) {
if (midQ->midState == MID_RETRY_NEEDED) { if (midQ->midState == MID_RETRY_NEEDED) {
rc = -EAGAIN; rc = -EAGAIN;
cFYI(1, ("marking request for retry")); cFYI(1, "marking request for retry");
} else { } else {
rc = -EIO; rc = -EIO;
} }
@ -521,8 +520,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
receive_len = midQ->resp_buf->smb_buf_length; receive_len = midQ->resp_buf->smb_buf_length;
if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
cERROR(1, ("Frame too large received. Length: %d Xid: %d", cERROR(1, "Frame too large received. Length: %d Xid: %d",
receive_len, xid)); receive_len, xid);
rc = -EIO; rc = -EIO;
goto out; goto out;
} }
@ -548,7 +547,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
&ses->server->mac_signing_key, &ses->server->mac_signing_key,
midQ->sequence_number+1); midQ->sequence_number+1);
if (rc) { if (rc) {
cERROR(1, ("Unexpected SMB signature")); cERROR(1, "Unexpected SMB signature");
/* BB FIXME add code to kill session */ /* BB FIXME add code to kill session */
} }
} }
@ -569,7 +568,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
DeleteMidQEntry */ DeleteMidQEntry */
} else { } else {
rc = -EIO; rc = -EIO;
cFYI(1, ("Bad MID state?")); cFYI(1, "Bad MID state?");
} }
out: out:
@ -591,11 +590,11 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
struct mid_q_entry *midQ; struct mid_q_entry *midQ;
if (ses == NULL) { if (ses == NULL) {
cERROR(1, ("Null smb session")); cERROR(1, "Null smb session");
return -EIO; return -EIO;
} }
if (ses->server == NULL) { if (ses->server == NULL) {
cERROR(1, ("Null tcp session")); cERROR(1, "Null tcp session");
return -EIO; return -EIO;
} }
@ -607,8 +606,8 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
use ses->maxReq */ use ses->maxReq */
if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cERROR(1, ("Illegal length, greater than maximum frame, %d", cERROR(1, "Illegal length, greater than maximum frame, %d",
in_buf->smb_buf_length)); in_buf->smb_buf_length);
return -EIO; return -EIO;
} }
@ -665,7 +664,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
else if (long_op == CIFS_BLOCKING_OP) else if (long_op == CIFS_BLOCKING_OP)
timeout = 0x7FFFFFFF; /* large but no so large as to wrap */ timeout = 0x7FFFFFFF; /* large but no so large as to wrap */
else { else {
cERROR(1, ("unknown timeout flag %d", long_op)); cERROR(1, "unknown timeout flag %d", long_op);
rc = -EIO; rc = -EIO;
goto out; goto out;
} }
@ -681,8 +680,8 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
if (midQ->resp_buf == NULL) { if (midQ->resp_buf == NULL) {
cERROR(1, ("No response for cmd %d mid %d", cERROR(1, "No response for cmd %d mid %d",
midQ->command, midQ->mid)); midQ->command, midQ->mid);
if (midQ->midState == MID_REQUEST_SUBMITTED) { if (midQ->midState == MID_REQUEST_SUBMITTED) {
if (ses->server->tcpStatus == CifsExiting) if (ses->server->tcpStatus == CifsExiting)
rc = -EHOSTDOWN; rc = -EHOSTDOWN;
@ -695,7 +694,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
if (rc != -EHOSTDOWN) { if (rc != -EHOSTDOWN) {
if (midQ->midState == MID_RETRY_NEEDED) { if (midQ->midState == MID_RETRY_NEEDED) {
rc = -EAGAIN; rc = -EAGAIN;
cFYI(1, ("marking request for retry")); cFYI(1, "marking request for retry");
} else { } else {
rc = -EIO; rc = -EIO;
} }
@ -712,8 +711,8 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
receive_len = midQ->resp_buf->smb_buf_length; receive_len = midQ->resp_buf->smb_buf_length;
if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
cERROR(1, ("Frame too large received. Length: %d Xid: %d", cERROR(1, "Frame too large received. Length: %d Xid: %d",
receive_len, xid)); receive_len, xid);
rc = -EIO; rc = -EIO;
goto out; goto out;
} }
@ -736,7 +735,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
&ses->server->mac_signing_key, &ses->server->mac_signing_key,
midQ->sequence_number+1); midQ->sequence_number+1);
if (rc) { if (rc) {
cERROR(1, ("Unexpected SMB signature")); cERROR(1, "Unexpected SMB signature");
/* BB FIXME add code to kill session */ /* BB FIXME add code to kill session */
} }
} }
@ -753,7 +752,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf)); BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf));
} else { } else {
rc = -EIO; rc = -EIO;
cERROR(1, ("Bad MID state?")); cERROR(1, "Bad MID state?");
} }
out: out:
@ -824,13 +823,13 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
struct cifsSesInfo *ses; struct cifsSesInfo *ses;
if (tcon == NULL || tcon->ses == NULL) { if (tcon == NULL || tcon->ses == NULL) {
cERROR(1, ("Null smb session")); cERROR(1, "Null smb session");
return -EIO; return -EIO;
} }
ses = tcon->ses; ses = tcon->ses;
if (ses->server == NULL) { if (ses->server == NULL) {
cERROR(1, ("Null tcp session")); cERROR(1, "Null tcp session");
return -EIO; return -EIO;
} }
@ -842,8 +841,8 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
use ses->maxReq */ use ses->maxReq */
if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cERROR(1, ("Illegal length, greater than maximum frame, %d", cERROR(1, "Illegal length, greater than maximum frame, %d",
in_buf->smb_buf_length)); in_buf->smb_buf_length);
return -EIO; return -EIO;
} }
@ -933,8 +932,8 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
receive_len = midQ->resp_buf->smb_buf_length; receive_len = midQ->resp_buf->smb_buf_length;
} else { } else {
cERROR(1, ("No response for cmd %d mid %d", cERROR(1, "No response for cmd %d mid %d",
midQ->command, midQ->mid)); midQ->command, midQ->mid);
if (midQ->midState == MID_REQUEST_SUBMITTED) { if (midQ->midState == MID_REQUEST_SUBMITTED) {
if (ses->server->tcpStatus == CifsExiting) if (ses->server->tcpStatus == CifsExiting)
rc = -EHOSTDOWN; rc = -EHOSTDOWN;
@ -947,7 +946,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
if (rc != -EHOSTDOWN) { if (rc != -EHOSTDOWN) {
if (midQ->midState == MID_RETRY_NEEDED) { if (midQ->midState == MID_RETRY_NEEDED) {
rc = -EAGAIN; rc = -EAGAIN;
cFYI(1, ("marking request for retry")); cFYI(1, "marking request for retry");
} else { } else {
rc = -EIO; rc = -EIO;
} }
@ -958,8 +957,8 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
} }
if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) { if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
cERROR(1, ("Frame too large received. Length: %d Xid: %d", cERROR(1, "Frame too large received. Length: %d Xid: %d",
receive_len, xid)); receive_len, xid);
rc = -EIO; rc = -EIO;
goto out; goto out;
} }
@ -968,7 +967,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
if ((out_buf == NULL) || (midQ->midState != MID_RESPONSE_RECEIVED)) { if ((out_buf == NULL) || (midQ->midState != MID_RESPONSE_RECEIVED)) {
rc = -EIO; rc = -EIO;
cERROR(1, ("Bad MID state?")); cERROR(1, "Bad MID state?");
goto out; goto out;
} }
@ -986,7 +985,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
&ses->server->mac_signing_key, &ses->server->mac_signing_key,
midQ->sequence_number+1); midQ->sequence_number+1);
if (rc) { if (rc) {
cERROR(1, ("Unexpected SMB signature")); cERROR(1, "Unexpected SMB signature");
/* BB FIXME add code to kill session */ /* BB FIXME add code to kill session */
} }
} }

View File

@ -70,12 +70,12 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
return rc; return rc;
} }
if (ea_name == NULL) { if (ea_name == NULL) {
cFYI(1, ("Null xattr names not supported")); cFYI(1, "Null xattr names not supported");
} else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5)
&& (strncmp(ea_name, CIFS_XATTR_OS2_PREFIX, 4))) { && (strncmp(ea_name, CIFS_XATTR_OS2_PREFIX, 4))) {
cFYI(1, cFYI(1,
("illegal xattr request %s (only user namespace supported)", "illegal xattr request %s (only user namespace supported)",
ea_name)); ea_name);
/* BB what if no namespace prefix? */ /* BB what if no namespace prefix? */
/* Should we just pass them to server, except for /* Should we just pass them to server, except for
system and perhaps security prefixes? */ system and perhaps security prefixes? */
@ -131,19 +131,19 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
search server for EAs or streams to search server for EAs or streams to
returns as xattrs */ returns as xattrs */
if (value_size > MAX_EA_VALUE_SIZE) { if (value_size > MAX_EA_VALUE_SIZE) {
cFYI(1, ("size of EA value too large")); cFYI(1, "size of EA value too large");
kfree(full_path); kfree(full_path);
FreeXid(xid); FreeXid(xid);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (ea_name == NULL) { if (ea_name == NULL) {
cFYI(1, ("Null xattr names not supported")); cFYI(1, "Null xattr names not supported");
} else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) { } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) {
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
goto set_ea_exit; goto set_ea_exit;
if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0)
cFYI(1, ("attempt to set cifs inode metadata")); cFYI(1, "attempt to set cifs inode metadata");
ea_name += 5; /* skip past user. prefix */ ea_name += 5; /* skip past user. prefix */
rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value, rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
@ -169,9 +169,9 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
ACL_TYPE_ACCESS, cifs_sb->local_nls, ACL_TYPE_ACCESS, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
cFYI(1, ("set POSIX ACL rc %d", rc)); cFYI(1, "set POSIX ACL rc %d", rc);
#else #else
cFYI(1, ("set POSIX ACL not supported")); cFYI(1, "set POSIX ACL not supported");
#endif #endif
} else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT,
strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) {
@ -182,13 +182,13 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
ACL_TYPE_DEFAULT, cifs_sb->local_nls, ACL_TYPE_DEFAULT, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
cFYI(1, ("set POSIX default ACL rc %d", rc)); cFYI(1, "set POSIX default ACL rc %d", rc);
#else #else
cFYI(1, ("set default POSIX ACL not supported")); cFYI(1, "set default POSIX ACL not supported");
#endif #endif
} else { } else {
cFYI(1, ("illegal xattr request %s (only user namespace" cFYI(1, "illegal xattr request %s (only user namespace"
" supported)", ea_name)); " supported)", ea_name);
/* BB what if no namespace prefix? */ /* BB what if no namespace prefix? */
/* Should we just pass them to server, except for /* Should we just pass them to server, except for
system and perhaps security prefixes? */ system and perhaps security prefixes? */
@ -235,13 +235,13 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
/* return dos attributes as pseudo xattr */ /* return dos attributes as pseudo xattr */
/* return alt name if available as pseudo attr */ /* return alt name if available as pseudo attr */
if (ea_name == NULL) { if (ea_name == NULL) {
cFYI(1, ("Null xattr names not supported")); cFYI(1, "Null xattr names not supported");
} else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) { } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) {
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
goto get_ea_exit; goto get_ea_exit;
if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) { if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) {
cFYI(1, ("attempt to query cifs inode metadata")); cFYI(1, "attempt to query cifs inode metadata");
/* revalidate/getattr then populate from inode */ /* revalidate/getattr then populate from inode */
} /* BB add else when above is implemented */ } /* BB add else when above is implemented */
ea_name += 5; /* skip past user. prefix */ ea_name += 5; /* skip past user. prefix */
@ -287,7 +287,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
} }
#endif /* EXPERIMENTAL */ #endif /* EXPERIMENTAL */
#else #else
cFYI(1, ("query POSIX ACL not supported yet")); cFYI(1, "query POSIX ACL not supported yet");
#endif /* CONFIG_CIFS_POSIX */ #endif /* CONFIG_CIFS_POSIX */
} else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT,
strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) {
@ -299,18 +299,18 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
#else #else
cFYI(1, ("query POSIX default ACL not supported yet")); cFYI(1, "query POSIX default ACL not supported yet");
#endif #endif
} else if (strncmp(ea_name, } else if (strncmp(ea_name,
CIFS_XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) { CIFS_XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) {
cFYI(1, ("Trusted xattr namespace not supported yet")); cFYI(1, "Trusted xattr namespace not supported yet");
} else if (strncmp(ea_name, } else if (strncmp(ea_name,
CIFS_XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) { CIFS_XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) {
cFYI(1, ("Security xattr namespace not supported yet")); cFYI(1, "Security xattr namespace not supported yet");
} else } else
cFYI(1, cFYI(1,
("illegal xattr request %s (only user namespace supported)", "illegal xattr request %s (only user namespace supported)",
ea_name)); ea_name);
/* We could add an additional check for streams ie /* We could add an additional check for streams ie
if proc/fs/cifs/streamstoxattr is set then if proc/fs/cifs/streamstoxattr is set then