[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg

It's not obvious from reading the macro names that these macros
are for debugging.  Convert the names to a single more typical
kernel style cifs_dbg macro.

	cERROR(1, ...)   -> cifs_dbg(VFS, ...)
	cFYI(1, ...)     -> cifs_dbg(FYI, ...)
	cFYI(DBG2, ...)  -> cifs_dbg(NOISY, ...)

Move the terminating format newline from the macro to the call site.

Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the
"CIFS VFS: " prefix for VFS messages.

Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y)

$ size fs/cifs/cifs.ko*
   text    data     bss     dec     hex filename
 265245	   2525	    132	 267902	  4167e	fs/cifs/cifs.ko.new
 268359    2525     132  271016   422a8 fs/cifs/cifs.ko.old

Other miscellaneous changes around these conversions:

o Miscellaneous typo fixes
o Add terminating \n's to almost all formats and remove them
  from the macros to be more kernel style like.  A few formats
  previously had defective \n's
o Remove unnecessary OOM messages as kmalloc() calls dump_stack
o Coalesce formats to make grep easier,
  added missing spaces when coalescing formats
o Use %s, __func__ instead of embedded function name
o Removed unnecessary "cifs: " prefixes
o Convert kzalloc with multiply to kcalloc
o Remove unused cifswarn macro

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:
Joe Perches 2013-05-04 22:12:25 -05:00 коммит произвёл Steve French
Родитель f7f7c1850e
Коммит f96637be08
36 изменённых файлов: 1223 добавлений и 1227 удалений

Просмотреть файл

@ -506,11 +506,11 @@ decode_negTokenInit(unsigned char *security_blob, int length,
/* GSSAPI header */ /* GSSAPI header */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding negTokenInit header"); cifs_dbg(FYI, "Error decoding negTokenInit header\n");
return 0; return 0;
} else if ((cls != ASN1_APL) || (con != ASN1_CON) } else if ((cls != ASN1_APL) || (con != ASN1_CON)
|| (tag != ASN1_EOC)) { || (tag != ASN1_EOC)) {
cFYI(1, "cls = %d con = %d tag = %d", cls, con, tag); cifs_dbg(FYI, "cls = %d con = %d tag = %d\n", cls, con, tag);
return 0; return 0;
} }
@ -531,52 +531,52 @@ decode_negTokenInit(unsigned char *security_blob, int length,
/* SPNEGO OID not present or garbled -- bail out */ /* SPNEGO OID not present or garbled -- bail out */
if (!rc) { if (!rc) {
cFYI(1, "Error decoding negTokenInit header"); cifs_dbg(FYI, "Error decoding negTokenInit header\n");
return 0; return 0;
} }
/* SPNEGO */ /* SPNEGO */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding negTokenInit"); cifs_dbg(FYI, "Error decoding negTokenInit\n");
return 0; return 0;
} else if ((cls != ASN1_CTX) || (con != ASN1_CON) } else if ((cls != ASN1_CTX) || (con != ASN1_CON)
|| (tag != ASN1_EOC)) { || (tag != ASN1_EOC)) {
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0", cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
cls, con, tag, end, *end); cls, con, tag, end, *end);
return 0; return 0;
} }
/* negTokenInit */ /* negTokenInit */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding negTokenInit"); cifs_dbg(FYI, "Error decoding negTokenInit\n");
return 0; return 0;
} else if ((cls != ASN1_UNI) || (con != ASN1_CON) } else if ((cls != ASN1_UNI) || (con != ASN1_CON)
|| (tag != ASN1_SEQ)) { || (tag != ASN1_SEQ)) {
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1", cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
cls, con, tag, end, *end); cls, con, tag, end, *end);
return 0; return 0;
} }
/* sequence */ /* sequence */
if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) { if (asn1_header_decode(&ctx, &end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding 2nd part of negTokenInit"); cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n");
return 0; return 0;
} else if ((cls != ASN1_CTX) || (con != ASN1_CON) } else if ((cls != ASN1_CTX) || (con != ASN1_CON)
|| (tag != ASN1_EOC)) { || (tag != ASN1_EOC)) {
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 0", cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
cls, con, tag, end, *end); cls, con, tag, end, *end);
return 0; return 0;
} }
/* sequence of */ /* sequence of */
if (asn1_header_decode if (asn1_header_decode
(&ctx, &sequence_end, &cls, &con, &tag) == 0) { (&ctx, &sequence_end, &cls, &con, &tag) == 0) {
cFYI(1, "Error decoding 2nd part of negTokenInit"); cifs_dbg(FYI, "Error decoding 2nd part of negTokenInit\n");
return 0; return 0;
} else if ((cls != ASN1_UNI) || (con != ASN1_CON) } else if ((cls != ASN1_UNI) || (con != ASN1_CON)
|| (tag != ASN1_SEQ)) { || (tag != ASN1_SEQ)) {
cFYI(1, "cls = %d con = %d tag = %d end = %p (%d) exit 1", cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
cls, con, tag, end, *end); cls, con, tag, end, *end);
return 0; return 0;
} }
@ -584,15 +584,15 @@ decode_negTokenInit(unsigned char *security_blob, int length,
while (!asn1_eoc_decode(&ctx, sequence_end)) { while (!asn1_eoc_decode(&ctx, sequence_end)) {
rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag); rc = asn1_header_decode(&ctx, &end, &cls, &con, &tag);
if (!rc) { if (!rc) {
cFYI(1, "Error decoding negTokenInit hdr exit2"); cifs_dbg(FYI, "Error decoding negTokenInit hdr exit2\n");
return 0; return 0;
} }
if ((tag == ASN1_OJI) && (con == ASN1_PRI)) { if ((tag == ASN1_OJI) && (con == ASN1_PRI)) {
if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) { if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) {
cFYI(1, "OID len = %d oid = 0x%lx 0x%lx " cifs_dbg(FYI, "OID len = %d oid = 0x%lx 0x%lx 0x%lx 0x%lx\n",
"0x%lx 0x%lx", oidlen, *oid, oidlen, *oid, *(oid + 1), *(oid + 2),
*(oid + 1), *(oid + 2), *(oid + 3)); *(oid + 3));
if (compare_oid(oid, oidlen, MSKRB5_OID, if (compare_oid(oid, oidlen, MSKRB5_OID,
MSKRB5_OID_LEN)) MSKRB5_OID_LEN))
@ -610,7 +610,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
kfree(oid); kfree(oid);
} }
} else { } else {
cFYI(1, "Should be an oid what is going on?"); cifs_dbg(FYI, "Should be an oid what is going on?\n");
} }
} }

Просмотреть файл

@ -92,7 +92,7 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data,
break; break;
default: default:
cERROR(1, "Unknown network family '%d'", sa->sa_family); cifs_dbg(VFS, "Unknown network family '%d'\n", sa->sa_family);
key_len = 0; key_len = 0;
break; break;
} }
@ -152,7 +152,7 @@ static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer,
sharename = extract_sharename(tcon->treeName); sharename = extract_sharename(tcon->treeName);
if (IS_ERR(sharename)) { if (IS_ERR(sharename)) {
cFYI(1, "%s: couldn't extract sharename", __func__); cifs_dbg(FYI, "%s: couldn't extract sharename\n", __func__);
sharename = NULL; sharename = NULL;
return 0; return 0;
} }
@ -302,7 +302,7 @@ static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data)
pagevec_init(&pvec, 0); pagevec_init(&pvec, 0);
first = 0; first = 0;
cFYI(1, "%s: cifs inode 0x%p now uncached", __func__, cifsi); cifs_dbg(FYI, "%s: cifs inode 0x%p now uncached\n", __func__, cifsi);
for (;;) { for (;;) {
nr_pages = pagevec_lookup(&pvec, nr_pages = pagevec_lookup(&pvec,

Просмотреть файл

@ -57,15 +57,32 @@ cifs_dump_mem(char *label, void *data, int length)
} }
} }
#ifdef CONFIG_CIFS_DEBUG
void cifs_vfs_err(const char *fmt, ...)
{
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
printk(KERN_ERR "CIFS VFS: %pV", &vaf);
va_end(args);
}
#endif
void cifs_dump_detail(void *buf) void cifs_dump_detail(void *buf)
{ {
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
struct smb_hdr *smb = (struct smb_hdr *)buf; struct smb_hdr *smb = (struct smb_hdr *)buf;
cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d\n",
smb->Command, smb->Status.CifsError, smb->Command, smb->Status.CifsError,
smb->Flags, smb->Flags2, smb->Mid, smb->Pid); smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
cERROR(1, "smb buf %p len %u", smb, smbCalcSize(smb)); cifs_dbg(VFS, "smb buf %p len %u\n", smb, smbCalcSize(smb));
#endif /* CONFIG_CIFS_DEBUG2 */ #endif /* CONFIG_CIFS_DEBUG2 */
} }
@ -78,25 +95,25 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
if (server == NULL) if (server == NULL)
return; return;
cERROR(1, "Dump pending requests:"); cifs_dbg(VFS, "Dump pending requests:\n");
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
list_for_each(tmp, &server->pending_mid_q) { list_for_each(tmp, &server->pending_mid_q) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu", cifs_dbg(VFS, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu\n",
mid_entry->mid_state, mid_entry->mid_state,
le16_to_cpu(mid_entry->command), le16_to_cpu(mid_entry->command),
mid_entry->pid, mid_entry->pid,
mid_entry->callback_data, mid_entry->callback_data,
mid_entry->mid); mid_entry->mid);
#ifdef CONFIG_CIFS_STATS2 #ifdef CONFIG_CIFS_STATS2
cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld", cifs_dbg(VFS, "IsLarge: %d buf: %p time rcv: %ld now: %ld\n",
mid_entry->large_buf, mid_entry->large_buf,
mid_entry->resp_buf, mid_entry->resp_buf,
mid_entry->when_received, mid_entry->when_received,
jiffies); jiffies);
#endif /* STATS2 */ #endif /* STATS2 */
cERROR(1, "IsMult: %d IsEnd: %d", mid_entry->multiRsp, cifs_dbg(VFS, "IsMult: %d IsEnd: %d\n",
mid_entry->multiEnd); mid_entry->multiRsp, mid_entry->multiEnd);
if (mid_entry->resp_buf) { if (mid_entry->resp_buf) {
cifs_dump_detail(mid_entry->resp_buf); cifs_dump_detail(mid_entry->resp_buf);
cifs_dump_mem("existing buf: ", cifs_dump_mem("existing buf: ",
@ -603,7 +620,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
global_secflags = CIFSSEC_MAX; global_secflags = CIFSSEC_MAX;
return count; return count;
} else if (!isdigit(c)) { } else if (!isdigit(c)) {
cERROR(1, "invalid flag %c", c); cifs_dbg(VFS, "invalid flag %c\n", c);
return -EINVAL; return -EINVAL;
} }
} }
@ -611,16 +628,16 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
flags = simple_strtoul(flags_string, NULL, 0); flags = simple_strtoul(flags_string, NULL, 0);
cFYI(1, "sec flags 0x%x", flags); cifs_dbg(FYI, "sec flags 0x%x\n", flags);
if (flags <= 0) { if (flags <= 0) {
cERROR(1, "invalid security flags %s", flags_string); cifs_dbg(VFS, "invalid security flags %s\n", flags_string);
return -EINVAL; return -EINVAL;
} }
if (flags & ~CIFSSEC_MASK) { if (flags & ~CIFSSEC_MASK) {
cERROR(1, "attempt to set unsupported security flags 0x%x", cifs_dbg(VFS, "attempt to set unsupported security flags 0x%x\n",
flags & ~CIFSSEC_MASK); flags & ~CIFSSEC_MASK);
return -EINVAL; return -EINVAL;
} }
/* flags look ok - update the global security flags for cifs module */ /* flags look ok - update the global security flags for cifs module */
@ -628,9 +645,9 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
if (global_secflags & CIFSSEC_MUST_SIGN) { if (global_secflags & CIFSSEC_MUST_SIGN) {
/* requiring signing implies signing is allowed */ /* requiring signing implies signing is allowed */
global_secflags |= CIFSSEC_MAY_SIGN; global_secflags |= CIFSSEC_MAY_SIGN;
cFYI(1, "packet signing now required"); cifs_dbg(FYI, "packet signing now required\n");
} else if ((global_secflags & CIFSSEC_MAY_SIGN) == 0) { } else if ((global_secflags & CIFSSEC_MAY_SIGN) == 0) {
cFYI(1, "packet signing disabled"); cifs_dbg(FYI, "packet signing disabled\n");
} }
/* BB should we turn on MAY flags for other MUST options? */ /* BB should we turn on MAY flags for other MUST options? */
return count; return count;

Просмотреть файл

@ -25,18 +25,20 @@
void cifs_dump_mem(char *label, void *data, int length); void cifs_dump_mem(char *label, void *data, int length);
void cifs_dump_detail(void *); void cifs_dump_detail(void *);
void cifs_dump_mids(struct TCP_Server_Info *); void cifs_dump_mids(struct TCP_Server_Info *);
#ifdef CONFIG_CIFS_DEBUG2
#define DBG2 2
#else
#define DBG2 0
#endif
extern int traceSMB; /* flag which enables the function below */ extern int traceSMB; /* flag which enables the function below */
void dump_smb(void *, int); void dump_smb(void *, int);
#define CIFS_INFO 0x01 #define CIFS_INFO 0x01
#define CIFS_RC 0x02 #define CIFS_RC 0x02
#define CIFS_TIMER 0x04 #define CIFS_TIMER 0x04
#define VFS 1
#define FYI 2
extern int cifsFYI; extern int cifsFYI;
#ifdef CONFIG_CIFS_DEBUG2
#define NOISY 4
#else
#define NOISY 0
#endif
/* /*
* debug ON * debug ON
@ -44,31 +46,21 @@ extern int cifsFYI;
*/ */
#ifdef CONFIG_CIFS_DEBUG #ifdef CONFIG_CIFS_DEBUG
__printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
/* information message: e.g., configuration, major event */ /* information message: e.g., configuration, major event */
#define cifsfyi(fmt, ...) \ #define cifs_dbg(type, fmt, ...) \
do { \ do { \
if (cifsFYI & CIFS_INFO) \ if (type == FYI) { \
printk(KERN_DEBUG "%s: " fmt "\n", \ if (cifsFYI & CIFS_INFO) { \
__FILE__, ##__VA_ARGS__); \ printk(KERN_DEBUG "%s: " fmt, \
} while (0) __FILE__, ##__VA_ARGS__); \
} \
#define cFYI(set, fmt, ...) \ } else if (type == VFS) { \
do { \ cifs_vfs_err(fmt, ##__VA_ARGS__); \
if (set) \ } else if (type == NOISY && type != 0) { \
cifsfyi(fmt, ##__VA_ARGS__); \ printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
} while (0) } \
#define cifswarn(fmt, ...) \
printk(KERN_WARNING fmt "\n", ##__VA_ARGS__)
/* error event message: e.g., i/o error */
#define cifserror(fmt, ...) \
printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
#define cERROR(set, fmt, ...) \
do { \
if (set) \
cifserror(fmt, ##__VA_ARGS__); \
} while (0) } while (0)
/* /*
@ -76,27 +68,11 @@ do { \
* --------- * ---------
*/ */
#else /* _CIFS_DEBUG */ #else /* _CIFS_DEBUG */
#define cifsfyi(fmt, ...) \ #define cifs_dbg(type, fmt, ...) \
do { \ do { \
if (0) \ if (0) \
printk(KERN_DEBUG "%s: " fmt "\n", \ printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
__FILE__, ##__VA_ARGS__); \
} while (0) } while (0)
#define cFYI(set, fmt, ...) \ #endif
do { \
if (0 && set) \
cifsfyi(fmt, ##__VA_ARGS__); \
} while (0)
#define cifserror(fmt, ...) \
do { \
if (0) \
printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
} while (0)
#define cERROR(set, fmt, ...) \
do { \
if (0 && set) \
cifserror(fmt, ##__VA_ARGS__); \
} while (0)
#endif /* _CIFS_DEBUG */
#endif /* _H_CIFS_DEBUG */ #endif /* _H_CIFS_DEBUG */

Просмотреть файл

@ -84,8 +84,8 @@ static char *cifs_get_share_name(const char *node_name)
/* find server name end */ /* find server name end */
pSep = memchr(UNC+2, '\\', len-2); pSep = memchr(UNC+2, '\\', len-2);
if (!pSep) { if (!pSep) {
cERROR(1, "%s: no server name end in node name: %s", cifs_dbg(VFS, "%s: no server name end in node name: %s\n",
__func__, node_name); __func__, node_name);
kfree(UNC); kfree(UNC);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
@ -141,8 +141,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
rc = dns_resolve_server_name_to_ip(*devname, &srvIP); rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
if (rc < 0) { if (rc < 0) {
cFYI(1, "%s: Failed to resolve server part of %s to IP: %d", cifs_dbg(FYI, "%s: Failed to resolve server part of %s to IP: %d\n",
__func__, *devname, rc); __func__, *devname, rc);
goto compose_mount_options_err; goto compose_mount_options_err;
} }
@ -216,8 +216,8 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
strcat(mountdata, fullpath + ref->path_consumed); strcat(mountdata, fullpath + ref->path_consumed);
} }
/*cFYI(1, "%s: parent mountdata: %s", __func__,sb_mountdata);*/ /*cifs_dbg(FYI, "%s: parent mountdata: %s\n", __func__, sb_mountdata);*/
/*cFYI(1, "%s: submount mountdata: %s", __func__, mountdata );*/ /*cifs_dbg(FYI, "%s: submount mountdata: %s\n", __func__, mountdata );*/
compose_mount_options_out: compose_mount_options_out:
kfree(srvIP); kfree(srvIP);
@ -260,11 +260,12 @@ static struct vfsmount *cifs_dfs_do_refmount(struct cifs_sb_info *cifs_sb,
static void dump_referral(const struct dfs_info3_param *ref) static void dump_referral(const struct dfs_info3_param *ref)
{ {
cFYI(1, "DFS: ref path: %s", ref->path_name); cifs_dbg(FYI, "DFS: ref path: %s\n", ref->path_name);
cFYI(1, "DFS: node path: %s", ref->node_name); cifs_dbg(FYI, "DFS: node path: %s\n", ref->node_name);
cFYI(1, "DFS: fl: %hd, srv_type: %hd", ref->flags, ref->server_type); cifs_dbg(FYI, "DFS: fl: %hd, srv_type: %hd\n",
cFYI(1, "DFS: ref_flags: %hd, path_consumed: %hd", ref->ref_flag, ref->flags, ref->server_type);
ref->path_consumed); cifs_dbg(FYI, "DFS: ref_flags: %hd, path_consumed: %hd\n",
ref->ref_flag, ref->path_consumed);
} }
/* /*
@ -283,7 +284,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
struct vfsmount *mnt; struct vfsmount *mnt;
struct tcon_link *tlink; struct tcon_link *tlink;
cFYI(1, "in %s", __func__); cifs_dbg(FYI, "in %s\n", __func__);
BUG_ON(IS_ROOT(mntpt)); BUG_ON(IS_ROOT(mntpt));
/* /*
@ -320,15 +321,15 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
/* connect to a node */ /* connect to a node */
len = strlen(referrals[i].node_name); len = strlen(referrals[i].node_name);
if (len < 2) { if (len < 2) {
cERROR(1, "%s: Net Address path too short: %s", cifs_dbg(VFS, "%s: Net Address path too short: %s\n",
__func__, referrals[i].node_name); __func__, referrals[i].node_name);
mnt = ERR_PTR(-EINVAL); mnt = ERR_PTR(-EINVAL);
break; break;
} }
mnt = cifs_dfs_do_refmount(cifs_sb, mnt = cifs_dfs_do_refmount(cifs_sb,
full_path, referrals + i); full_path, referrals + i);
cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, cifs_dbg(FYI, "%s: cifs_dfs_do_refmount:%s , mnt:%p\n",
referrals[i].node_name, mnt); __func__, referrals[i].node_name, mnt);
if (!IS_ERR(mnt)) if (!IS_ERR(mnt))
goto success; goto success;
} }
@ -343,7 +344,7 @@ success:
free_full_path: free_full_path:
kfree(full_path); kfree(full_path);
cdda_exit: cdda_exit:
cFYI(1, "leaving %s" , __func__); cifs_dbg(FYI, "leaving %s\n" , __func__);
return mnt; return mnt;
} }
@ -354,11 +355,11 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path)
{ {
struct vfsmount *newmnt; struct vfsmount *newmnt;
cFYI(1, "in %s", __func__); cifs_dbg(FYI, "in %s\n", __func__);
newmnt = cifs_dfs_do_automount(path->dentry); newmnt = cifs_dfs_do_automount(path->dentry);
if (IS_ERR(newmnt)) { if (IS_ERR(newmnt)) {
cFYI(1, "leaving %s [automount failed]" , __func__); cifs_dbg(FYI, "leaving %s [automount failed]\n" , __func__);
return newmnt; return newmnt;
} }
@ -366,7 +367,7 @@ struct vfsmount *cifs_dfs_d_automount(struct path *path)
mnt_set_expiry(newmnt, &cifs_dfs_automount_list); mnt_set_expiry(newmnt, &cifs_dfs_automount_list);
schedule_delayed_work(&cifs_dfs_automount_task, schedule_delayed_work(&cifs_dfs_automount_task,
cifs_dfs_mountpoint_expiry_timeout); cifs_dfs_mountpoint_expiry_timeout);
cFYI(1, "leaving %s [ok]" , __func__); cifs_dbg(FYI, "leaving %s [ok]\n" , __func__);
return newmnt; return newmnt;
} }

Просмотреть файл

@ -163,7 +163,7 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
dp = description + strlen(description); dp = description + strlen(description);
sprintf(dp, ";pid=0x%x", current->pid); sprintf(dp, ";pid=0x%x", current->pid);
cFYI(1, "key description = %s", description); cifs_dbg(FYI, "key description = %s\n", description);
spnego_key = request_key(&cifs_spnego_key_type, description, ""); spnego_key = request_key(&cifs_spnego_key_type, description, "");
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2

Просмотреть файл

@ -227,8 +227,8 @@ cifs_strtoUTF16(__le16 *to, const char *from, int len,
for (i = 0; len && *from; i++, from += charlen, len -= charlen) { for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
charlen = codepage->char2uni(from, len, &wchar_to); charlen = codepage->char2uni(from, len, &wchar_to);
if (charlen < 1) { if (charlen < 1) {
cERROR(1, "strtoUTF16: char2uni of 0x%x returned %d", cifs_dbg(VFS, "strtoUTF16: char2uni of 0x%x returned %d\n",
*from, charlen); *from, charlen);
/* A question mark */ /* A question mark */
wchar_to = 0x003f; wchar_to = 0x003f;
charlen = 1; charlen = 1;

Просмотреть файл

@ -218,13 +218,13 @@ id_to_sid(unsigned int cid, uint sidtype, struct cifs_sid *ssid)
sidkey = request_key(&cifs_idmap_key_type, desc, ""); sidkey = request_key(&cifs_idmap_key_type, desc, "");
if (IS_ERR(sidkey)) { if (IS_ERR(sidkey)) {
rc = -EINVAL; rc = -EINVAL;
cFYI(1, "%s: Can't map %cid %u to a SID", __func__, cifs_dbg(FYI, "%s: Can't map %cid %u to a SID\n",
sidtype == SIDOWNER ? 'u' : 'g', cid); __func__, sidtype == SIDOWNER ? 'u' : 'g', cid);
goto out_revert_creds; goto out_revert_creds;
} else if (sidkey->datalen < CIFS_SID_BASE_SIZE) { } else if (sidkey->datalen < CIFS_SID_BASE_SIZE) {
rc = -EIO; rc = -EIO;
cFYI(1, "%s: Downcall contained malformed key " cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
"(datalen=%hu)", __func__, sidkey->datalen); __func__, sidkey->datalen);
goto invalidate_key; goto invalidate_key;
} }
@ -240,8 +240,8 @@ id_to_sid(unsigned int cid, uint sidtype, struct cifs_sid *ssid)
ksid_size = CIFS_SID_BASE_SIZE + (ksid->num_subauth * sizeof(__le32)); ksid_size = CIFS_SID_BASE_SIZE + (ksid->num_subauth * sizeof(__le32));
if (ksid_size > sidkey->datalen) { if (ksid_size > sidkey->datalen) {
rc = -EIO; rc = -EIO;
cFYI(1, "%s: Downcall contained malformed key (datalen=%hu, " cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu, ksid_size=%u)\n",
"ksid_size=%u)", __func__, sidkey->datalen, ksid_size); __func__, sidkey->datalen, ksid_size);
goto invalidate_key; goto invalidate_key;
} }
@ -273,8 +273,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
* Just return an error. * Just return an error.
*/ */
if (unlikely(psid->num_subauth > SID_MAX_SUB_AUTHORITIES)) { if (unlikely(psid->num_subauth > SID_MAX_SUB_AUTHORITIES)) {
cFYI(1, "%s: %u subauthorities is too many!", __func__, cifs_dbg(FYI, "%s: %u subauthorities is too many!\n",
psid->num_subauth); __func__, psid->num_subauth);
return -EIO; return -EIO;
} }
@ -286,8 +286,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
sidkey = request_key(&cifs_idmap_key_type, sidstr, ""); sidkey = request_key(&cifs_idmap_key_type, sidstr, "");
if (IS_ERR(sidkey)) { if (IS_ERR(sidkey)) {
rc = -EINVAL; rc = -EINVAL;
cFYI(1, "%s: Can't map SID %s to a %cid", __func__, sidstr, cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n",
sidtype == SIDOWNER ? 'u' : 'g'); __func__, sidstr, sidtype == SIDOWNER ? 'u' : 'g');
goto out_revert_creds; goto out_revert_creds;
} }
@ -299,8 +299,8 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t)); BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t));
if (sidkey->datalen != sizeof(uid_t)) { if (sidkey->datalen != sizeof(uid_t)) {
rc = -EIO; rc = -EIO;
cFYI(1, "%s: Downcall contained malformed key " cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
"(datalen=%hu)", __func__, sidkey->datalen); __func__, sidkey->datalen);
key_invalidate(sidkey); key_invalidate(sidkey);
goto out_key_put; goto out_key_put;
} }
@ -345,7 +345,8 @@ init_cifs_idmap(void)
struct key *keyring; struct key *keyring;
int ret; int ret;
cFYI(1, "Registering the %s key type", cifs_idmap_key_type.name); cifs_dbg(FYI, "Registering the %s key type\n",
cifs_idmap_key_type.name);
/* create an override credential set with a special thread keyring in /* create an override credential set with a special thread keyring in
* which requests are cached * which requests are cached
@ -378,7 +379,7 @@ init_cifs_idmap(void)
cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING; cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
root_cred = cred; root_cred = cred;
cFYI(1, "cifs idmap keyring: %d", key_serial(keyring)); cifs_dbg(FYI, "cifs idmap keyring: %d\n", key_serial(keyring));
return 0; return 0;
failed_put_key: failed_put_key:
@ -394,7 +395,7 @@ exit_cifs_idmap(void)
key_revoke(root_cred->thread_keyring); key_revoke(root_cred->thread_keyring);
unregister_key_type(&cifs_idmap_key_type); unregister_key_type(&cifs_idmap_key_type);
put_cred(root_cred); put_cred(root_cred);
cFYI(1, "Unregistered %s key type", cifs_idmap_key_type.name); cifs_dbg(FYI, "Unregistered %s key type\n", cifs_idmap_key_type.name);
} }
/* copy ntsd, owner sid, and group sid from a security descriptor to another */ /* copy ntsd, owner sid, and group sid from a security descriptor to another */
@ -461,14 +462,14 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
*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); cifs_dbg(VFS, "unknown access control type %d\n", 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"); cifs_dbg(NOISY, "all perms\n");
return; return;
} }
if ((flags & GENERIC_WRITE) || if ((flags & GENERIC_WRITE) ||
@ -481,7 +482,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); cifs_dbg(NOISY, "access flags 0x%x mode now 0x%x\n", flags, *pmode);
return; return;
} }
@ -510,7 +511,8 @@ 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); cifs_dbg(NOISY, "mode: 0x%x, access flags now 0x%x\n",
mode, *pace_flags);
return; return;
} }
@ -550,24 +552,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)); cifs_dbg(VFS, "ACE too small %d\n", 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"); cifs_dbg(VFS, "ACL too small to parse ACE\n");
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", cifs_dbg(FYI, "ACE revision %d num_auth %d type %d flags %d size %d\n",
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, cifs_dbg(FYI, "ACE sub_auth[%d]: 0x%x\n",
le32_to_cpu(pace->sid.sub_auth[i])); 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
@ -600,13 +602,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"); cifs_dbg(VFS, "ACL too small to parse DACL\n");
return; return;
} }
cFYI(DBG2, "DACL revision %d size %d num aces %d", cifs_dbg(NOISY, "DACL revision %d size %d num aces %d\n",
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,
@ -626,10 +628,8 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
return; return;
ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), ppace = kmalloc(num_aces * sizeof(struct cifs_ace *),
GFP_KERNEL); GFP_KERNEL);
if (!ppace) { if (!ppace)
cERROR(1, "DACL memory allocation error");
return; return;
}
for (i = 0; i < num_aces; ++i) { for (i = 0; i < num_aces; ++i) {
ppace[i] = (struct cifs_ace *) (acl_base + acl_size); ppace[i] = (struct cifs_ace *) (acl_base + acl_size);
@ -702,25 +702,25 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl)
/* 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); cifs_dbg(VFS, "ACL too small to parse SID %p\n", psid);
return -EINVAL; return -EINVAL;
} }
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
if (psid->num_subauth) { if (psid->num_subauth) {
int i; int i;
cFYI(1, "SID revision %d num_auth %d", cifs_dbg(FYI, "SID revision %d num_auth %d\n",
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, cifs_dbg(FYI, "SID sub_auth[%d]: 0x%x\n",
le32_to_cpu(psid->sub_auth[i])); 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", cifs_dbg(FYI, "RID 0x%x\n",
le32_to_cpu(psid->sub_auth[psid->num_subauth-1])); le32_to_cpu(psid->sub_auth[psid->num_subauth-1]));
} }
#endif #endif
@ -747,31 +747,33 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
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 " cifs_dbg(NOISY, "revision %d type 0x%x ooffset 0x%x goffset 0x%x sacloffset 0x%x dacloffset 0x%x\n",
"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) {
cFYI(1, "%s: Error %d parsing Owner SID", __func__, rc); cifs_dbg(FYI, "%s: Error %d parsing Owner SID\n", __func__, rc);
return rc; return rc;
} }
rc = sid_to_id(cifs_sb, owner_sid_ptr, fattr, SIDOWNER); rc = sid_to_id(cifs_sb, owner_sid_ptr, fattr, SIDOWNER);
if (rc) { if (rc) {
cFYI(1, "%s: Error %d mapping Owner SID to uid", __func__, rc); cifs_dbg(FYI, "%s: Error %d mapping Owner SID to uid\n",
__func__, rc);
return rc; return rc;
} }
rc = parse_sid(group_sid_ptr, end_of_acl); rc = parse_sid(group_sid_ptr, end_of_acl);
if (rc) { if (rc) {
cFYI(1, "%s: Error %d mapping Owner SID to gid", __func__, rc); cifs_dbg(FYI, "%s: Error %d mapping Owner SID to gid\n",
__func__, rc);
return rc; return rc;
} }
rc = sid_to_id(cifs_sb, group_sid_ptr, fattr, SIDGROUP); rc = sid_to_id(cifs_sb, group_sid_ptr, fattr, SIDGROUP);
if (rc) { if (rc) {
cFYI(1, "%s: Error %d mapping Group SID to gid", __func__, rc); cifs_dbg(FYI, "%s: Error %d mapping Group SID to gid\n",
__func__, rc);
return rc; return rc;
} }
@ -779,7 +781,7 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
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? */ cifs_dbg(FYI, "no ACL\n"); /* BB grant all or default perms? */
return rc; return rc;
} }
@ -829,8 +831,8 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
id = from_kuid(&init_user_ns, uid); id = from_kuid(&init_user_ns, uid);
rc = id_to_sid(id, SIDOWNER, nowner_sid_ptr); rc = id_to_sid(id, SIDOWNER, nowner_sid_ptr);
if (rc) { if (rc) {
cFYI(1, "%s: Mapping error %d for owner id %d", cifs_dbg(FYI, "%s: Mapping error %d for owner id %d\n",
__func__, rc, id); __func__, rc, id);
kfree(nowner_sid_ptr); kfree(nowner_sid_ptr);
return rc; return rc;
} }
@ -849,8 +851,8 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
id = from_kgid(&init_user_ns, gid); id = from_kgid(&init_user_ns, gid);
rc = id_to_sid(id, SIDGROUP, ngroup_sid_ptr); rc = id_to_sid(id, SIDGROUP, ngroup_sid_ptr);
if (rc) { if (rc) {
cFYI(1, "%s: Mapping error %d for group id %d", cifs_dbg(FYI, "%s: Mapping error %d for group id %d\n",
__func__, rc, id); __func__, rc, id);
kfree(ngroup_sid_ptr); kfree(ngroup_sid_ptr);
return rc; return rc;
} }
@ -880,7 +882,7 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); cifs_dbg(FYI, "%s: rc = %d ACL len %d\n", __func__, rc, *pacllen);
if (rc) if (rc)
return ERR_PTR(rc); return ERR_PTR(rc);
return pntsd; return pntsd;
@ -917,7 +919,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
free_xid(xid); free_xid(xid);
cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); cifs_dbg(FYI, "%s: rc = %d ACL len %d\n", __func__, rc, *pacllen);
if (rc) if (rc)
return ERR_PTR(rc); return ERR_PTR(rc);
return pntsd; return pntsd;
@ -971,12 +973,12 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
create_options, &fid, &oplock, NULL, cifs_sb->local_nls, create_options, &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"); cifs_dbg(VFS, "Unable to open file to set ACL\n");
goto out; goto out;
} }
rc = CIFSSMBSetCIFSACL(xid, tcon, fid, pnntsd, acllen, aclflag); rc = CIFSSMBSetCIFSACL(xid, tcon, fid, pnntsd, acllen, aclflag);
cFYI(DBG2, "SetCIFSACL rc = %d", rc); cifs_dbg(NOISY, "SetCIFSACL rc = %d\n", rc);
CIFSSMBClose(xid, tcon, fid); CIFSSMBClose(xid, tcon, fid);
out: out:
@ -994,7 +996,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); cifs_dbg(NOISY, "converting ACL to mode for %s\n", 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);
@ -1004,12 +1006,12 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
/* if we can retrieve the ACL, now parse Access Control Entries, ACEs */ /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */
if (IS_ERR(pntsd)) { if (IS_ERR(pntsd)) {
rc = PTR_ERR(pntsd); rc = PTR_ERR(pntsd);
cERROR(1, "%s: error %d getting sec desc", __func__, rc); cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);
} else { } else {
rc = parse_sec_desc(cifs_sb, pntsd, acllen, fattr); rc = parse_sec_desc(cifs_sb, pntsd, acllen, fattr);
kfree(pntsd); kfree(pntsd);
if (rc) if (rc)
cERROR(1, "parse sec desc failed rc = %d", rc); cifs_dbg(VFS, "parse sec desc failed rc = %d\n", rc);
} }
return rc; return rc;
@ -1026,13 +1028,13 @@ id_mode_to_cifs_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); cifs_dbg(NOISY, "set ACL from mode for %s\n", 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);
if (IS_ERR(pntsd)) { if (IS_ERR(pntsd)) {
rc = PTR_ERR(pntsd); rc = PTR_ERR(pntsd);
cERROR(1, "%s: error %d getting sec desc", __func__, rc); cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);
goto out; goto out;
} }
@ -1045,7 +1047,6 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
secdesclen = max_t(u32, secdesclen, DEFAULT_SEC_DESC_LEN); secdesclen = max_t(u32, secdesclen, DEFAULT_SEC_DESC_LEN);
pnntsd = kmalloc(secdesclen, GFP_KERNEL); pnntsd = kmalloc(secdesclen, GFP_KERNEL);
if (!pnntsd) { if (!pnntsd) {
cERROR(1, "Unable to allocate security descriptor");
kfree(pntsd); kfree(pntsd);
return -ENOMEM; return -ENOMEM;
} }
@ -1053,12 +1054,12 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
rc = build_sec_desc(pntsd, pnntsd, secdesclen, nmode, uid, gid, rc = build_sec_desc(pntsd, pnntsd, secdesclen, nmode, uid, gid,
&aclflag); &aclflag);
cFYI(DBG2, "build_sec_desc rc: %d", rc); cifs_dbg(NOISY, "build_sec_desc rc: %d\n", rc);
if (!rc) { if (!rc) {
/* Set the security descriptor */ /* Set the security descriptor */
rc = set_cifs_acl(pnntsd, secdesclen, inode, path, aclflag); rc = set_cifs_acl(pnntsd, secdesclen, inode, path, aclflag);
cFYI(DBG2, "set_cifs_acl rc: %d", rc); cifs_dbg(NOISY, "set_cifs_acl rc: %d\n", rc);
} }
kfree(pnntsd); kfree(pnntsd);

Просмотреть файл

@ -50,20 +50,20 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
return -EINVAL; return -EINVAL;
if (!server->secmech.sdescmd5) { if (!server->secmech.sdescmd5) {
cERROR(1, "%s: Can't generate signature", __func__); cifs_dbg(VFS, "%s: Can't generate signature\n", __func__);
return -1; return -1;
} }
rc = crypto_shash_init(&server->secmech.sdescmd5->shash); rc = crypto_shash_init(&server->secmech.sdescmd5->shash);
if (rc) { if (rc) {
cERROR(1, "%s: Could not init md5", __func__); cifs_dbg(VFS, "%s: Could not init md5\n", __func__);
return rc; return rc;
} }
rc = crypto_shash_update(&server->secmech.sdescmd5->shash, rc = crypto_shash_update(&server->secmech.sdescmd5->shash,
server->session_key.response, server->session_key.len); server->session_key.response, server->session_key.len);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with response", __func__); cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
return rc; return rc;
} }
@ -71,7 +71,7 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
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"); cifs_dbg(VFS, "null iovec entry\n");
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
@ -88,8 +88,8 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
iov[i].iov_base, iov[i].iov_len); iov[i].iov_base, iov[i].iov_len);
} }
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with payload", cifs_dbg(VFS, "%s: Could not update with payload\n",
__func__); __func__);
return rc; return rc;
} }
} }
@ -106,7 +106,7 @@ static int cifs_calc_signature(struct smb_rqst *rqst,
rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature); rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature);
if (rc) if (rc)
cERROR(1, "%s: Could not generate md5 hash", __func__); cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
return rc; return rc;
} }
@ -196,8 +196,8 @@ int cifs_verify_signature(struct smb_rqst *rqst,
/* 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", cifs_dbg(FYI, "dummy signature received for smb command 0x%x\n",
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 */
@ -235,30 +235,30 @@ int setup_ntlm_response(struct cifs_ses *ses, const struct nls_table *nls_cp)
return -EINVAL; return -EINVAL;
ses->auth_key.response = kmalloc(temp_len, GFP_KERNEL); ses->auth_key.response = kmalloc(temp_len, GFP_KERNEL);
if (!ses->auth_key.response) { if (!ses->auth_key.response)
cERROR(1, "NTLM can't allocate (%u bytes) memory", temp_len);
return -ENOMEM; return -ENOMEM;
}
ses->auth_key.len = temp_len; ses->auth_key.len = temp_len;
rc = SMBNTencrypt(ses->password, ses->server->cryptkey, rc = SMBNTencrypt(ses->password, ses->server->cryptkey,
ses->auth_key.response + CIFS_SESS_KEY_SIZE, nls_cp); ses->auth_key.response + CIFS_SESS_KEY_SIZE, nls_cp);
if (rc) { if (rc) {
cFYI(1, "%s Can't generate NTLM response, error: %d", cifs_dbg(FYI, "%s Can't generate NTLM response, error: %d\n",
__func__, rc); __func__, rc);
return rc; return rc;
} }
rc = E_md4hash(ses->password, temp_key, nls_cp); rc = E_md4hash(ses->password, temp_key, nls_cp);
if (rc) { if (rc) {
cFYI(1, "%s Can't generate NT hash, error: %d", __func__, rc); cifs_dbg(FYI, "%s Can't generate NT hash, error: %d\n",
__func__, rc);
return rc; return rc;
} }
rc = mdfour(ses->auth_key.response, temp_key, CIFS_SESS_KEY_SIZE); rc = mdfour(ses->auth_key.response, temp_key, CIFS_SESS_KEY_SIZE);
if (rc) if (rc)
cFYI(1, "%s Can't generate NTLM session key, error: %d", cifs_dbg(FYI, "%s Can't generate NTLM session key, error: %d\n",
__func__, rc); __func__, rc);
return rc; return rc;
} }
@ -334,7 +334,6 @@ build_avpair_blob(struct cifs_ses *ses, const struct nls_table *nls_cp)
ses->auth_key.response = kzalloc(ses->auth_key.len, GFP_KERNEL); ses->auth_key.response = kzalloc(ses->auth_key.len, GFP_KERNEL);
if (!ses->auth_key.response) { if (!ses->auth_key.response) {
ses->auth_key.len = 0; ses->auth_key.len = 0;
cERROR(1, "Challenge target info allocation failure");
return -ENOMEM; return -ENOMEM;
} }
@ -420,7 +419,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
wchar_t *server; wchar_t *server;
if (!ses->server->secmech.sdeschmacmd5) { if (!ses->server->secmech.sdeschmacmd5) {
cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash"); cifs_dbg(VFS, "%s: can't generate ntlmv2 hash\n", __func__);
return -1; return -1;
} }
@ -430,13 +429,13 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, nt_hash, rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, nt_hash,
CIFS_NTHASH_SIZE); CIFS_NTHASH_SIZE);
if (rc) { if (rc) {
cERROR(1, "%s: Could not set NT Hash as a key", __func__); cifs_dbg(VFS, "%s: Could not set NT Hash as a key\n", __func__);
return rc; return rc;
} }
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
if (rc) { if (rc) {
cERROR(1, "calc_ntlmv2_hash: could not init hmacmd5"); cifs_dbg(VFS, "%s: could not init hmacmd5\n", __func__);
return rc; return rc;
} }
@ -444,7 +443,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
len = ses->user_name ? strlen(ses->user_name) : 0; len = ses->user_name ? strlen(ses->user_name) : 0;
user = kmalloc(2 + (len * 2), GFP_KERNEL); user = kmalloc(2 + (len * 2), GFP_KERNEL);
if (user == NULL) { if (user == NULL) {
cERROR(1, "calc_ntlmv2_hash: user mem alloc failure");
rc = -ENOMEM; rc = -ENOMEM;
return rc; return rc;
} }
@ -460,7 +458,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
(char *)user, 2 * len); (char *)user, 2 * len);
kfree(user); kfree(user);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with user", __func__); cifs_dbg(VFS, "%s: Could not update with user\n", __func__);
return rc; return rc;
} }
@ -470,7 +468,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
domain = kmalloc(2 + (len * 2), GFP_KERNEL); domain = kmalloc(2 + (len * 2), GFP_KERNEL);
if (domain == NULL) { if (domain == NULL) {
cERROR(1, "calc_ntlmv2_hash: domain mem alloc failure");
rc = -ENOMEM; rc = -ENOMEM;
return rc; return rc;
} }
@ -481,8 +478,8 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
(char *)domain, 2 * len); (char *)domain, 2 * len);
kfree(domain); kfree(domain);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with domain", cifs_dbg(VFS, "%s: Could not update with domain\n",
__func__); __func__);
return rc; return rc;
} }
} else if (ses->serverName) { } else if (ses->serverName) {
@ -490,7 +487,6 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
server = kmalloc(2 + (len * 2), GFP_KERNEL); server = kmalloc(2 + (len * 2), GFP_KERNEL);
if (server == NULL) { if (server == NULL) {
cERROR(1, "calc_ntlmv2_hash: server mem alloc failure");
rc = -ENOMEM; rc = -ENOMEM;
return rc; return rc;
} }
@ -501,8 +497,8 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
(char *)server, 2 * len); (char *)server, 2 * len);
kfree(server); kfree(server);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with server", cifs_dbg(VFS, "%s: Could not update with server\n",
__func__); __func__);
return rc; return rc;
} }
} }
@ -510,7 +506,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
ntlmv2_hash); ntlmv2_hash);
if (rc) if (rc)
cERROR(1, "%s: Could not generate md5 hash", __func__); cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
return rc; return rc;
} }
@ -522,20 +518,21 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
unsigned int offset = CIFS_SESS_KEY_SIZE + 8; unsigned int offset = CIFS_SESS_KEY_SIZE + 8;
if (!ses->server->secmech.sdeschmacmd5) { if (!ses->server->secmech.sdeschmacmd5) {
cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash"); cifs_dbg(VFS, "%s: can't generate ntlmv2 hash\n", __func__);
return -1; return -1;
} }
rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, rc = crypto_shash_setkey(ses->server->secmech.hmacmd5,
ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE); ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE);
if (rc) { if (rc) {
cERROR(1, "%s: Could not set NTLMV2 Hash as a key", __func__); cifs_dbg(VFS, "%s: Could not set NTLMV2 Hash as a key\n",
__func__);
return rc; return rc;
} }
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
if (rc) { if (rc) {
cERROR(1, "CalcNTLMv2_response: could not init hmacmd5"); cifs_dbg(VFS, "%s: could not init hmacmd5\n", __func__);
return rc; return rc;
} }
@ -548,14 +545,14 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash,
ses->auth_key.response + offset, ses->auth_key.len - offset); ses->auth_key.response + offset, ses->auth_key.len - offset);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with response", __func__); cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
return rc; return rc;
} }
rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
ses->auth_key.response + CIFS_SESS_KEY_SIZE); ses->auth_key.response + CIFS_SESS_KEY_SIZE);
if (rc) if (rc)
cERROR(1, "%s: Could not generate md5 hash", __func__); cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
return rc; return rc;
} }
@ -575,14 +572,15 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
if (!ses->domainName) { if (!ses->domainName) {
rc = find_domain_name(ses, nls_cp); rc = find_domain_name(ses, nls_cp);
if (rc) { if (rc) {
cERROR(1, "error %d finding domain name", rc); cifs_dbg(VFS, "error %d finding domain name\n",
rc);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
} }
} }
} else { } else {
rc = build_avpair_blob(ses, nls_cp); rc = build_avpair_blob(ses, nls_cp);
if (rc) { if (rc) {
cERROR(1, "error %d building av pair blob", rc); cifs_dbg(VFS, "error %d building av pair blob\n", rc);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
} }
} }
@ -595,7 +593,6 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
if (!ses->auth_key.response) { if (!ses->auth_key.response) {
rc = ENOMEM; rc = ENOMEM;
ses->auth_key.len = 0; ses->auth_key.len = 0;
cERROR(1, "%s: Can't allocate auth blob", __func__);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
} }
ses->auth_key.len += baselen; ses->auth_key.len += baselen;
@ -613,14 +610,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
/* calculate ntlmv2_hash */ /* calculate ntlmv2_hash */
rc = calc_ntlmv2_hash(ses, ntlmv2_hash, nls_cp); rc = calc_ntlmv2_hash(ses, ntlmv2_hash, nls_cp);
if (rc) { if (rc) {
cERROR(1, "could not get v2 hash rc %d", rc); cifs_dbg(VFS, "could not get v2 hash rc %d\n", rc);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
} }
/* calculate first part of the client response (CR1) */ /* calculate first part of the client response (CR1) */
rc = CalcNTLMv2_response(ses, ntlmv2_hash); rc = CalcNTLMv2_response(ses, ntlmv2_hash);
if (rc) { if (rc) {
cERROR(1, "Could not calculate CR1 rc: %d", rc); cifs_dbg(VFS, "Could not calculate CR1 rc: %d\n", rc);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
} }
@ -628,13 +625,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
rc = crypto_shash_setkey(ses->server->secmech.hmacmd5, rc = crypto_shash_setkey(ses->server->secmech.hmacmd5,
ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE); ntlmv2_hash, CIFS_HMAC_MD5_HASH_SIZE);
if (rc) { if (rc) {
cERROR(1, "%s: Could not set NTLMV2 Hash as a key", __func__); cifs_dbg(VFS, "%s: Could not set NTLMV2 Hash as a key\n",
__func__);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
} }
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
if (rc) { if (rc) {
cERROR(1, "%s: Could not init hmacmd5", __func__); cifs_dbg(VFS, "%s: Could not init hmacmd5\n", __func__);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
} }
@ -642,14 +640,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
ses->auth_key.response + CIFS_SESS_KEY_SIZE, ses->auth_key.response + CIFS_SESS_KEY_SIZE,
CIFS_HMAC_MD5_HASH_SIZE); CIFS_HMAC_MD5_HASH_SIZE);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with response", __func__); cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
goto setup_ntlmv2_rsp_ret; goto setup_ntlmv2_rsp_ret;
} }
rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
ses->auth_key.response); ses->auth_key.response);
if (rc) if (rc)
cERROR(1, "%s: Could not generate md5 hash", __func__); cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
setup_ntlmv2_rsp_ret: setup_ntlmv2_rsp_ret:
kfree(tiblob); kfree(tiblob);
@ -671,7 +669,7 @@ calc_seckey(struct cifs_ses *ses)
tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(tfm_arc4)) { if (IS_ERR(tfm_arc4)) {
rc = PTR_ERR(tfm_arc4); rc = PTR_ERR(tfm_arc4);
cERROR(1, "could not allocate crypto API arc4"); cifs_dbg(VFS, "could not allocate crypto API arc4\n");
return rc; return rc;
} }
@ -680,7 +678,8 @@ calc_seckey(struct cifs_ses *ses)
rc = crypto_blkcipher_setkey(tfm_arc4, ses->auth_key.response, rc = crypto_blkcipher_setkey(tfm_arc4, ses->auth_key.response,
CIFS_SESS_KEY_SIZE); CIFS_SESS_KEY_SIZE);
if (rc) { if (rc) {
cERROR(1, "%s: Could not set response as a key", __func__); cifs_dbg(VFS, "%s: Could not set response as a key\n",
__func__);
return rc; return rc;
} }
@ -689,7 +688,7 @@ calc_seckey(struct cifs_ses *ses)
rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, CIFS_CPHTXT_SIZE); rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, CIFS_CPHTXT_SIZE);
if (rc) { if (rc) {
cERROR(1, "could not encrypt session key rc: %d", rc); cifs_dbg(VFS, "could not encrypt session key rc: %d\n", rc);
crypto_free_blkcipher(tfm_arc4); crypto_free_blkcipher(tfm_arc4);
return rc; return rc;
} }
@ -731,20 +730,20 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
server->secmech.hmacmd5 = crypto_alloc_shash("hmac(md5)", 0, 0); server->secmech.hmacmd5 = crypto_alloc_shash("hmac(md5)", 0, 0);
if (IS_ERR(server->secmech.hmacmd5)) { if (IS_ERR(server->secmech.hmacmd5)) {
cERROR(1, "could not allocate crypto hmacmd5"); cifs_dbg(VFS, "could not allocate crypto hmacmd5\n");
return PTR_ERR(server->secmech.hmacmd5); return PTR_ERR(server->secmech.hmacmd5);
} }
server->secmech.md5 = crypto_alloc_shash("md5", 0, 0); server->secmech.md5 = crypto_alloc_shash("md5", 0, 0);
if (IS_ERR(server->secmech.md5)) { if (IS_ERR(server->secmech.md5)) {
cERROR(1, "could not allocate crypto md5"); cifs_dbg(VFS, "could not allocate crypto md5\n");
rc = PTR_ERR(server->secmech.md5); rc = PTR_ERR(server->secmech.md5);
goto crypto_allocate_md5_fail; goto crypto_allocate_md5_fail;
} }
server->secmech.hmacsha256 = crypto_alloc_shash("hmac(sha256)", 0, 0); server->secmech.hmacsha256 = crypto_alloc_shash("hmac(sha256)", 0, 0);
if (IS_ERR(server->secmech.hmacsha256)) { if (IS_ERR(server->secmech.hmacsha256)) {
cERROR(1, "could not allocate crypto hmacsha256\n"); cifs_dbg(VFS, "could not allocate crypto hmacsha256\n");
rc = PTR_ERR(server->secmech.hmacsha256); rc = PTR_ERR(server->secmech.hmacsha256);
goto crypto_allocate_hmacsha256_fail; goto crypto_allocate_hmacsha256_fail;
} }
@ -753,7 +752,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
crypto_shash_descsize(server->secmech.hmacmd5); crypto_shash_descsize(server->secmech.hmacmd5);
server->secmech.sdeschmacmd5 = kmalloc(size, GFP_KERNEL); server->secmech.sdeschmacmd5 = kmalloc(size, GFP_KERNEL);
if (!server->secmech.sdeschmacmd5) { if (!server->secmech.sdeschmacmd5) {
cERROR(1, "cifs_crypto_shash_allocate: can't alloc hmacmd5");
rc = -ENOMEM; rc = -ENOMEM;
goto crypto_allocate_hmacmd5_sdesc_fail; goto crypto_allocate_hmacmd5_sdesc_fail;
} }
@ -764,7 +762,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
crypto_shash_descsize(server->secmech.md5); crypto_shash_descsize(server->secmech.md5);
server->secmech.sdescmd5 = kmalloc(size, GFP_KERNEL); server->secmech.sdescmd5 = kmalloc(size, GFP_KERNEL);
if (!server->secmech.sdescmd5) { if (!server->secmech.sdescmd5) {
cERROR(1, "cifs_crypto_shash_allocate: can't alloc md5");
rc = -ENOMEM; rc = -ENOMEM;
goto crypto_allocate_md5_sdesc_fail; goto crypto_allocate_md5_sdesc_fail;
} }
@ -775,7 +772,6 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
crypto_shash_descsize(server->secmech.hmacsha256); crypto_shash_descsize(server->secmech.hmacsha256);
server->secmech.sdeschmacsha256 = kmalloc(size, GFP_KERNEL); server->secmech.sdeschmacsha256 = kmalloc(size, GFP_KERNEL);
if (!server->secmech.sdeschmacsha256) { if (!server->secmech.sdeschmacsha256) {
cERROR(1, "%s: Can't alloc hmacsha256\n", __func__);
rc = -ENOMEM; rc = -ENOMEM;
goto crypto_allocate_hmacsha256_sdesc_fail; goto crypto_allocate_hmacsha256_sdesc_fail;
} }

Просмотреть файл

@ -161,7 +161,7 @@ cifs_read_super(struct super_block *sb)
#ifdef CONFIG_CIFS_NFSD_EXPORT #ifdef CONFIG_CIFS_NFSD_EXPORT
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
cFYI(1, "export ops supported"); cifs_dbg(FYI, "export ops supported\n");
sb->s_export_op = &cifs_export_ops; sb->s_export_op = &cifs_export_ops;
} }
#endif /* CONFIG_CIFS_NFSD_EXPORT */ #endif /* CONFIG_CIFS_NFSD_EXPORT */
@ -169,7 +169,7 @@ cifs_read_super(struct super_block *sb)
return 0; return 0;
out_no_root: out_no_root:
cERROR(1, "cifs_read_super: get root inode failed"); cifs_dbg(VFS, "%s: get root inode failed\n", __func__);
return rc; return rc;
} }
@ -502,7 +502,7 @@ static void cifs_umount_begin(struct super_block *sb)
/* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */ /* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
/* cancel_notify_requests(tcon); */ /* cancel_notify_requests(tcon); */
if (tcon->ses && tcon->ses->server) { if (tcon->ses && tcon->ses->server) {
cFYI(1, "wake up tasks now - umount begin not complete"); cifs_dbg(FYI, "wake up tasks now - umount begin not complete\n");
wake_up_all(&tcon->ses->server->request_q); wake_up_all(&tcon->ses->server->request_q);
wake_up_all(&tcon->ses->server->response_q); wake_up_all(&tcon->ses->server->response_q);
msleep(1); /* yield */ msleep(1); /* yield */
@ -573,7 +573,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
if (full_path == NULL) if (full_path == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cFYI(1, "Get root dentry for %s", full_path); cifs_dbg(FYI, "Get root dentry for %s\n", full_path);
sep = CIFS_DIR_SEP(cifs_sb); sep = CIFS_DIR_SEP(cifs_sb);
dentry = dget(sb->s_root); dentry = dget(sb->s_root);
@ -632,7 +632,7 @@ cifs_do_mount(struct file_system_type *fs_type,
struct cifs_mnt_data mnt_data; struct cifs_mnt_data mnt_data;
struct dentry *root; struct dentry *root;
cFYI(1, "Devname: %s flags: %d ", dev_name, flags); cifs_dbg(FYI, "Devname: %s flags: %d\n", dev_name, flags);
volume_info = cifs_get_volume_info((char *)data, dev_name); volume_info = cifs_get_volume_info((char *)data, dev_name);
if (IS_ERR(volume_info)) if (IS_ERR(volume_info))
@ -655,7 +655,8 @@ cifs_do_mount(struct file_system_type *fs_type,
rc = cifs_mount(cifs_sb, volume_info); rc = cifs_mount(cifs_sb, volume_info);
if (rc) { if (rc) {
if (!(flags & MS_SILENT)) if (!(flags & MS_SILENT))
cERROR(1, "cifs_mount failed w/return code = %d", rc); cifs_dbg(VFS, "cifs_mount failed w/return code = %d\n",
rc);
root = ERR_PTR(rc); root = ERR_PTR(rc);
goto out_mountdata; goto out_mountdata;
} }
@ -675,7 +676,7 @@ cifs_do_mount(struct file_system_type *fs_type,
} }
if (sb->s_root) { if (sb->s_root) {
cFYI(1, "Use existing superblock"); cifs_dbg(FYI, "Use existing superblock\n");
cifs_umount(cifs_sb); cifs_umount(cifs_sb);
} else { } else {
rc = cifs_read_super(sb); rc = cifs_read_super(sb);
@ -691,7 +692,7 @@ cifs_do_mount(struct file_system_type *fs_type,
if (IS_ERR(root)) if (IS_ERR(root))
goto out_super; goto out_super;
cFYI(1, "dentry root is: %p", root); cifs_dbg(FYI, "dentry root is: %p\n", root);
goto out; goto out;
out_super: out_super:
@ -723,7 +724,8 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
rc = filemap_fdatawrite(inode->i_mapping); rc = filemap_fdatawrite(inode->i_mapping);
if (rc) if (rc)
cFYI(1, "cifs_file_aio_write: %d rc on %p inode", rc, inode); cifs_dbg(FYI, "cifs_file_aio_write: %d rc on %p inode\n",
rc, inode);
return written; return written;
} }
@ -1030,7 +1032,10 @@ cifs_init_request_bufs(void)
} else { } else {
CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/ CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/
} }
/* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */ /*
cifs_dbg(VFS, "CIFSMaxBufSize %d 0x%x\n",
CIFSMaxBufSize, CIFSMaxBufSize);
*/
cifs_req_cachep = kmem_cache_create("cifs_request", cifs_req_cachep = kmem_cache_create("cifs_request",
CIFSMaxBufSize + max_hdr_size, 0, CIFSMaxBufSize + max_hdr_size, 0,
SLAB_HWCACHE_ALIGN, NULL); SLAB_HWCACHE_ALIGN, NULL);
@ -1041,7 +1046,7 @@ cifs_init_request_bufs(void)
cifs_min_rcv = 1; cifs_min_rcv = 1;
else if (cifs_min_rcv > 64) { else if (cifs_min_rcv > 64) {
cifs_min_rcv = 64; cifs_min_rcv = 64;
cERROR(1, "cifs_min_rcv set to maximum (64)"); cifs_dbg(VFS, "cifs_min_rcv set to maximum (64)\n");
} }
cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv, cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
@ -1072,7 +1077,7 @@ cifs_init_request_bufs(void)
cifs_min_small = 2; cifs_min_small = 2;
else if (cifs_min_small > 256) { else if (cifs_min_small > 256) {
cifs_min_small = 256; cifs_min_small = 256;
cFYI(1, "cifs_min_small set to maximum (256)"); cifs_dbg(FYI, "cifs_min_small set to maximum (256)\n");
} }
cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small, cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small,
@ -1163,10 +1168,11 @@ init_cifs(void)
if (cifs_max_pending < 2) { if (cifs_max_pending < 2) {
cifs_max_pending = 2; cifs_max_pending = 2;
cFYI(1, "cifs_max_pending set to min of 2"); cifs_dbg(FYI, "cifs_max_pending set to min of 2\n");
} else if (cifs_max_pending > CIFS_MAX_REQ) { } else if (cifs_max_pending > CIFS_MAX_REQ) {
cifs_max_pending = CIFS_MAX_REQ; cifs_max_pending = CIFS_MAX_REQ;
cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ); cifs_dbg(FYI, "cifs_max_pending set to max of %u\n",
CIFS_MAX_REQ);
} }
cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
@ -1235,7 +1241,7 @@ out_clean_proc:
static void __exit static void __exit
exit_cifs(void) exit_cifs(void)
{ {
cFYI(DBG2, "exit_cifs"); cifs_dbg(NOISY, "exit_cifs\n");
unregister_filesystem(&cifs_fs_type); unregister_filesystem(&cifs_fs_type);
cifs_dfs_release_automount_timer(); cifs_dfs_release_automount_timer();
#ifdef CONFIG_CIFS_ACL #ifdef CONFIG_CIFS_ACL

Просмотреть файл

@ -45,17 +45,17 @@ extern void _free_xid(unsigned int);
#define get_xid() \ #define get_xid() \
({ \ ({ \
unsigned int __xid = _get_xid(); \ unsigned int __xid = _get_xid(); \
cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d", \ cifs_dbg(FYI, "CIFS VFS: in %s as Xid: %u with uid: %d\n", \
__func__, __xid, \ __func__, __xid, \
from_kuid(&init_user_ns, current_fsuid())); \ from_kuid(&init_user_ns, current_fsuid())); \
__xid; \ __xid; \
}) })
#define free_xid(curr_xid) \ #define free_xid(curr_xid) \
do { \ do { \
_free_xid(curr_xid); \ _free_xid(curr_xid); \
cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d", \ cifs_dbg(FYI, "CIFS VFS: leaving %s (xid = %u) rc = %d\n", \
__func__, curr_xid, (int)rc); \ __func__, curr_xid, (int)rc); \
} while (0) } while (0)
extern int init_cifs_idmap(void); extern int init_cifs_idmap(void);
extern void exit_cifs_idmap(void); extern void exit_cifs_idmap(void);

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -316,11 +316,12 @@ cifs_reconnect(struct TCP_Server_Info *server)
server->max_read = 0; server->max_read = 0;
#endif #endif
cFYI(1, "Reconnecting tcp session"); cifs_dbg(FYI, "Reconnecting tcp session\n");
/* 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 */
cFYI(1, "%s: marking sessions and tcons for reconnect", __func__); cifs_dbg(FYI, "%s: marking sessions and tcons for reconnect\n",
__func__);
spin_lock(&cifs_tcp_ses_lock); spin_lock(&cifs_tcp_ses_lock);
list_for_each(tmp, &server->smb_ses_list) { list_for_each(tmp, &server->smb_ses_list) {
ses = list_entry(tmp, struct cifs_ses, smb_ses_list); ses = list_entry(tmp, struct cifs_ses, smb_ses_list);
@ -334,15 +335,14 @@ cifs_reconnect(struct TCP_Server_Info *server)
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
/* 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 */
cFYI(1, "%s: tearing down socket", __func__); cifs_dbg(FYI, "%s: tearing down socket\n", __func__);
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, cifs_dbg(FYI, "State: 0x%x Flags: 0x%lx\n",
server->ssocket->flags); server->ssocket->state, 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", cifs_dbg(FYI, "Post shutdown state: 0x%x Flags: 0x%lx\n",
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;
} }
@ -356,7 +356,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
/* mark submitted MIDs for retry and issue callback */ /* mark submitted MIDs for retry and issue callback */
INIT_LIST_HEAD(&retry_list); INIT_LIST_HEAD(&retry_list);
cFYI(1, "%s: moving mids to private list", __func__); cifs_dbg(FYI, "%s: moving mids to private list\n", __func__);
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
@ -366,7 +366,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
} }
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
cFYI(1, "%s: issuing mid callbacks", __func__); cifs_dbg(FYI, "%s: issuing mid callbacks\n", __func__);
list_for_each_safe(tmp, tmp2, &retry_list) { list_for_each_safe(tmp, tmp2, &retry_list) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
list_del_init(&mid_entry->qhead); list_del_init(&mid_entry->qhead);
@ -379,7 +379,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
/* we should try only the port we connected to before */ /* we should try only the port we connected to before */
rc = generic_ip_connect(server); rc = generic_ip_connect(server);
if (rc) { if (rc) {
cFYI(1, "reconnect error %d", rc); cifs_dbg(FYI, "reconnect error %d\n", rc);
msleep(3000); msleep(3000);
} else { } else {
atomic_inc(&tcpSesReconnectCount); atomic_inc(&tcpSesReconnectCount);
@ -413,8 +413,8 @@ cifs_echo_request(struct work_struct *work)
rc = server->ops->echo ? server->ops->echo(server) : -ENOSYS; rc = server->ops->echo ? server->ops->echo(server) : -ENOSYS;
if (rc) if (rc)
cFYI(1, "Unable to send echo request to server: %s", cifs_dbg(FYI, "Unable to send echo request to server: %s\n",
server->hostname); server->hostname);
requeue_echo: requeue_echo:
queue_delayed_work(cifsiod_wq, &server->echo, SMB_ECHO_INTERVAL); queue_delayed_work(cifsiod_wq, &server->echo, SMB_ECHO_INTERVAL);
@ -426,7 +426,7 @@ allocate_buffers(struct TCP_Server_Info *server)
if (!server->bigbuf) { if (!server->bigbuf) {
server->bigbuf = (char *)cifs_buf_get(); server->bigbuf = (char *)cifs_buf_get();
if (!server->bigbuf) { if (!server->bigbuf) {
cERROR(1, "No memory for large SMB response"); cifs_dbg(VFS, "No memory for large SMB response\n");
msleep(3000); msleep(3000);
/* retry will check if exiting */ /* retry will check if exiting */
return false; return false;
@ -439,7 +439,7 @@ allocate_buffers(struct TCP_Server_Info *server)
if (!server->smallbuf) { if (!server->smallbuf) {
server->smallbuf = (char *)cifs_small_buf_get(); server->smallbuf = (char *)cifs_small_buf_get();
if (!server->smallbuf) { if (!server->smallbuf) {
cERROR(1, "No memory for SMB response"); cifs_dbg(VFS, "No memory for SMB response\n");
msleep(1000); msleep(1000);
/* retry will check if exiting */ /* retry will check if exiting */
return false; return false;
@ -469,9 +469,8 @@ server_unresponsive(struct TCP_Server_Info *server)
*/ */
if (server->tcpStatus == CifsGood && if (server->tcpStatus == CifsGood &&
time_after(jiffies, server->lstrp + 2 * SMB_ECHO_INTERVAL)) { time_after(jiffies, server->lstrp + 2 * SMB_ECHO_INTERVAL)) {
cERROR(1, "Server %s has not responded in %d seconds. " cifs_dbg(VFS, "Server %s has not responded in %d seconds. Reconnecting...\n",
"Reconnecting...", server->hostname, server->hostname, (2 * SMB_ECHO_INTERVAL) / HZ);
(2 * SMB_ECHO_INTERVAL) / HZ);
cifs_reconnect(server); cifs_reconnect(server);
wake_up(&server->response_q); wake_up(&server->response_q);
return true; return true;
@ -582,8 +581,8 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct kvec *iov_orig,
length = 0; length = 0;
continue; continue;
} else if (length <= 0) { } else if (length <= 0) {
cFYI(1, "Received no data or error: expecting %d " cifs_dbg(FYI, "Received no data or error: expecting %d\n"
"got %d", to_read, length); "got %d", to_read, length);
cifs_reconnect(server); cifs_reconnect(server);
total_read = -EAGAIN; total_read = -EAGAIN;
break; break;
@ -617,17 +616,17 @@ is_smb_response(struct TCP_Server_Info *server, unsigned char type)
/* Regular SMB response */ /* Regular SMB response */
return true; return true;
case RFC1002_SESSION_KEEP_ALIVE: case RFC1002_SESSION_KEEP_ALIVE:
cFYI(1, "RFC 1002 session keep alive"); cifs_dbg(FYI, "RFC 1002 session keep alive\n");
break; break;
case RFC1002_POSITIVE_SESSION_RESPONSE: case RFC1002_POSITIVE_SESSION_RESPONSE:
cFYI(1, "RFC 1002 positive session response"); cifs_dbg(FYI, "RFC 1002 positive session response\n");
break; break;
case RFC1002_NEGATIVE_SESSION_RESPONSE: case RFC1002_NEGATIVE_SESSION_RESPONSE:
/* /*
* We get this from Windows 98 instead of an error on * We get this from Windows 98 instead of an error on
* SMB negprot response. * SMB negprot response.
*/ */
cFYI(1, "RFC 1002 negative session response"); cifs_dbg(FYI, "RFC 1002 negative session response\n");
/* give server a second to clean up */ /* give server a second to clean up */
msleep(1000); msleep(1000);
/* /*
@ -641,7 +640,7 @@ is_smb_response(struct TCP_Server_Info *server, unsigned char type)
wake_up(&server->response_q); wake_up(&server->response_q);
break; break;
default: default:
cERROR(1, "RFC 1002 unknown response type 0x%x", type); cifs_dbg(VFS, "RFC 1002 unknown response type 0x%x\n", type);
cifs_reconnect(server); cifs_reconnect(server);
} }
@ -727,7 +726,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
list_for_each_safe(tmp, tmp2, &server->pending_mid_q) { list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
cFYI(1, "Clearing mid 0x%llx", mid_entry->mid); cifs_dbg(FYI, "Clearing mid 0x%llx\n", mid_entry->mid);
mid_entry->mid_state = MID_SHUTDOWN; mid_entry->mid_state = MID_SHUTDOWN;
list_move(&mid_entry->qhead, &dispose_list); list_move(&mid_entry->qhead, &dispose_list);
} }
@ -736,7 +735,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
/* now walk dispose list and issue callbacks */ /* now walk dispose list and issue callbacks */
list_for_each_safe(tmp, tmp2, &dispose_list) { list_for_each_safe(tmp, tmp2, &dispose_list) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead); mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
cFYI(1, "Callback mid 0x%llx", mid_entry->mid); cifs_dbg(FYI, "Callback mid 0x%llx\n", mid_entry->mid);
list_del_init(&mid_entry->qhead); list_del_init(&mid_entry->qhead);
mid_entry->callback(mid_entry); mid_entry->callback(mid_entry);
} }
@ -753,7 +752,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
* least 45 seconds before giving up on a request getting a * least 45 seconds before giving up on a request getting a
* response and going ahead and killing cifsd. * response and going ahead and killing cifsd.
*/ */
cFYI(1, "Wait for exit from demultiplex thread"); cifs_dbg(FYI, "Wait for exit from demultiplex thread\n");
msleep(46000); msleep(46000);
/* /*
* If threads still have not exited they are probably never * If threads still have not exited they are probably never
@ -780,8 +779,7 @@ standard_receive3(struct TCP_Server_Info *server, struct mid_q_entry *mid)
/* make sure this will fit in a large buffer */ /* make sure this will fit in a large buffer */
if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server) - 4) { if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server) - 4) {
cERROR(1, "SMB response too long (%u bytes)", cifs_dbg(VFS, "SMB response too long (%u bytes)\n", pdu_length);
pdu_length);
cifs_reconnect(server); cifs_reconnect(server);
wake_up(&server->response_q); wake_up(&server->response_q);
return -EAGAIN; return -EAGAIN;
@ -839,7 +837,7 @@ cifs_demultiplex_thread(void *p)
struct mid_q_entry *mid_entry; struct mid_q_entry *mid_entry;
current->flags |= PF_MEMALLOC; current->flags |= PF_MEMALLOC;
cFYI(1, "Demultiplex PID: %d", task_pid_nr(current)); cifs_dbg(FYI, "Demultiplex PID: %d\n", task_pid_nr(current));
length = atomic_inc_return(&tcpSesAllocCount); length = atomic_inc_return(&tcpSesAllocCount);
if (length > 1) if (length > 1)
@ -869,14 +867,14 @@ cifs_demultiplex_thread(void *p)
*/ */
pdu_length = get_rfc1002_length(buf); pdu_length = get_rfc1002_length(buf);
cFYI(1, "RFC1002 header 0x%x", pdu_length); cifs_dbg(FYI, "RFC1002 header 0x%x\n", pdu_length);
if (!is_smb_response(server, buf[0])) if (!is_smb_response(server, buf[0]))
continue; continue;
/* make sure we have enough to get to the MID */ /* make sure we have enough to get to the MID */
if (pdu_length < HEADER_SIZE(server) - 1 - 4) { if (pdu_length < HEADER_SIZE(server) - 1 - 4) {
cERROR(1, "SMB response too short (%u bytes)", cifs_dbg(VFS, "SMB response too short (%u bytes)\n",
pdu_length); pdu_length);
cifs_reconnect(server); cifs_reconnect(server);
wake_up(&server->response_q); wake_up(&server->response_q);
continue; continue;
@ -908,8 +906,8 @@ cifs_demultiplex_thread(void *p)
mid_entry->callback(mid_entry); mid_entry->callback(mid_entry);
} else if (!server->ops->is_oplock_break || } else if (!server->ops->is_oplock_break ||
!server->ops->is_oplock_break(buf, server)) { !server->ops->is_oplock_break(buf, server)) {
cERROR(1, "No task to wake, unknown frame received! " cifs_dbg(VFS, "No task to wake, unknown frame received! NumMids %d\n",
"NumMids %d", atomic_read(&midCount)); atomic_read(&midCount));
cifs_dump_mem("Received Data is: ", buf, cifs_dump_mem("Received Data is: ", buf,
HEADER_SIZE(server)); HEADER_SIZE(server));
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
@ -1035,7 +1033,7 @@ static int cifs_parse_security_flavors(char *value,
break; break;
case Opt_sec_krb5p: case Opt_sec_krb5p:
/* vol->secFlg |= CIFSSEC_MUST_SEAL | CIFSSEC_MAY_KRB5; */ /* vol->secFlg |= CIFSSEC_MUST_SEAL | CIFSSEC_MAY_KRB5; */
cERROR(1, "Krb5 cifs privacy not supported"); cifs_dbg(VFS, "Krb5 cifs privacy not supported\n");
break; break;
case Opt_sec_ntlmssp: case Opt_sec_ntlmssp:
vol->secFlg |= CIFSSEC_MAY_NTLMSSP; vol->secFlg |= CIFSSEC_MAY_NTLMSSP;
@ -1065,7 +1063,7 @@ static int cifs_parse_security_flavors(char *value,
vol->nullauth = 1; vol->nullauth = 1;
break; break;
default: default:
cERROR(1, "bad security option: %s", value); cifs_dbg(VFS, "bad security option: %s\n", value);
return 1; return 1;
} }
@ -1091,7 +1089,7 @@ cifs_parse_cache_flavor(char *value, struct smb_vol *vol)
vol->strict_io = false; vol->strict_io = false;
break; break;
default: default:
cERROR(1, "bad cache= option: %s", value); cifs_dbg(VFS, "bad cache= option: %s\n", value);
return 1; return 1;
} }
return 0; return 0;
@ -1122,7 +1120,7 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol)
break; break;
#endif #endif
default: default:
cERROR(1, "Unknown vers= option specified: %s", value); cifs_dbg(VFS, "Unknown vers= option specified: %s\n", value);
return 1; return 1;
} }
return 0; return 0;
@ -1253,7 +1251,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
separator[0] = options[4]; separator[0] = options[4];
options += 5; options += 5;
} else { } else {
cFYI(1, "Null separator not allowed"); cifs_dbg(FYI, "Null separator not allowed\n");
} }
} }
vol->backupuid_specified = false; /* no backup intent for a user */ vol->backupuid_specified = false; /* no backup intent for a user */
@ -1438,8 +1436,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
break; break;
case Opt_fsc: case Opt_fsc:
#ifndef CONFIG_CIFS_FSCACHE #ifndef CONFIG_CIFS_FSCACHE
cERROR(1, "FS-Cache support needs CONFIG_CIFS_FSCACHE " cifs_dbg(VFS, "FS-Cache support needs CONFIG_CIFS_FSCACHE kernel config option set\n");
"kernel config option set");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
#endif #endif
vol->fsc = true; vol->fsc = true;
@ -1457,55 +1454,55 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
/* Numeric Values */ /* Numeric Values */
case Opt_backupuid: case Opt_backupuid:
if (get_option_uid(args, &vol->backupuid)) { if (get_option_uid(args, &vol->backupuid)) {
cERROR(1, "%s: Invalid backupuid value", cifs_dbg(VFS, "%s: Invalid backupuid value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->backupuid_specified = true; vol->backupuid_specified = true;
break; break;
case Opt_backupgid: case Opt_backupgid:
if (get_option_gid(args, &vol->backupgid)) { if (get_option_gid(args, &vol->backupgid)) {
cERROR(1, "%s: Invalid backupgid value", cifs_dbg(VFS, "%s: Invalid backupgid value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->backupgid_specified = true; vol->backupgid_specified = true;
break; break;
case Opt_uid: case Opt_uid:
if (get_option_uid(args, &vol->linux_uid)) { if (get_option_uid(args, &vol->linux_uid)) {
cERROR(1, "%s: Invalid uid value", cifs_dbg(VFS, "%s: Invalid uid value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
uid_specified = true; uid_specified = true;
break; break;
case Opt_cruid: case Opt_cruid:
if (get_option_uid(args, &vol->cred_uid)) { if (get_option_uid(args, &vol->cred_uid)) {
cERROR(1, "%s: Invalid cruid value", cifs_dbg(VFS, "%s: Invalid cruid value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
break; break;
case Opt_gid: case Opt_gid:
if (get_option_gid(args, &vol->linux_gid)) { if (get_option_gid(args, &vol->linux_gid)) {
cERROR(1, "%s: Invalid gid value", cifs_dbg(VFS, "%s: Invalid gid value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
gid_specified = true; gid_specified = true;
break; break;
case Opt_file_mode: case Opt_file_mode:
if (get_option_ul(args, &option)) { if (get_option_ul(args, &option)) {
cERROR(1, "%s: Invalid file_mode value", cifs_dbg(VFS, "%s: Invalid file_mode value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->file_mode = option; vol->file_mode = option;
break; break;
case Opt_dirmode: case Opt_dirmode:
if (get_option_ul(args, &option)) { if (get_option_ul(args, &option)) {
cERROR(1, "%s: Invalid dir_mode value", cifs_dbg(VFS, "%s: Invalid dir_mode value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->dir_mode = option; vol->dir_mode = option;
@ -1513,37 +1510,37 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
case Opt_port: case Opt_port:
if (get_option_ul(args, &option) || if (get_option_ul(args, &option) ||
option > USHRT_MAX) { option > USHRT_MAX) {
cERROR(1, "%s: Invalid port value", __func__); cifs_dbg(VFS, "%s: Invalid port value\n",
__func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
port = (unsigned short)option; port = (unsigned short)option;
break; break;
case Opt_rsize: case Opt_rsize:
if (get_option_ul(args, &option)) { if (get_option_ul(args, &option)) {
cERROR(1, "%s: Invalid rsize value", cifs_dbg(VFS, "%s: Invalid rsize value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->rsize = option; vol->rsize = option;
break; break;
case Opt_wsize: case Opt_wsize:
if (get_option_ul(args, &option)) { if (get_option_ul(args, &option)) {
cERROR(1, "%s: Invalid wsize value", cifs_dbg(VFS, "%s: Invalid wsize value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->wsize = option; vol->wsize = option;
break; break;
case Opt_actimeo: case Opt_actimeo:
if (get_option_ul(args, &option)) { if (get_option_ul(args, &option)) {
cERROR(1, "%s: Invalid actimeo value", cifs_dbg(VFS, "%s: Invalid actimeo value\n",
__func__); __func__);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->actimeo = HZ * option; vol->actimeo = HZ * option;
if (vol->actimeo > CIFS_MAX_ACTIMEO) { if (vol->actimeo > CIFS_MAX_ACTIMEO) {
cERROR(1, "CIFS: attribute cache" cifs_dbg(VFS, "attribute cache timeout too large\n");
"timeout too large");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
break; break;
@ -1566,11 +1563,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->username = kstrdup(string, GFP_KERNEL); vol->username = kstrdup(string, GFP_KERNEL);
if (!vol->username) { if (!vol->username)
printk(KERN_WARNING "CIFS: no memory "
"for username\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
}
break; break;
case Opt_blank_pass: case Opt_blank_pass:
/* passwords have to be handled differently /* passwords have to be handled differently
@ -1675,7 +1669,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
"for domainname\n"); "for domainname\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
cFYI(1, "Domain name set"); cifs_dbg(FYI, "Domain name set\n");
break; break;
case Opt_srcaddr: case Opt_srcaddr:
string = match_strdup(args); string = match_strdup(args);
@ -1713,7 +1707,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
/* 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", string); cifs_dbg(FYI, "iocharset set to %s\n", string);
break; break;
case Opt_netbiosname: case Opt_netbiosname:
string = match_strdup(args); string = match_strdup(args);
@ -1827,20 +1821,18 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
#ifndef CONFIG_KEYS #ifndef CONFIG_KEYS
/* Muliuser mounts require CONFIG_KEYS support */ /* Muliuser mounts require CONFIG_KEYS support */
if (vol->multiuser) { if (vol->multiuser) {
cERROR(1, "Multiuser mounts require kernels with " cifs_dbg(VFS, "Multiuser mounts require kernels with CONFIG_KEYS enabled\n");
"CONFIG_KEYS enabled.");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
#endif #endif
if (!vol->UNC) { if (!vol->UNC) {
cERROR(1, "CIFS mount error: No usable UNC path provided in " cifs_dbg(VFS, "CIFS mount error: No usable UNC path provided in device string or in unc= option!\n");
"device string or in unc= option!");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
/* make sure UNC has a share name */ /* make sure UNC has a share name */
if (!strchr(vol->UNC + 3, '\\')) { if (!strchr(vol->UNC + 3, '\\')) {
cERROR(1, "Malformed UNC. Unable to find share name."); cifs_dbg(VFS, "Malformed UNC. Unable to find share name.\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
@ -2061,7 +2053,7 @@ cifs_find_tcp_session(struct smb_vol *vol)
++server->srv_count; ++server->srv_count;
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
cFYI(1, "Existing tcp session with server found"); cifs_dbg(FYI, "Existing tcp session with server found\n");
return server; return server;
} }
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
@ -2108,7 +2100,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
struct TCP_Server_Info *tcp_ses = NULL; struct TCP_Server_Info *tcp_ses = NULL;
int rc; int rc;
cFYI(1, "UNC: %s", volume_info->UNC); cifs_dbg(FYI, "UNC: %s\n", volume_info->UNC);
/* see if we already have a matching tcp_ses */ /* see if we already have a matching tcp_ses */
tcp_ses = cifs_find_tcp_session(volume_info); tcp_ses = cifs_find_tcp_session(volume_info);
@ -2123,7 +2115,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
rc = cifs_crypto_shash_allocate(tcp_ses); rc = cifs_crypto_shash_allocate(tcp_ses);
if (rc) { if (rc) {
cERROR(1, "could not setup hash structures rc %d", rc); cifs_dbg(VFS, "could not setup hash structures rc %d\n", rc);
goto out_err; goto out_err;
} }
@ -2170,7 +2162,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
rc = ip_connect(tcp_ses); rc = ip_connect(tcp_ses);
if (rc < 0) { if (rc < 0) {
cERROR(1, "Error connecting to socket. Aborting operation"); cifs_dbg(VFS, "Error connecting to socket. Aborting operation.\n");
goto out_err_crypto_release; goto out_err_crypto_release;
} }
@ -2183,7 +2175,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); cifs_dbg(VFS, "error %d create cifsd thread\n", rc);
module_put(THIS_MODULE); module_put(THIS_MODULE);
goto out_err_crypto_release; goto out_err_crypto_release;
} }
@ -2270,7 +2262,7 @@ cifs_put_smb_ses(struct cifs_ses *ses)
unsigned int xid; unsigned int xid;
struct TCP_Server_Info *server = ses->server; struct TCP_Server_Info *server = ses->server;
cFYI(1, "%s: ses_count=%d", __func__, ses->ses_count); cifs_dbg(FYI, "%s: ses_count=%d\n", __func__, ses->ses_count);
spin_lock(&cifs_tcp_ses_lock); spin_lock(&cifs_tcp_ses_lock);
if (--ses->ses_count > 0) { if (--ses->ses_count > 0) {
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
@ -2322,23 +2314,24 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
sprintf(desc, "cifs:a:%pI6c", &sa6->sin6_addr.s6_addr); sprintf(desc, "cifs:a:%pI6c", &sa6->sin6_addr.s6_addr);
break; break;
default: default:
cFYI(1, "Bad ss_family (%hu)", server->dstaddr.ss_family); cifs_dbg(FYI, "Bad ss_family (%hu)\n",
server->dstaddr.ss_family);
rc = -EINVAL; rc = -EINVAL;
goto out_err; goto out_err;
} }
cFYI(1, "%s: desc=%s", __func__, desc); cifs_dbg(FYI, "%s: desc=%s\n", __func__, desc);
key = request_key(&key_type_logon, desc, ""); key = request_key(&key_type_logon, desc, "");
if (IS_ERR(key)) { if (IS_ERR(key)) {
if (!ses->domainName) { if (!ses->domainName) {
cFYI(1, "domainName is NULL"); cifs_dbg(FYI, "domainName is NULL\n");
rc = PTR_ERR(key); rc = PTR_ERR(key);
goto out_err; goto out_err;
} }
/* didn't work, try to find a domain key */ /* didn't work, try to find a domain key */
sprintf(desc, "cifs:d:%s", ses->domainName); sprintf(desc, "cifs:d:%s", ses->domainName);
cFYI(1, "%s: desc=%s", __func__, desc); cifs_dbg(FYI, "%s: desc=%s\n", __func__, desc);
key = request_key(&key_type_logon, desc, ""); key = request_key(&key_type_logon, desc, "");
if (IS_ERR(key)) { if (IS_ERR(key)) {
rc = PTR_ERR(key); rc = PTR_ERR(key);
@ -2356,32 +2349,34 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
/* find first : in payload */ /* find first : in payload */
payload = (char *)upayload->data; payload = (char *)upayload->data;
delim = strnchr(payload, upayload->datalen, ':'); delim = strnchr(payload, upayload->datalen, ':');
cFYI(1, "payload=%s", payload); cifs_dbg(FYI, "payload=%s\n", payload);
if (!delim) { if (!delim) {
cFYI(1, "Unable to find ':' in payload (datalen=%d)", cifs_dbg(FYI, "Unable to find ':' in payload (datalen=%d)\n",
upayload->datalen); upayload->datalen);
rc = -EINVAL; rc = -EINVAL;
goto out_key_put; goto out_key_put;
} }
len = delim - payload; len = delim - payload;
if (len > MAX_USERNAME_SIZE || len <= 0) { if (len > MAX_USERNAME_SIZE || len <= 0) {
cFYI(1, "Bad value from username search (len=%zd)", len); cifs_dbg(FYI, "Bad value from username search (len=%zd)\n",
len);
rc = -EINVAL; rc = -EINVAL;
goto out_key_put; goto out_key_put;
} }
vol->username = kstrndup(payload, len, GFP_KERNEL); vol->username = kstrndup(payload, len, GFP_KERNEL);
if (!vol->username) { if (!vol->username) {
cFYI(1, "Unable to allocate %zd bytes for username", len); cifs_dbg(FYI, "Unable to allocate %zd bytes for username\n",
len);
rc = -ENOMEM; rc = -ENOMEM;
goto out_key_put; goto out_key_put;
} }
cFYI(1, "%s: username=%s", __func__, vol->username); cifs_dbg(FYI, "%s: username=%s\n", __func__, vol->username);
len = key->datalen - (len + 1); len = key->datalen - (len + 1);
if (len > MAX_PASSWORD_SIZE || len <= 0) { if (len > MAX_PASSWORD_SIZE || len <= 0) {
cFYI(1, "Bad len for password search (len=%zd)", len); cifs_dbg(FYI, "Bad len for password search (len=%zd)\n", len);
rc = -EINVAL; rc = -EINVAL;
kfree(vol->username); kfree(vol->username);
vol->username = NULL; vol->username = NULL;
@ -2391,7 +2386,8 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
++delim; ++delim;
vol->password = kstrndup(delim, len, GFP_KERNEL); vol->password = kstrndup(delim, len, GFP_KERNEL);
if (!vol->password) { if (!vol->password) {
cFYI(1, "Unable to allocate %zd bytes for password", len); cifs_dbg(FYI, "Unable to allocate %zd bytes for password\n",
len);
rc = -ENOMEM; rc = -ENOMEM;
kfree(vol->username); kfree(vol->username);
vol->username = NULL; vol->username = NULL;
@ -2403,7 +2399,7 @@ out_key_put:
key_put(key); key_put(key);
out_err: out_err:
kfree(desc); kfree(desc);
cFYI(1, "%s: returning %d", __func__, rc); cifs_dbg(FYI, "%s: returning %d\n", __func__, rc);
return rc; return rc;
} }
#else /* ! CONFIG_KEYS */ #else /* ! CONFIG_KEYS */
@ -2428,7 +2424,8 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
ses = cifs_find_smb_ses(server, volume_info); ses = cifs_find_smb_ses(server, volume_info);
if (ses) { if (ses) {
cFYI(1, "Existing smb sess found (status=%d)", ses->status); cifs_dbg(FYI, "Existing smb sess found (status=%d)\n",
ses->status);
mutex_lock(&ses->session_mutex); mutex_lock(&ses->session_mutex);
rc = cifs_negotiate_protocol(xid, ses); rc = cifs_negotiate_protocol(xid, ses);
@ -2440,7 +2437,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
return ERR_PTR(rc); return ERR_PTR(rc);
} }
if (ses->need_reconnect) { if (ses->need_reconnect) {
cFYI(1, "Session needs reconnect"); cifs_dbg(FYI, "Session needs reconnect\n");
rc = cifs_setup_session(xid, ses, rc = cifs_setup_session(xid, ses,
volume_info->local_nls); volume_info->local_nls);
if (rc) { if (rc) {
@ -2459,7 +2456,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
return ses; return ses;
} }
cFYI(1, "Existing smb sess not found"); cifs_dbg(FYI, "Existing smb sess not found\n");
ses = sesInfoAlloc(); ses = sesInfoAlloc();
if (ses == NULL) if (ses == NULL)
goto get_ses_fail; goto get_ses_fail;
@ -2549,7 +2546,7 @@ cifs_put_tcon(struct cifs_tcon *tcon)
unsigned int xid; unsigned int xid;
struct cifs_ses *ses = tcon->ses; struct cifs_ses *ses = tcon->ses;
cFYI(1, "%s: tc_count=%d", __func__, tcon->tc_count); cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count);
spin_lock(&cifs_tcp_ses_lock); spin_lock(&cifs_tcp_ses_lock);
if (--tcon->tc_count > 0) { if (--tcon->tc_count > 0) {
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
@ -2577,12 +2574,11 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
tcon = cifs_find_tcon(ses, volume_info->UNC); tcon = cifs_find_tcon(ses, volume_info->UNC);
if (tcon) { if (tcon) {
cFYI(1, "Found match on UNC path"); cifs_dbg(FYI, "Found match on UNC path\n");
/* existing tcon already has a reference */ /* existing tcon already has a reference */
cifs_put_smb_ses(ses); cifs_put_smb_ses(ses);
if (tcon->seal != volume_info->seal) if (tcon->seal != volume_info->seal)
cERROR(1, "transport encryption setting " cifs_dbg(VFS, "transport encryption setting conflicts with existing tid\n");
"conflicts with existing tid");
return tcon; return tcon;
} }
@ -2614,13 +2610,13 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon,
volume_info->local_nls); volume_info->local_nls);
free_xid(xid); free_xid(xid);
cFYI(1, "Tcon rc = %d", rc); cifs_dbg(FYI, "Tcon rc = %d\n", rc);
if (rc) if (rc)
goto out_fail; goto out_fail;
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)", tcon->Flags); cifs_dbg(FYI, "DFS disabled (%d)\n", tcon->Flags);
} }
tcon->seal = volume_info->seal; tcon->seal = volume_info->seal;
/* /*
@ -2774,7 +2770,7 @@ get_dfs_path(const unsigned int xid, struct cifs_ses *ses, const char *old_path,
strcpy(temp_unc + 2 + strlen(ses->serverName), "\\IPC$"); strcpy(temp_unc + 2 + strlen(ses->serverName), "\\IPC$");
rc = ses->server->ops->tree_connect(xid, ses, temp_unc, NULL, rc = ses->server->ops->tree_connect(xid, ses, temp_unc, NULL,
nls_codepage); nls_codepage);
cFYI(1, "Tcon rc = %d ipc_tid = %d", rc, ses->ipc_tid); cifs_dbg(FYI, "Tcon rc = %d ipc_tid = %d\n", rc, ses->ipc_tid);
kfree(temp_unc); kfree(temp_unc);
} }
if (rc == 0) if (rc == 0)
@ -2852,13 +2848,11 @@ bind_socket(struct TCP_Server_Info *server)
saddr4 = (struct sockaddr_in *)&server->srcaddr; saddr4 = (struct sockaddr_in *)&server->srcaddr;
saddr6 = (struct sockaddr_in6 *)&server->srcaddr; saddr6 = (struct sockaddr_in6 *)&server->srcaddr;
if (saddr6->sin6_family == AF_INET6) if (saddr6->sin6_family == AF_INET6)
cERROR(1, "cifs: " cifs_dbg(VFS, "Failed to bind to: %pI6c, error: %d\n",
"Failed to bind to: %pI6c, error: %d", &saddr6->sin6_addr, rc);
&saddr6->sin6_addr, rc);
else else
cERROR(1, "cifs: " cifs_dbg(VFS, "Failed to bind to: %pI4, error: %d\n",
"Failed to bind to: %pI4, error: %d", &saddr4->sin_addr.s_addr, rc);
&saddr4->sin_addr.s_addr, rc);
} }
} }
return rc; return rc;
@ -2963,13 +2957,13 @@ generic_ip_connect(struct TCP_Server_Info *server)
rc = __sock_create(cifs_net_ns(server), sfamily, SOCK_STREAM, rc = __sock_create(cifs_net_ns(server), sfamily, SOCK_STREAM,
IPPROTO_TCP, &socket, 1); IPPROTO_TCP, &socket, 1);
if (rc < 0) { if (rc < 0) {
cERROR(1, "Error %d creating socket", rc); cifs_dbg(VFS, "Error %d creating socket\n", rc);
server->ssocket = NULL; server->ssocket = NULL;
return rc; return rc;
} }
/* BB other socket options to set KEEPALIVE, NODELAY? */ /* BB other socket options to set KEEPALIVE, NODELAY? */
cFYI(1, "Socket created"); cifs_dbg(FYI, "Socket created\n");
server->ssocket = socket; server->ssocket = socket;
socket->sk->sk_allocation = GFP_NOFS; socket->sk->sk_allocation = GFP_NOFS;
if (sfamily == AF_INET6) if (sfamily == AF_INET6)
@ -3003,16 +2997,17 @@ generic_ip_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); cifs_dbg(FYI, "set TCP_NODELAY socket option error %d\n",
rc);
} }
cFYI(1, "sndbuf %d rcvbuf %d rcvtimeo 0x%lx", cifs_dbg(FYI, "sndbuf %d rcvbuf %d rcvtimeo 0x%lx\n",
socket->sk->sk_sndbuf, socket->sk->sk_sndbuf,
socket->sk->sk_rcvbuf, socket->sk->sk_rcvtimeo); socket->sk->sk_rcvbuf, socket->sk->sk_rcvtimeo);
rc = socket->ops->connect(socket, saddr, slen, 0); rc = socket->ops->connect(socket, saddr, slen, 0);
if (rc < 0) { if (rc < 0) {
cFYI(1, "Error %d connecting to server", rc); cifs_dbg(FYI, "Error %d connecting to server\n", rc);
sock_release(socket); sock_release(socket);
server->ssocket = NULL; server->ssocket = NULL;
return rc; return rc;
@ -3070,19 +3065,19 @@ void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *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"); cifs_dbg(FYI, "Linux protocol extensions disabled\n");
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"); cifs_dbg(FYI, "Unix extensions disabled so not set on reconnect\n");
return; return;
} }
if (!CIFSSMBQFSUnixInfo(xid, tcon)) { if (!CIFSSMBQFSUnixInfo(xid, tcon)) {
__u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability);
cFYI(1, "unix caps which server supports %lld", cap); cifs_dbg(FYI, "unix caps which server supports %lld\n", cap);
/* check for reconnect case in which we do not /* check for reconnect case in which we do not
want to change the mount behavior if we can avoid it */ want to change the mount behavior if we can avoid it */
if (vol_info == NULL) { if (vol_info == NULL) {
@ -3092,22 +3087,22 @@ void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *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"); cifs_dbg(VFS, "POSIXPATH support change\n");
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"); cifs_dbg(VFS, "possible reconnect error\n");
cERROR(1, "server disabled POSIX path support"); cifs_dbg(VFS, "server disabled POSIX path support\n");
} }
} }
if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP) if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)
cERROR(1, "per-share encryption not supported yet"); cifs_dbg(VFS, "per-share encryption not supported yet\n");
cap &= CIFS_UNIX_CAP_MASK; cap &= CIFS_UNIX_CAP_MASK;
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"); cifs_dbg(FYI, "negotiated posix acl support\n");
if (cifs_sb) if (cifs_sb)
cifs_sb->mnt_cifs_flags |= cifs_sb->mnt_cifs_flags |=
CIFS_MOUNT_POSIXACL; CIFS_MOUNT_POSIXACL;
@ -3116,43 +3111,38 @@ void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *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"); cifs_dbg(FYI, "negotiate posix pathnames\n");
if (cifs_sb) if (cifs_sb)
cifs_sb->mnt_cifs_flags |= cifs_sb->mnt_cifs_flags |=
CIFS_MOUNT_POSIX_PATHS; CIFS_MOUNT_POSIX_PATHS;
} }
cFYI(1, "Negotiate caps 0x%x", (int)cap); cifs_dbg(FYI, "Negotiate caps 0x%x\n", (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"); cifs_dbg(FYI, "FCNTL cap\n");
if (cap & CIFS_UNIX_EXTATTR_CAP) if (cap & CIFS_UNIX_EXTATTR_CAP)
cFYI(1, "EXTATTR cap"); cifs_dbg(FYI, "EXTATTR cap\n");
if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP)
cFYI(1, "POSIX path cap"); cifs_dbg(FYI, "POSIX path cap\n");
if (cap & CIFS_UNIX_XATTR_CAP) if (cap & CIFS_UNIX_XATTR_CAP)
cFYI(1, "XATTR cap"); cifs_dbg(FYI, "XATTR cap\n");
if (cap & CIFS_UNIX_POSIX_ACL_CAP) if (cap & CIFS_UNIX_POSIX_ACL_CAP)
cFYI(1, "POSIX ACL cap"); cifs_dbg(FYI, "POSIX ACL cap\n");
if (cap & CIFS_UNIX_LARGE_READ_CAP) if (cap & CIFS_UNIX_LARGE_READ_CAP)
cFYI(1, "very large read cap"); cifs_dbg(FYI, "very large read cap\n");
if (cap & CIFS_UNIX_LARGE_WRITE_CAP) if (cap & CIFS_UNIX_LARGE_WRITE_CAP)
cFYI(1, "very large write cap"); cifs_dbg(FYI, "very large write cap\n");
if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP) if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP)
cFYI(1, "transport encryption cap"); cifs_dbg(FYI, "transport encryption cap\n");
if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP) if (cap & CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)
cFYI(1, "mandatory transport encryption cap"); cifs_dbg(FYI, "mandatory transport encryption cap\n");
#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"); cifs_dbg(FYI, "resetting capabilities failed\n");
} else } else
cERROR(1, "Negotiating Unix capabilities " cifs_dbg(VFS, "Negotiating Unix capabilities with the server failed. Consider mounting with the Unix Extensions disabled if problems are found by specifying the nounix mount option.\n");
"with the server failed. Consider "
"mounting with the Unix Extensions "
"disabled if problems are found "
"by specifying the nounix mount "
"option.");
} }
} }
@ -3177,8 +3167,8 @@ void cifs_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%hx dir mode: 0x%hx", cifs_dbg(FYI, "file mode: 0x%hx dir mode: 0x%hx\n",
cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode); cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode);
cifs_sb->actimeo = pvolume_info->actimeo; cifs_sb->actimeo = pvolume_info->actimeo;
cifs_sb->local_nls = pvolume_info->local_nls; cifs_sb->local_nls = pvolume_info->local_nls;
@ -3227,21 +3217,19 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
if (pvolume_info->strict_io) if (pvolume_info->strict_io)
cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_STRICT_IO; cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_STRICT_IO;
if (pvolume_info->direct_io) { if (pvolume_info->direct_io) {
cFYI(1, "mounting share using direct i/o"); cifs_dbg(FYI, "mounting share using direct i/o\n");
cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;
} }
if (pvolume_info->mfsymlinks) { if (pvolume_info->mfsymlinks) {
if (pvolume_info->sfu_emul) { if (pvolume_info->sfu_emul) {
cERROR(1, "mount option mfsymlinks ignored if sfu " cifs_dbg(VFS, "mount option mfsymlinks ignored if sfu mount option is used\n");
"mount option is used");
} else { } else {
cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MF_SYMLINKS; cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MF_SYMLINKS;
} }
} }
if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm)) if ((pvolume_info->cifs_acl) && (pvolume_info->dynperm))
cERROR(1, "mount option dynperm ignored if cifsacl " cifs_dbg(VFS, "mount option dynperm ignored if cifsacl mount option supported\n");
"mount option supported");
} }
static void static void
@ -3293,7 +3281,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
*pos = '\0'; /* add trailing null */ *pos = '\0'; /* add trailing null */
convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb)); convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb));
cFYI(1, "%s: full_path=%s", __func__, full_path); cifs_dbg(FYI, "%s: full_path=%s\n", __func__, full_path);
return full_path; return full_path;
} }
@ -3364,14 +3352,14 @@ cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
return -EINVAL; return -EINVAL;
if (volume_info->nullauth) { if (volume_info->nullauth) {
cFYI(1, "Anonymous login"); cifs_dbg(FYI, "Anonymous login\n");
kfree(volume_info->username); kfree(volume_info->username);
volume_info->username = NULL; volume_info->username = NULL;
} 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); cifs_dbg(FYI, "Username: %s\n", volume_info->username);
} else { } else {
cifserror("No username specified"); cifs_dbg(VFS, "No username specified\n");
/* In userspace mount helper we can get user name from alternate /* In userspace mount helper we can get user name from alternate
locations such as env variables and files on disk */ locations such as env variables and files on disk */
return -EINVAL; return -EINVAL;
@ -3384,7 +3372,7 @@ cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
} else { } else {
volume_info->local_nls = load_nls(volume_info->iocharset); volume_info->local_nls = load_nls(volume_info->iocharset);
if (volume_info->local_nls == NULL) { if (volume_info->local_nls == NULL) {
cERROR(1, "CIFS mount error: iocharset %s not found", cifs_dbg(VFS, "CIFS mount error: iocharset %s not found\n",
volume_info->iocharset); volume_info->iocharset);
return -ELIBACC; return -ELIBACC;
} }
@ -3734,13 +3722,13 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *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"); cifs_dbg(FYI, "IPC connection\n");
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"); cifs_dbg(FYI, "disk share connection\n");
} }
} }
bcc_ptr += length + 1; bcc_ptr += length + 1;
@ -3753,7 +3741,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
bytes_left, is_unicode, bytes_left, is_unicode,
nls_codepage); nls_codepage);
cFYI(1, "nativeFileSystem=%s", tcon->nativeFileSystem); cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem);
if ((smb_buffer_response->WordCount == 3) || if ((smb_buffer_response->WordCount == 3) ||
(smb_buffer_response->WordCount == 7)) (smb_buffer_response->WordCount == 7))
@ -3761,7 +3749,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *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); cifs_dbg(FYI, "Tcon flags: 0x%x\n", 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;
@ -3839,14 +3827,14 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
if (linuxExtEnabled == 0) if (linuxExtEnabled == 0)
ses->capabilities &= (~server->vals->cap_unix); ses->capabilities &= (~server->vals->cap_unix);
cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d", cifs_dbg(FYI, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d\n",
server->sec_mode, server->capabilities, server->timeAdj); server->sec_mode, server->capabilities, server->timeAdj);
if (server->ops->sess_setup) if (server->ops->sess_setup)
rc = server->ops->sess_setup(xid, ses, nls_info); rc = server->ops->sess_setup(xid, ses, nls_info);
if (rc) { if (rc) {
cERROR(1, "Send error in SessSetup = %d", rc); cifs_dbg(VFS, "Send error in SessSetup = %d\n", rc);
} else { } else {
mutex_lock(&ses->server->srv_mutex); mutex_lock(&ses->server->srv_mutex);
if (!server->session_estab) { if (!server->session_estab) {
@ -3858,7 +3846,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
} }
mutex_unlock(&server->srv_mutex); mutex_unlock(&server->srv_mutex);
cFYI(1, "CIFS Session Established successfully"); cifs_dbg(FYI, "CIFS Session Established successfully\n");
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
ses->status = CifsGood; ses->status = CifsGood;
ses->need_reconnect = false; ses->need_reconnect = false;

Просмотреть файл

@ -102,7 +102,7 @@ cifs_bp_rename_retry:
namelen += (1 + temp->d_name.len); namelen += (1 + temp->d_name.len);
temp = temp->d_parent; temp = temp->d_parent;
if (temp == NULL) { if (temp == NULL) {
cERROR(1, "corrupt dentry"); cifs_dbg(VFS, "corrupt dentry\n");
rcu_read_unlock(); rcu_read_unlock();
return NULL; return NULL;
} }
@ -124,12 +124,12 @@ cifs_bp_rename_retry:
full_path[namelen] = dirsep; full_path[namelen] = dirsep;
strncpy(full_path + namelen + 1, temp->d_name.name, strncpy(full_path + namelen + 1, temp->d_name.name,
temp->d_name.len); temp->d_name.len);
cFYI(0, "name: %s", full_path + namelen); cifs_dbg(FYI, "name: %s\n", full_path + namelen);
} }
spin_unlock(&temp->d_lock); spin_unlock(&temp->d_lock);
temp = temp->d_parent; temp = temp->d_parent;
if (temp == NULL) { if (temp == NULL) {
cERROR(1, "corrupt dentry"); cifs_dbg(VFS, "corrupt dentry\n");
rcu_read_unlock(); rcu_read_unlock();
kfree(full_path); kfree(full_path);
return NULL; return NULL;
@ -137,8 +137,8 @@ cifs_bp_rename_retry:
} }
rcu_read_unlock(); rcu_read_unlock();
if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) { if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) {
cFYI(1, "did not end path lookup where expected. namelen=%d " cifs_dbg(FYI, "did not end path lookup where expected. namelen=%ddfsplen=%d\n",
"dfsplen=%d", namelen, dfsplen); namelen, dfsplen);
/* presumably this is only possible if racing with a rename /* presumably this is only possible if racing with a rename
of one of the parent directories (we can not lock the dentries of one of the parent directories (we can not lock the dentries
above us to prevent this, but retrying should be harmless) */ above us to prevent this, but retrying should be harmless) */
@ -178,7 +178,7 @@ check_name(struct dentry *direntry)
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) { if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
for (i = 0; i < direntry->d_name.len; i++) { for (i = 0; i < direntry->d_name.len; i++) {
if (direntry->d_name.name[i] == '\\') { if (direntry->d_name.name[i] == '\\') {
cFYI(1, "Invalid file name"); cifs_dbg(FYI, "Invalid file name\n");
return -EINVAL; return -EINVAL;
} }
} }
@ -291,7 +291,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
else if ((oflags & O_CREAT) == O_CREAT) else if ((oflags & O_CREAT) == O_CREAT)
disposition = FILE_OPEN_IF; disposition = FILE_OPEN_IF;
else else
cFYI(1, "Create flag not set in create function"); cifs_dbg(FYI, "Create flag not set in create function\n");
/* /*
* BB add processing to set equivalent of mode - e.g. via CreateX with * BB add processing to set equivalent of mode - e.g. via CreateX with
@ -323,7 +323,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
desired_access, create_options, fid, oplock, desired_access, create_options, fid, oplock,
buf, cifs_sb); buf, cifs_sb);
if (rc) { if (rc) {
cFYI(1, "cifs_create returned 0x%x", rc); cifs_dbg(FYI, "cifs_create returned 0x%x\n", rc);
goto out; goto out;
} }
@ -389,7 +389,8 @@ cifs_create_get_file_info:
cifs_create_set_dentry: cifs_create_set_dentry:
if (rc != 0) { if (rc != 0) {
cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); cifs_dbg(FYI, "Create worked, get_inode_info failed rc = %d\n",
rc);
if (server->ops->close) if (server->ops->close)
server->ops->close(xid, tcon, fid); server->ops->close(xid, tcon, fid);
goto out; goto out;
@ -452,8 +453,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
xid = get_xid(); xid = get_xid();
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
inode, direntry->d_name.name, direntry); inode, direntry->d_name.name, direntry);
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
if (IS_ERR(tlink)) if (IS_ERR(tlink))
@ -518,8 +519,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
__u32 oplock; __u32 oplock;
int created = FILE_CREATED; int created = FILE_CREATED;
cFYI(1, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p", cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n",
inode, direntry->d_name.name, direntry); inode, direntry->d_name.name, direntry);
tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
rc = PTR_ERR(tlink); rc = PTR_ERR(tlink);
@ -613,7 +614,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
goto mknod_out; goto mknod_out;
cFYI(1, "sfu compat create special file"); cifs_dbg(FYI, "sfu compat create special file\n");
buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
if (buf == NULL) { if (buf == NULL) {
@ -688,8 +689,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
xid = get_xid(); xid = get_xid();
cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
parent_dir_inode, direntry->d_name.name, direntry); parent_dir_inode, direntry->d_name.name, direntry);
/* check whether path exists */ /* check whether path exists */
@ -715,11 +716,12 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
} }
if (direntry->d_inode != NULL) { if (direntry->d_inode != NULL) {
cFYI(1, "non-NULL inode in lookup"); cifs_dbg(FYI, "non-NULL inode in lookup\n");
} else { } else {
cFYI(1, "NULL inode in lookup"); cifs_dbg(FYI, "NULL inode in lookup\n");
} }
cFYI(1, "Full path: %s inode = 0x%p", full_path, direntry->d_inode); cifs_dbg(FYI, "Full path: %s inode = 0x%p\n",
full_path, direntry->d_inode);
if (pTcon->unix_ext) { if (pTcon->unix_ext) {
rc = cifs_get_inode_info_unix(&newInode, full_path, rc = cifs_get_inode_info_unix(&newInode, full_path,
@ -742,7 +744,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
/* if it was once a directory (but how can we tell?) we could do /* if it was once a directory (but how can we tell?) we could do
shrink_dcache_parent(direntry); */ shrink_dcache_parent(direntry); */
} else if (rc != -EACCES) { } else if (rc != -EACCES) {
cERROR(1, "Unexpected lookup error %d", rc); cifs_dbg(VFS, "Unexpected lookup error %d\n", rc);
/* We special case check for Access Denied - since that /* We special case check for Access Denied - since that
is a common return code */ is a common return code */
} }
@ -807,7 +809,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
{ {
int rc = 0; int rc = 0;
cFYI(1, "In cifs d_delete, name = %s", direntry->d_name.name); cifs_dbg(FYI, "In cifs d_delete, name = %s\n", direntry->d_name.name);
return rc; return rc;
} */ } */

Просмотреть файл

@ -55,7 +55,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
len = strlen(unc); len = strlen(unc);
if (len < 3) { if (len < 3) {
cFYI(1, "%s: unc is too short: %s", __func__, unc); cifs_dbg(FYI, "%s: unc is too short: %s\n", __func__, unc);
return -EINVAL; return -EINVAL;
} }
@ -68,8 +68,8 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
if (sep) if (sep)
len = sep - hostname; len = sep - hostname;
else else
cFYI(1, "%s: probably server name is whole unc: %s", cifs_dbg(FYI, "%s: probably server name is whole unc: %s\n",
__func__, unc); __func__, unc);
/* Try to interpret hostname as an IPv4 or IPv6 address */ /* Try to interpret hostname as an IPv4 or IPv6 address */
rc = cifs_convert_address((struct sockaddr *)&ss, hostname, len); rc = cifs_convert_address((struct sockaddr *)&ss, hostname, len);
@ -79,11 +79,11 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
/* Perform the upcall */ /* Perform the upcall */
rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL); rc = dns_query(NULL, hostname, len, NULL, ip_addr, NULL);
if (rc < 0) if (rc < 0)
cFYI(1, "%s: unable to resolve: %*.*s", cifs_dbg(FYI, "%s: unable to resolve: %*.*s\n",
__func__, len, len, hostname); __func__, len, len, hostname);
else else
cFYI(1, "%s: resolved: %*.*s to %s", cifs_dbg(FYI, "%s: resolved: %*.*s to %s\n",
__func__, len, len, hostname, *ip_addr); __func__, len, len, hostname, *ip_addr);
return rc; return rc;
name_is_IP_address: name_is_IP_address:
@ -92,7 +92,8 @@ name_is_IP_address:
return -ENOMEM; return -ENOMEM;
memcpy(name, hostname, len); memcpy(name, hostname, len);
name[len] = 0; name[len] = 0;
cFYI(1, "%s: unc is IP, skipping dns upcall: %s", __func__, name); cifs_dbg(FYI, "%s: unc is IP, skipping dns upcall: %s\n",
__func__, name);
*ip_addr = name; *ip_addr = name;
return 0; return 0;
} }

Просмотреть файл

@ -49,7 +49,7 @@
static struct dentry *cifs_get_parent(struct dentry *dentry) static struct dentry *cifs_get_parent(struct dentry *dentry)
{ {
/* BB need to add code here eventually to enable export via NFSD */ /* BB need to add code here eventually to enable export via NFSD */
cFYI(1, "get parent for %p", dentry); cifs_dbg(FYI, "get parent for %p\n", dentry);
return ERR_PTR(-EACCES); return ERR_PTR(-EACCES);
} }

Просмотреть файл

@ -78,9 +78,8 @@ static u32 cifs_posix_convert_flags(unsigned int flags)
if (flags & O_EXCL) if (flags & O_EXCL)
posix_flags |= SMB_O_EXCL; posix_flags |= SMB_O_EXCL;
} else if (flags & O_EXCL) } else if (flags & O_EXCL)
cFYI(1, "Application %s pid %d has incorrectly set O_EXCL flag" cifs_dbg(FYI, "Application %s pid %d has incorrectly set O_EXCL flag but not O_CREAT on file open. Ignoring O_EXCL\n",
"but not O_CREAT on file open. Ignoring O_EXCL", current->comm, current->tgid);
current->comm, current->tgid);
if (flags & O_TRUNC) if (flags & O_TRUNC)
posix_flags |= SMB_O_TRUNC; posix_flags |= SMB_O_TRUNC;
@ -123,7 +122,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
cFYI(1, "posix open %s", full_path); cifs_dbg(FYI, "posix open %s\n", 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)
@ -308,7 +307,7 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
*/ */
if (oplock == server->vals->oplock_read && if (oplock == server->vals->oplock_read &&
cifs_has_mand_locks(cinode)) { cifs_has_mand_locks(cinode)) {
cFYI(1, "Reset oplock val from read to None due to mand locks"); cifs_dbg(FYI, "Reset oplock val from read to None due to mand locks\n");
oplock = 0; oplock = 0;
} }
@ -374,8 +373,8 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
list_del(&cifs_file->tlist); list_del(&cifs_file->tlist);
if (list_empty(&cifsi->openFileList)) { if (list_empty(&cifsi->openFileList)) {
cFYI(1, "closing last open instance for inode %p", cifs_dbg(FYI, "closing last open instance for inode %p\n",
cifs_file->dentry->d_inode); cifs_file->dentry->d_inode);
/* /*
* In strict cache mode we need invalidate mapping on the last * In strict cache mode we need invalidate mapping on the last
* close because it may cause a error when we open this file * close because it may cause a error when we open this file
@ -454,7 +453,7 @@ int cifs_open(struct inode *inode, struct file *file)
goto out; goto out;
} }
cFYI(1, "inode = 0x%p file flags are 0x%x for %s", cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
inode, file->f_flags, full_path); inode, file->f_flags, full_path);
if (server->oplocks) if (server->oplocks)
@ -470,16 +469,13 @@ int cifs_open(struct inode *inode, struct file *file)
cifs_sb->mnt_file_mode /* ignored */, cifs_sb->mnt_file_mode /* ignored */,
file->f_flags, &oplock, &fid.netfid, xid); file->f_flags, &oplock, &fid.netfid, xid);
if (rc == 0) { if (rc == 0) {
cFYI(1, "posix open succeeded"); cifs_dbg(FYI, "posix open succeeded\n");
posix_open_ok = true; posix_open_ok = true;
} 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" cifs_dbg(VFS, "server %s of type %s returned unexpected error on SMB posix open, disabling posix open support. Check if server update available.\n",
" unexpected error on SMB posix open" tcon->ses->serverName,
", disabling posix open support." tcon->ses->serverNOS);
" Check if server update available.",
tcon->ses->serverName,
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 */
@ -621,8 +617,8 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
return rc; return rc;
} }
cFYI(1, "inode = 0x%p file flags 0x%x for %s", inode, cfile->f_flags, cifs_dbg(FYI, "inode = 0x%p file flags 0x%x for %s\n",
full_path); inode, cfile->f_flags, full_path);
if (tcon->ses->server->oplocks) if (tcon->ses->server->oplocks)
oplock = REQ_OPLOCK; oplock = REQ_OPLOCK;
@ -643,7 +639,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
cifs_sb->mnt_file_mode /* ignored */, cifs_sb->mnt_file_mode /* ignored */,
oflags, &oplock, &fid.netfid, xid); oflags, &oplock, &fid.netfid, xid);
if (rc == 0) { if (rc == 0) {
cFYI(1, "posix reopen succeeded"); cifs_dbg(FYI, "posix reopen succeeded\n");
goto reopen_success; goto reopen_success;
} }
/* /*
@ -672,8 +668,8 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
NULL, cifs_sb); NULL, cifs_sb);
if (rc) { if (rc) {
mutex_unlock(&cfile->fh_mutex); mutex_unlock(&cfile->fh_mutex);
cFYI(1, "cifs_reopen returned 0x%x", rc); cifs_dbg(FYI, "cifs_reopen returned 0x%x\n", rc);
cFYI(1, "oplock: %d", oplock); cifs_dbg(FYI, "oplock: %d\n", oplock);
goto reopen_error_exit; goto reopen_error_exit;
} }
@ -729,7 +725,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
char *buf; char *buf;
cFYI(1, "Closedir inode = 0x%p", inode); cifs_dbg(FYI, "Closedir inode = 0x%p\n", inode);
if (cfile == NULL) if (cfile == NULL)
return rc; return rc;
@ -738,7 +734,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
tcon = tlink_tcon(cfile->tlink); tcon = tlink_tcon(cfile->tlink);
server = tcon->ses->server; server = tcon->ses->server;
cFYI(1, "Freeing private data in close dir"); cifs_dbg(FYI, "Freeing private data in close dir\n");
spin_lock(&cifs_file_list_lock); spin_lock(&cifs_file_list_lock);
if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) { if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) {
cfile->invalidHandle = true; cfile->invalidHandle = true;
@ -747,7 +743,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
rc = server->ops->close_dir(xid, tcon, &cfile->fid); rc = server->ops->close_dir(xid, tcon, &cfile->fid);
else else
rc = -ENOSYS; rc = -ENOSYS;
cFYI(1, "Closing uncompleted readdir with rc %d", rc); cifs_dbg(FYI, "Closing uncompleted readdir with rc %d\n", 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
@ -755,7 +751,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
buf = cfile->srch_inf.ntwrk_buf_start; buf = cfile->srch_inf.ntwrk_buf_start;
if (buf) { if (buf) {
cFYI(1, "closedir free smb buf in srch struct"); cifs_dbg(FYI, "closedir free smb buf in srch struct\n");
cfile->srch_inf.ntwrk_buf_start = NULL; cfile->srch_inf.ntwrk_buf_start = NULL;
if (cfile->srch_inf.smallBuf) if (cfile->srch_inf.smallBuf)
cifs_small_buf_release(buf); cifs_small_buf_release(buf);
@ -1140,7 +1136,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
* The list ended. We don't have enough allocated * The list ended. We don't have enough allocated
* structures - something is really wrong. * structures - something is really wrong.
*/ */
cERROR(1, "Can't push all brlocks!"); cifs_dbg(VFS, "Can't push all brlocks!\n");
break; break;
} }
length = 1 + flock->fl_end - flock->fl_start; length = 1 + flock->fl_end - flock->fl_start;
@ -1213,47 +1209,46 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
bool *wait_flag, struct TCP_Server_Info *server) bool *wait_flag, struct TCP_Server_Info *server)
{ {
if (flock->fl_flags & FL_POSIX) if (flock->fl_flags & FL_POSIX)
cFYI(1, "Posix"); cifs_dbg(FYI, "Posix\n");
if (flock->fl_flags & FL_FLOCK) if (flock->fl_flags & FL_FLOCK)
cFYI(1, "Flock"); cifs_dbg(FYI, "Flock\n");
if (flock->fl_flags & FL_SLEEP) { if (flock->fl_flags & FL_SLEEP) {
cFYI(1, "Blocking lock"); cifs_dbg(FYI, "Blocking lock\n");
*wait_flag = true; *wait_flag = true;
} }
if (flock->fl_flags & FL_ACCESS) if (flock->fl_flags & FL_ACCESS)
cFYI(1, "Process suspended by mandatory locking - " cifs_dbg(FYI, "Process suspended by mandatory locking - not implemented yet\n");
"not implemented yet");
if (flock->fl_flags & FL_LEASE) if (flock->fl_flags & FL_LEASE)
cFYI(1, "Lease on file - not implemented yet"); cifs_dbg(FYI, "Lease on file - not implemented yet\n");
if (flock->fl_flags & if (flock->fl_flags &
(~(FL_POSIX | FL_FLOCK | FL_SLEEP | (~(FL_POSIX | FL_FLOCK | FL_SLEEP |
FL_ACCESS | FL_LEASE | FL_CLOSE))) FL_ACCESS | FL_LEASE | FL_CLOSE)))
cFYI(1, "Unknown lock flags 0x%x", flock->fl_flags); cifs_dbg(FYI, "Unknown lock flags 0x%x\n", flock->fl_flags);
*type = server->vals->large_lock_type; *type = server->vals->large_lock_type;
if (flock->fl_type == F_WRLCK) { if (flock->fl_type == F_WRLCK) {
cFYI(1, "F_WRLCK "); cifs_dbg(FYI, "F_WRLCK\n");
*type |= server->vals->exclusive_lock_type; *type |= server->vals->exclusive_lock_type;
*lock = 1; *lock = 1;
} else if (flock->fl_type == F_UNLCK) { } else if (flock->fl_type == F_UNLCK) {
cFYI(1, "F_UNLCK"); cifs_dbg(FYI, "F_UNLCK\n");
*type |= server->vals->unlock_lock_type; *type |= server->vals->unlock_lock_type;
*unlock = 1; *unlock = 1;
/* Check if unlock includes more than one lock range */ /* Check if unlock includes more than one lock range */
} else if (flock->fl_type == F_RDLCK) { } else if (flock->fl_type == F_RDLCK) {
cFYI(1, "F_RDLCK"); cifs_dbg(FYI, "F_RDLCK\n");
*type |= server->vals->shared_lock_type; *type |= server->vals->shared_lock_type;
*lock = 1; *lock = 1;
} else if (flock->fl_type == F_EXLCK) { } else if (flock->fl_type == F_EXLCK) {
cFYI(1, "F_EXLCK"); cifs_dbg(FYI, "F_EXLCK\n");
*type |= server->vals->exclusive_lock_type; *type |= server->vals->exclusive_lock_type;
*lock = 1; *lock = 1;
} else if (flock->fl_type == F_SHLCK) { } else if (flock->fl_type == F_SHLCK) {
cFYI(1, "F_SHLCK"); cifs_dbg(FYI, "F_SHLCK\n");
*type |= server->vals->shared_lock_type; *type |= server->vals->shared_lock_type;
*lock = 1; *lock = 1;
} else } else
cFYI(1, "Unknown type of lock"); cifs_dbg(FYI, "Unknown type of lock\n");
} }
static int static int
@ -1296,8 +1291,8 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
type, 0, 1, false); type, 0, 1, false);
flock->fl_type = F_UNLCK; flock->fl_type = F_UNLCK;
if (rc != 0) if (rc != 0)
cERROR(1, "Error unlocking previously locked " cifs_dbg(VFS, "Error unlocking previously locked range %d during test of lock\n",
"range %d during test of lock", rc); rc);
return 0; return 0;
} }
@ -1316,8 +1311,8 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
type | server->vals->shared_lock_type, 0, 1, false); type | server->vals->shared_lock_type, 0, 1, false);
flock->fl_type = F_RDLCK; flock->fl_type = F_RDLCK;
if (rc != 0) if (rc != 0)
cERROR(1, "Error unlocking previously locked " cifs_dbg(VFS, "Error unlocking previously locked range %d during test of lock\n",
"range %d during test of lock", rc); rc);
} else } else
flock->fl_type = F_WRLCK; flock->fl_type = F_WRLCK;
@ -1508,8 +1503,8 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
if (!CIFS_I(inode)->clientCanCacheAll && if (!CIFS_I(inode)->clientCanCacheAll &&
CIFS_I(inode)->clientCanCacheRead) { CIFS_I(inode)->clientCanCacheRead) {
cifs_invalidate_mapping(inode); cifs_invalidate_mapping(inode);
cFYI(1, "Set no oplock for inode=%p due to mand locks", cifs_dbg(FYI, "Set no oplock for inode=%p due to mand locks\n",
inode); inode);
CIFS_I(inode)->clientCanCacheRead = false; CIFS_I(inode)->clientCanCacheRead = false;
} }
@ -1546,9 +1541,9 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
rc = -EACCES; rc = -EACCES;
xid = get_xid(); xid = get_xid();
cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld " cifs_dbg(FYI, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld end: %lld\n",
"end: %lld", cmd, flock->fl_flags, flock->fl_type, cmd, flock->fl_flags, flock->fl_type,
flock->fl_start, flock->fl_end); flock->fl_start, flock->fl_end);
cfile = (struct cifsFileInfo *)file->private_data; cfile = (struct cifsFileInfo *)file->private_data;
tcon = tlink_tcon(cfile->tlink); tcon = tlink_tcon(cfile->tlink);
@ -1620,8 +1615,8 @@ cifs_write(struct cifsFileInfo *open_file, __u32 pid, const char *write_data,
cifs_sb = CIFS_SB(dentry->d_sb); cifs_sb = CIFS_SB(dentry->d_sb);
cFYI(1, "write %zd bytes to offset %lld of %s", write_size, cifs_dbg(FYI, "write %zd bytes to offset %lld of %s\n",
*offset, dentry->d_name.name); write_size, *offset, dentry->d_name.name);
tcon = tlink_tcon(open_file->tlink); tcon = tlink_tcon(open_file->tlink);
server = tcon->ses->server; server = tcon->ses->server;
@ -1736,7 +1731,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"); cifs_dbg(VFS, "Null inode passed to cifs_writeable_file\n");
dump_stack(); dump_stack();
return NULL; return NULL;
} }
@ -1848,7 +1843,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"); cifs_dbg(FYI, "No writeable filehandles for inode\n");
rc = -EIO; rc = -EIO;
} }
@ -2015,7 +2010,7 @@ retry:
wdata->cfile = find_writable_file(CIFS_I(mapping->host), wdata->cfile = find_writable_file(CIFS_I(mapping->host),
false); false);
if (!wdata->cfile) { if (!wdata->cfile) {
cERROR(1, "No writable handles for inode"); cifs_dbg(VFS, "No writable handles for inode\n");
rc = -EBADF; rc = -EBADF;
break; break;
} }
@ -2076,7 +2071,7 @@ cifs_writepage_locked(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"); cifs_dbg(FYI, "ppw - page not up to date\n");
/* /*
* Set the "writeback" flag, and clear "dirty" in the radix tree. * Set the "writeback" flag, and clear "dirty" in the radix tree.
@ -2127,7 +2122,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
else else
pid = current->tgid; pid = current->tgid;
cFYI(1, "write_end for page %p from pos %lld with %d bytes", cifs_dbg(FYI, "write_end for page %p from pos %lld with %d bytes\n",
page, pos, copied); page, pos, copied);
if (PageChecked(page)) { if (PageChecked(page)) {
@ -2191,13 +2186,13 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
xid = get_xid(); xid = get_xid();
cFYI(1, "Sync file - name: %s datasync: 0x%x", cifs_dbg(FYI, "Sync file - name: %s datasync: 0x%x\n",
file->f_path.dentry->d_name.name, datasync); file->f_path.dentry->d_name.name, datasync);
if (!CIFS_I(inode)->clientCanCacheRead) { if (!CIFS_I(inode)->clientCanCacheRead) {
rc = cifs_invalidate_mapping(inode); rc = cifs_invalidate_mapping(inode);
if (rc) { if (rc) {
cFYI(1, "rc: %d during invalidate phase", rc); cifs_dbg(FYI, "rc: %d during invalidate phase\n", rc);
rc = 0; /* don't care about it in fsync */ rc = 0; /* don't care about it in fsync */
} }
} }
@ -2233,8 +2228,8 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
xid = get_xid(); xid = get_xid();
cFYI(1, "Sync file - name: %s datasync: 0x%x", cifs_dbg(FYI, "Sync file - name: %s datasync: 0x%x\n",
file->f_path.dentry->d_name.name, datasync); file->f_path.dentry->d_name.name, datasync);
tcon = tlink_tcon(smbfile->tlink); tcon = tlink_tcon(smbfile->tlink);
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) { if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) {
@ -2262,7 +2257,7 @@ int cifs_flush(struct file *file, fl_owner_t id)
if (file->f_mode & FMODE_WRITE) if (file->f_mode & FMODE_WRITE)
rc = filemap_write_and_wait(inode->i_mapping); rc = filemap_write_and_wait(inode->i_mapping);
cFYI(1, "Flush inode %p file %p rc %d", inode, file, rc); cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
return rc; return rc;
} }
@ -2579,8 +2574,8 @@ cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov,
* an old data. * an old data.
*/ */
cifs_invalidate_mapping(inode); cifs_invalidate_mapping(inode);
cFYI(1, "Set no oplock for inode=%p after a write operation", cifs_dbg(FYI, "Set no oplock for inode=%p after a write operation\n",
inode); inode);
cinode->clientCanCacheRead = false; cinode->clientCanCacheRead = false;
} }
return written; return written;
@ -2756,15 +2751,15 @@ cifs_uncached_read_into_pages(struct TCP_Server_Info *server,
/* enough data to fill the page */ /* enough data to fill the page */
iov.iov_base = kmap(page); iov.iov_base = kmap(page);
iov.iov_len = PAGE_SIZE; iov.iov_len = PAGE_SIZE;
cFYI(1, "%u: iov_base=%p iov_len=%zu", cifs_dbg(FYI, "%u: iov_base=%p iov_len=%zu\n",
i, iov.iov_base, iov.iov_len); i, iov.iov_base, iov.iov_len);
len -= PAGE_SIZE; len -= PAGE_SIZE;
} else if (len > 0) { } else if (len > 0) {
/* enough for partial page, fill and zero the rest */ /* enough for partial page, fill and zero the rest */
iov.iov_base = kmap(page); iov.iov_base = kmap(page);
iov.iov_len = len; iov.iov_len = len;
cFYI(1, "%u: iov_base=%p iov_len=%zu", cifs_dbg(FYI, "%u: iov_base=%p iov_len=%zu\n",
i, iov.iov_base, iov.iov_len); i, iov.iov_base, iov.iov_len);
memset(iov.iov_base + len, '\0', PAGE_SIZE - len); memset(iov.iov_base + len, '\0', PAGE_SIZE - len);
rdata->tailsz = len; rdata->tailsz = len;
len = 0; len = 0;
@ -2824,7 +2819,7 @@ cifs_iovec_read(struct file *file, const struct iovec *iov,
pid = current->tgid; pid = current->tgid;
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"); cifs_dbg(FYI, "attempting read on write only file instance\n");
do { do {
cur_len = min_t(const size_t, len - total_read, cifs_sb->rsize); cur_len = min_t(const size_t, len - total_read, cifs_sb->rsize);
@ -3003,7 +2998,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
pid = current->tgid; pid = current->tgid;
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"); cifs_dbg(FYI, "attempting read on write only file instance\n");
for (total_read = 0, cur_offset = read_data; read_size > total_read; for (total_read = 0, cur_offset = read_data; read_size > total_read;
total_read += bytes_read, cur_offset += bytes_read) { total_read += bytes_read, cur_offset += bytes_read) {
@ -3094,7 +3089,8 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
xid = get_xid(); xid = get_xid();
rc = cifs_revalidate_file(file); rc = cifs_revalidate_file(file);
if (rc) { if (rc) {
cFYI(1, "Validation prior to mmap failed, error=%d", rc); cifs_dbg(FYI, "Validation prior to mmap failed, error=%d\n",
rc);
free_xid(xid); free_xid(xid);
return rc; return rc;
} }
@ -3147,7 +3143,7 @@ cifs_readpages_read_into_pages(struct TCP_Server_Info *server,
/* determine the eof that the server (probably) has */ /* determine the eof that the server (probably) has */
eof = CIFS_I(rdata->mapping->host)->server_eof; eof = CIFS_I(rdata->mapping->host)->server_eof;
eof_index = eof ? (eof - 1) >> PAGE_CACHE_SHIFT : 0; eof_index = eof ? (eof - 1) >> PAGE_CACHE_SHIFT : 0;
cFYI(1, "eof=%llu eof_index=%lu", eof, eof_index); cifs_dbg(FYI, "eof=%llu eof_index=%lu\n", eof, eof_index);
rdata->tailsz = PAGE_CACHE_SIZE; rdata->tailsz = PAGE_CACHE_SIZE;
for (i = 0; i < nr_pages; i++) { for (i = 0; i < nr_pages; i++) {
@ -3157,15 +3153,15 @@ cifs_readpages_read_into_pages(struct TCP_Server_Info *server,
/* enough data to fill the page */ /* enough data to fill the page */
iov.iov_base = kmap(page); iov.iov_base = kmap(page);
iov.iov_len = PAGE_CACHE_SIZE; iov.iov_len = PAGE_CACHE_SIZE;
cFYI(1, "%u: idx=%lu iov_base=%p iov_len=%zu", cifs_dbg(FYI, "%u: idx=%lu iov_base=%p iov_len=%zu\n",
i, page->index, iov.iov_base, iov.iov_len); i, page->index, iov.iov_base, iov.iov_len);
len -= PAGE_CACHE_SIZE; len -= PAGE_CACHE_SIZE;
} else if (len > 0) { } else if (len > 0) {
/* enough for partial page, fill and zero the rest */ /* enough for partial page, fill and zero the rest */
iov.iov_base = kmap(page); iov.iov_base = kmap(page);
iov.iov_len = len; iov.iov_len = len;
cFYI(1, "%u: idx=%lu iov_base=%p iov_len=%zu", cifs_dbg(FYI, "%u: idx=%lu iov_base=%p iov_len=%zu\n",
i, page->index, iov.iov_base, iov.iov_len); i, page->index, iov.iov_base, iov.iov_len);
memset(iov.iov_base + len, memset(iov.iov_base + len,
'\0', PAGE_CACHE_SIZE - len); '\0', PAGE_CACHE_SIZE - len);
rdata->tailsz = len; rdata->tailsz = len;
@ -3245,8 +3241,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
rc = 0; rc = 0;
INIT_LIST_HEAD(&tmplist); INIT_LIST_HEAD(&tmplist);
cFYI(1, "%s: file=%p mapping=%p num_pages=%u", __func__, file, cifs_dbg(FYI, "%s: file=%p mapping=%p num_pages=%u\n",
mapping, num_pages); __func__, file, mapping, num_pages);
/* /*
* Start with the page at end of list and move it to private * Start with the page at end of list and move it to private
@ -3376,7 +3372,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
if (rc < 0) if (rc < 0)
goto io_error; goto io_error;
else else
cFYI(1, "Bytes read %d", rc); cifs_dbg(FYI, "Bytes read %d\n", rc);
file_inode(file)->i_atime = file_inode(file)->i_atime =
current_fs_time(file_inode(file)->i_sb); current_fs_time(file_inode(file)->i_sb);
@ -3414,7 +3410,7 @@ static int cifs_readpage(struct file *file, struct page *page)
return rc; return rc;
} }
cFYI(1, "readpage %p at offset %d 0x%x", cifs_dbg(FYI, "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);
@ -3481,7 +3477,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); cifs_dbg(FYI, "write_begin from %lld len %d\n", (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) {
@ -3570,7 +3566,7 @@ static int cifs_launder_page(struct page *page)
.range_end = range_end, .range_end = range_end,
}; };
cFYI(1, "Launder page: %p", page); cifs_dbg(FYI, "Launder page: %p\n", page);
if (clear_page_dirty_for_io(page)) if (clear_page_dirty_for_io(page))
rc = cifs_writepage_locked(page, &wbc); rc = cifs_writepage_locked(page, &wbc);
@ -3590,8 +3586,8 @@ void cifs_oplock_break(struct work_struct *work)
if (!cinode->clientCanCacheAll && cinode->clientCanCacheRead && if (!cinode->clientCanCacheAll && cinode->clientCanCacheRead &&
cifs_has_mand_locks(cinode)) { cifs_has_mand_locks(cinode)) {
cFYI(1, "Reset oplock to None for inode=%p due to mand locks", cifs_dbg(FYI, "Reset oplock to None for inode=%p due to mand locks\n",
inode); inode);
cinode->clientCanCacheRead = false; cinode->clientCanCacheRead = false;
} }
@ -3606,12 +3602,12 @@ void cifs_oplock_break(struct work_struct *work)
mapping_set_error(inode->i_mapping, rc); mapping_set_error(inode->i_mapping, rc);
cifs_invalidate_mapping(inode); cifs_invalidate_mapping(inode);
} }
cFYI(1, "Oplock flush inode %p rc %d", inode, rc); cifs_dbg(FYI, "Oplock flush inode %p rc %d\n", inode, rc);
} }
rc = cifs_push_locks(cfile); rc = cifs_push_locks(cfile);
if (rc) if (rc)
cERROR(1, "Push locks rc = %d", rc); cifs_dbg(VFS, "Push locks rc = %d\n", rc);
/* /*
* releasing stale oplock after recent reconnect of smb session using * releasing stale oplock after recent reconnect of smb session using
@ -3622,7 +3618,7 @@ void cifs_oplock_break(struct work_struct *work)
if (!cfile->oplock_break_cancelled) { if (!cfile->oplock_break_cancelled) {
rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid, rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid,
cinode); cinode);
cFYI(1, "Oplock release rc = %d", rc); cifs_dbg(FYI, "Oplock release rc = %d\n", rc);
} }
} }

Просмотреть файл

@ -28,14 +28,14 @@ void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server)
server->fscache = server->fscache =
fscache_acquire_cookie(cifs_fscache_netfs.primary_index, fscache_acquire_cookie(cifs_fscache_netfs.primary_index,
&cifs_fscache_server_index_def, server); &cifs_fscache_server_index_def, server);
cFYI(1, "%s: (0x%p/0x%p)", __func__, server, cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
server->fscache); __func__, server, server->fscache);
} }
void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server)
{ {
cFYI(1, "%s: (0x%p/0x%p)", __func__, server, cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
server->fscache); __func__, server, server->fscache);
fscache_relinquish_cookie(server->fscache, 0); fscache_relinquish_cookie(server->fscache, 0);
server->fscache = NULL; server->fscache = NULL;
} }
@ -47,13 +47,13 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
tcon->fscache = tcon->fscache =
fscache_acquire_cookie(server->fscache, fscache_acquire_cookie(server->fscache,
&cifs_fscache_super_index_def, tcon); &cifs_fscache_super_index_def, tcon);
cFYI(1, "%s: (0x%p/0x%p)", __func__, server->fscache, cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
tcon->fscache); __func__, server->fscache, tcon->fscache);
} }
void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon)
{ {
cFYI(1, "%s: (0x%p)", __func__, tcon->fscache); cifs_dbg(FYI, "%s: (0x%p)\n", __func__, tcon->fscache);
fscache_relinquish_cookie(tcon->fscache, 0); fscache_relinquish_cookie(tcon->fscache, 0);
tcon->fscache = NULL; tcon->fscache = NULL;
} }
@ -70,8 +70,8 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode)
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) {
cifsi->fscache = fscache_acquire_cookie(tcon->fscache, cifsi->fscache = fscache_acquire_cookie(tcon->fscache,
&cifs_fscache_inode_object_def, cifsi); &cifs_fscache_inode_object_def, cifsi);
cFYI(1, "%s: got FH cookie (0x%p/0x%p)", __func__, cifs_dbg(FYI, "%s: got FH cookie (0x%p/0x%p)\n",
tcon->fscache, cifsi->fscache); __func__, tcon->fscache, cifsi->fscache);
} }
} }
@ -80,7 +80,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode)
struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsInodeInfo *cifsi = CIFS_I(inode);
if (cifsi->fscache) { if (cifsi->fscache) {
cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache);
fscache_relinquish_cookie(cifsi->fscache, 0); fscache_relinquish_cookie(cifsi->fscache, 0);
cifsi->fscache = NULL; cifsi->fscache = NULL;
} }
@ -91,7 +91,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode)
struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsInodeInfo *cifsi = CIFS_I(inode);
if (cifsi->fscache) { if (cifsi->fscache) {
cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache);
fscache_uncache_all_inode_pages(cifsi->fscache, inode); fscache_uncache_all_inode_pages(cifsi->fscache, inode);
fscache_relinquish_cookie(cifsi->fscache, 1); fscache_relinquish_cookie(cifsi->fscache, 1);
cifsi->fscache = NULL; cifsi->fscache = NULL;
@ -120,8 +120,8 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode)
cifs_sb_master_tcon(cifs_sb)->fscache, cifs_sb_master_tcon(cifs_sb)->fscache,
&cifs_fscache_inode_object_def, &cifs_fscache_inode_object_def,
cifsi); cifsi);
cFYI(1, "%s: new cookie 0x%p oldcookie 0x%p", cifs_dbg(FYI, "%s: new cookie 0x%p oldcookie 0x%p\n",
__func__, cifsi->fscache, old); __func__, cifsi->fscache, old);
} }
} }
@ -131,8 +131,8 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsInodeInfo *cifsi = CIFS_I(inode);
cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cifs_dbg(FYI, "%s: (0x%p/0x%p)\n",
cifsi->fscache); __func__, page, cifsi->fscache);
if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) if (!fscache_maybe_release_page(cifsi->fscache, page, gfp))
return 0; return 0;
} }
@ -143,7 +143,7 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx,
int error) int error)
{ {
cFYI(1, "%s: (0x%p/%d)", __func__, page, error); cifs_dbg(FYI, "%s: (0x%p/%d)\n", __func__, page, error);
if (!error) if (!error)
SetPageUptodate(page); SetPageUptodate(page);
unlock_page(page); unlock_page(page);
@ -156,8 +156,8 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
{ {
int ret; int ret;
cFYI(1, "%s: (fsc:%p, p:%p, i:0x%p", __func__, cifs_dbg(FYI, "%s: (fsc:%p, p:%p, i:0x%p\n",
CIFS_I(inode)->fscache, page, inode); __func__, CIFS_I(inode)->fscache, page, inode);
ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page,
cifs_readpage_from_fscache_complete, cifs_readpage_from_fscache_complete,
NULL, NULL,
@ -165,15 +165,15 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
switch (ret) { switch (ret) {
case 0: /* page found in fscache, read submitted */ case 0: /* page found in fscache, read submitted */
cFYI(1, "%s: submitted", __func__); cifs_dbg(FYI, "%s: submitted\n", __func__);
return ret; return ret;
case -ENOBUFS: /* page won't be cached */ case -ENOBUFS: /* page won't be cached */
case -ENODATA: /* page not in cache */ case -ENODATA: /* page not in cache */
cFYI(1, "%s: %d", __func__, ret); cifs_dbg(FYI, "%s: %d\n", __func__, ret);
return 1; return 1;
default: default:
cERROR(1, "unknown error ret = %d", ret); cifs_dbg(VFS, "unknown error ret = %d\n", ret);
} }
return ret; return ret;
} }
@ -188,8 +188,8 @@ int __cifs_readpages_from_fscache(struct inode *inode,
{ {
int ret; int ret;
cFYI(1, "%s: (0x%p/%u/0x%p)", __func__, cifs_dbg(FYI, "%s: (0x%p/%u/0x%p)\n",
CIFS_I(inode)->fscache, *nr_pages, inode); __func__, CIFS_I(inode)->fscache, *nr_pages, inode);
ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping,
pages, nr_pages, pages, nr_pages,
cifs_readpage_from_fscache_complete, cifs_readpage_from_fscache_complete,
@ -197,16 +197,16 @@ int __cifs_readpages_from_fscache(struct inode *inode,
mapping_gfp_mask(mapping)); mapping_gfp_mask(mapping));
switch (ret) { switch (ret) {
case 0: /* read submitted to the cache for all pages */ case 0: /* read submitted to the cache for all pages */
cFYI(1, "%s: submitted", __func__); cifs_dbg(FYI, "%s: submitted\n", __func__);
return ret; return ret;
case -ENOBUFS: /* some pages are not cached and can't be */ case -ENOBUFS: /* some pages are not cached and can't be */
case -ENODATA: /* some pages are not cached */ case -ENODATA: /* some pages are not cached */
cFYI(1, "%s: no page", __func__); cifs_dbg(FYI, "%s: no page\n", __func__);
return 1; return 1;
default: default:
cFYI(1, "unknown error ret = %d", ret); cifs_dbg(FYI, "unknown error ret = %d\n", ret);
} }
return ret; return ret;
@ -216,8 +216,8 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
{ {
int ret; int ret;
cFYI(1, "%s: (fsc: %p, p: %p, i: %p)", __func__, cifs_dbg(FYI, "%s: (fsc: %p, p: %p, i: %p)\n",
CIFS_I(inode)->fscache, page, inode); __func__, CIFS_I(inode)->fscache, page, inode);
ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL);
if (ret != 0) if (ret != 0)
fscache_uncache_page(CIFS_I(inode)->fscache, page); fscache_uncache_page(CIFS_I(inode)->fscache, page);
@ -228,7 +228,7 @@ void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode)
struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifsInodeInfo *cifsi = CIFS_I(inode);
struct fscache_cookie *cookie = cifsi->fscache; struct fscache_cookie *cookie = cifsi->fscache;
cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cookie); cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", __func__, page, cookie);
fscache_wait_on_page_write(cookie, page); fscache_wait_on_page_write(cookie, page);
fscache_uncache_page(cookie, page); fscache_uncache_page(cookie, page);
} }

Просмотреть файл

@ -91,30 +91,32 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr)
{ {
struct cifsInodeInfo *cifs_i = CIFS_I(inode); struct cifsInodeInfo *cifs_i = CIFS_I(inode);
cFYI(1, "%s: revalidating inode %llu", __func__, cifs_i->uniqueid); cifs_dbg(FYI, "%s: revalidating inode %llu\n",
__func__, cifs_i->uniqueid);
if (inode->i_state & I_NEW) { if (inode->i_state & I_NEW) {
cFYI(1, "%s: inode %llu is new", __func__, cifs_i->uniqueid); cifs_dbg(FYI, "%s: inode %llu is new\n",
__func__, cifs_i->uniqueid);
return; return;
} }
/* don't bother with revalidation if we have an oplock */ /* don't bother with revalidation if we have an oplock */
if (cifs_i->clientCanCacheRead) { if (cifs_i->clientCanCacheRead) {
cFYI(1, "%s: inode %llu is oplocked", __func__, cifs_dbg(FYI, "%s: inode %llu is oplocked\n",
cifs_i->uniqueid); __func__, cifs_i->uniqueid);
return; return;
} }
/* revalidate if mtime or size have changed */ /* revalidate if mtime or size have changed */
if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) && if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) &&
cifs_i->server_eof == fattr->cf_eof) { cifs_i->server_eof == fattr->cf_eof) {
cFYI(1, "%s: inode %llu is unchanged", __func__, cifs_dbg(FYI, "%s: inode %llu is unchanged\n",
cifs_i->uniqueid); __func__, cifs_i->uniqueid);
return; return;
} }
cFYI(1, "%s: invalidating inode %llu mapping", __func__, cifs_dbg(FYI, "%s: invalidating inode %llu mapping\n",
cifs_i->uniqueid); __func__, cifs_i->uniqueid);
cifs_i->invalid_mapping = true; cifs_i->invalid_mapping = true;
} }
@ -240,7 +242,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)); cifs_dbg(FYI, "unknown type %d\n", le32_to_cpu(info->Type));
break; break;
} }
@ -279,7 +281,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"); cifs_dbg(FYI, "creating fake fattr for DFS referral\n");
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;
@ -329,7 +331,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
cFYI(1, "Getting info on %s", full_path); cifs_dbg(FYI, "Getting info on %s\n", full_path);
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) if (IS_ERR(tlink))
@ -355,7 +357,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) {
int tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid); int tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid);
if (tmprc) if (tmprc)
cFYI(1, "CIFSCheckMFSymlink: %d", tmprc); cifs_dbg(FYI, "CIFSCheckMFSymlink: %d\n", tmprc);
} }
if (*pinode == NULL) { if (*pinode == NULL) {
@ -422,7 +424,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
&buf_type); &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"); cifs_dbg(FYI, "Block device\n");
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) {
@ -434,7 +436,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"); cifs_dbg(FYI, "Char device\n");
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) {
@ -446,7 +448,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"); cifs_dbg(FYI, "Symlink\n");
fattr->cf_mode |= S_IFLNK; fattr->cf_mode |= S_IFLNK;
fattr->cf_dtype = DT_LNK; fattr->cf_dtype = DT_LNK;
} else { } else {
@ -497,10 +499,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, cifs_dbg(FYI, "special bits 0%o org mode 0%o\n",
fattr->cf_mode); 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); cifs_dbg(FYI, "special mode bits 0%o\n", mode);
} }
return 0; return 0;
@ -635,11 +637,11 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
tcon = tlink_tcon(tlink); tcon = tlink_tcon(tlink);
server = tcon->ses->server; server = tcon->ses->server;
cFYI(1, "Getting info on %s", full_path); cifs_dbg(FYI, "Getting info on %s\n", full_path);
if ((data == NULL) && (*inode != NULL)) { if ((data == NULL) && (*inode != NULL)) {
if (CIFS_I(*inode)->clientCanCacheRead) { if (CIFS_I(*inode)->clientCanCacheRead) {
cFYI(1, "No need to revalidate cached inode sizes"); cifs_dbg(FYI, "No need to revalidate cached inode sizes\n");
goto cgii_exit; goto cgii_exit;
} }
} }
@ -714,7 +716,8 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
tcon, cifs_sb, full_path, tcon, cifs_sb, full_path,
&fattr.cf_uniqueid, data); &fattr.cf_uniqueid, data);
if (tmprc) { if (tmprc) {
cFYI(1, "GetSrvInodeNum rc %d", tmprc); cifs_dbg(FYI, "GetSrvInodeNum rc %d\n",
tmprc);
fattr.cf_uniqueid = iunique(sb, ROOT_I); fattr.cf_uniqueid = iunique(sb, ROOT_I);
cifs_autodisable_serverino(cifs_sb); cifs_autodisable_serverino(cifs_sb);
} }
@ -729,7 +732,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
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); cifs_dbg(FYI, "cifs_sfu_type failed: %d\n", tmprc);
} }
#ifdef CONFIG_CIFS_ACL #ifdef CONFIG_CIFS_ACL
@ -737,8 +740,8 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, full_path, fid); rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, full_path, fid);
if (rc) { if (rc) {
cFYI(1, "%s: Getting ACL failed with error: %d", cifs_dbg(FYI, "%s: Getting ACL failed with error: %d\n",
__func__, rc); __func__, rc);
goto cgii_exit; goto cgii_exit;
} }
} }
@ -752,7 +755,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) {
tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid); tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid);
if (tmprc) if (tmprc)
cFYI(1, "CIFSCheckMFSymlink: %d", tmprc); cifs_dbg(FYI, "CIFSCheckMFSymlink: %d\n", tmprc);
} }
if (!*inode) { if (!*inode) {
@ -836,7 +839,7 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
struct inode *inode; struct inode *inode;
retry_iget5_locked: retry_iget5_locked:
cFYI(1, "looking for uniqueid=%llu", fattr->cf_uniqueid); cifs_dbg(FYI, "looking for uniqueid=%llu\n", 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);
@ -899,7 +902,7 @@ struct inode *cifs_root_iget(struct super_block *sb)
#endif #endif
if (rc && tcon->ipc) { if (rc && tcon->ipc) {
cFYI(1, "ipc connection - fake read inode"); cifs_dbg(FYI, "ipc connection - fake read inode\n");
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
inode->i_mode |= S_IFDIR; inode->i_mode |= S_IFDIR;
set_nlink(inode, 2); set_nlink(inode, 2);
@ -958,7 +961,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned 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"); cifs_dbg(FYI, "CIFS - CTIME changed\n");
info_buf.ChangeTime = info_buf.ChangeTime =
cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime)); cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime));
} else } else
@ -1127,7 +1130,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); cifs_dbg(FYI, "cifs_unlink, dir=0x%p, dentry=0x%p\n", dir, dentry);
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) if (IS_ERR(tlink))
@ -1150,7 +1153,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); cifs_dbg(FYI, "posix del rc %d\n", rc);
if ((rc == 0) || (rc == -ENOENT)) if ((rc == 0) || (rc == -ENOENT))
goto psx_del_no_retry; goto psx_del_no_retry;
} }
@ -1320,7 +1323,7 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode,
if (rc == -EOPNOTSUPP) if (rc == -EOPNOTSUPP)
goto posix_mkdir_out; goto posix_mkdir_out;
else if (rc) { else if (rc) {
cFYI(1, "posix mkdir returned 0x%x", rc); cifs_dbg(FYI, "posix mkdir returned 0x%x\n", rc);
d_drop(dentry); d_drop(dentry);
goto posix_mkdir_out; goto posix_mkdir_out;
} }
@ -1342,11 +1345,12 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode,
d_instantiate(dentry, newinode); d_instantiate(dentry, newinode);
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
cFYI(1, "instantiated dentry %p %s to inode %p", dentry, cifs_dbg(FYI, "instantiated dentry %p %s to inode %p\n",
dentry->d_name.name, newinode); dentry, dentry->d_name.name, newinode);
if (newinode->i_nlink != 2) if (newinode->i_nlink != 2)
cFYI(1, "unexpected number of links %d", newinode->i_nlink); cifs_dbg(FYI, "unexpected number of links %d\n",
newinode->i_nlink);
#endif #endif
posix_mkdir_out: posix_mkdir_out:
@ -1368,7 +1372,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
char *full_path; char *full_path;
cFYI(1, "In cifs_mkdir, mode = 0x%hx inode = 0x%p", mode, inode); cifs_dbg(FYI, "In cifs_mkdir, mode = 0x%hx inode = 0x%p\n",
mode, inode);
cifs_sb = CIFS_SB(inode->i_sb); cifs_sb = CIFS_SB(inode->i_sb);
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
@ -1402,7 +1407,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
/* BB add setting the equivalent of mode via CreateX w/ACLs */ /* BB add setting the equivalent of mode via CreateX w/ACLs */
rc = server->ops->mkdir(xid, tcon, full_path, cifs_sb); rc = server->ops->mkdir(xid, tcon, full_path, cifs_sb);
if (rc) { if (rc) {
cFYI(1, "cifs_mkdir returned 0x%x", rc); cifs_dbg(FYI, "cifs_mkdir returned 0x%x\n", rc);
d_drop(direntry); d_drop(direntry);
goto mkdir_out; goto mkdir_out;
} }
@ -1432,7 +1437,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); cifs_dbg(FYI, "cifs_rmdir, inode = 0x%p\n", inode);
xid = get_xid(); xid = get_xid();
@ -1681,8 +1686,8 @@ cifs_invalidate_mapping(struct inode *inode)
if (inode->i_mapping && inode->i_mapping->nrpages != 0) { if (inode->i_mapping && inode->i_mapping->nrpages != 0) {
rc = invalidate_inode_pages2(inode->i_mapping); rc = invalidate_inode_pages2(inode->i_mapping);
if (rc) { if (rc) {
cERROR(1, "%s: could not invalidate inode %p", __func__, cifs_dbg(VFS, "%s: could not invalidate inode %p\n",
inode); __func__, inode);
cifs_i->invalid_mapping = true; cifs_i->invalid_mapping = true;
} }
} }
@ -1732,8 +1737,8 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
goto out; goto out;
} }
cFYI(1, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time " cifs_dbg(FYI, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time %ld jiffies %ld\n",
"%ld jiffies %ld", full_path, inode, inode->i_count.counter, full_path, inode, inode->i_count.counter,
dentry, dentry->d_time, jiffies); dentry, dentry->d_time, jiffies);
if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext) if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext)
@ -1883,7 +1888,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
else else
rc = -ENOSYS; rc = -ENOSYS;
cifsFileInfo_put(open_file); cifsFileInfo_put(open_file);
cFYI(1, "SetFSize for attrs rc = %d", rc); cifs_dbg(FYI, "SetFSize for attrs rc = %d\n", rc);
if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
unsigned int bytes_written; unsigned int bytes_written;
@ -1894,7 +1899,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
io_parms.length = attrs->ia_size; io_parms.length = attrs->ia_size;
rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, rc = CIFSSMBWrite(xid, &io_parms, &bytes_written,
NULL, NULL, 1); NULL, NULL, 1);
cFYI(1, "Wrt seteof rc %d", rc); cifs_dbg(FYI, "Wrt seteof rc %d\n", rc);
} }
} else } else
rc = -EINVAL; rc = -EINVAL;
@ -1920,7 +1925,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
attrs->ia_size, cifs_sb, false); attrs->ia_size, cifs_sb, false);
else else
rc = -ENOSYS; rc = -ENOSYS;
cFYI(1, "SetEOF by path (setattrs) rc = %d", rc); cifs_dbg(FYI, "SetEOF by path (setattrs) rc = %d\n", rc);
if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
__u16 netfid; __u16 netfid;
int oplock = 0; int oplock = 0;
@ -1940,7 +1945,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
io_parms.length = attrs->ia_size; io_parms.length = attrs->ia_size;
rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, NULL, rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, NULL,
NULL, 1); NULL, 1);
cFYI(1, "wrt seteof rc %d", rc); cifs_dbg(FYI, "wrt seteof rc %d\n", rc);
CIFSSMBClose(xid, tcon, netfid); CIFSSMBClose(xid, tcon, netfid);
} }
} }
@ -1971,7 +1976,7 @@ 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", cifs_dbg(FYI, "setattr_unix on file %s attrs->ia_valid=0x%x\n",
direntry->d_name.name, attrs->ia_valid); direntry->d_name.name, attrs->ia_valid);
xid = get_xid(); xid = get_xid();
@ -2114,7 +2119,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
xid = get_xid(); xid = get_xid();
cFYI(1, "setattr on file %s attrs->iavalid 0x%x", cifs_dbg(FYI, "setattr on file %s attrs->iavalid 0x%x\n",
direntry->d_name.name, attrs->ia_valid); direntry->d_name.name, attrs->ia_valid);
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
@ -2166,8 +2171,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
rc = id_mode_to_cifs_acl(inode, full_path, NO_CHANGE_64, rc = id_mode_to_cifs_acl(inode, full_path, NO_CHANGE_64,
uid, gid); uid, gid);
if (rc) { if (rc) {
cFYI(1, "%s: Setting id failed with error: %d", cifs_dbg(FYI, "%s: Setting id failed with error: %d\n",
__func__, rc); __func__, rc);
goto cifs_setattr_exit; goto cifs_setattr_exit;
} }
} }
@ -2188,8 +2193,8 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
rc = id_mode_to_cifs_acl(inode, full_path, mode, rc = id_mode_to_cifs_acl(inode, full_path, mode,
INVALID_UID, INVALID_GID); INVALID_UID, INVALID_GID);
if (rc) { if (rc) {
cFYI(1, "%s: Setting ACL failed with error: %d", cifs_dbg(FYI, "%s: Setting ACL failed with error: %d\n",
__func__, rc); __func__, rc);
goto cifs_setattr_exit; goto cifs_setattr_exit;
} }
} else } else
@ -2277,7 +2282,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); cifs_dbg(FYI, "In cifs_delete_inode, inode = 0x%p\n", 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 */
} }

Просмотреть файл

@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
xid = get_xid(); xid = get_xid();
cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg); cifs_dbg(FYI, "ioctl file %p cmd %u arg %lu\n", filep, command, arg);
cifs_sb = CIFS_SB(inode->i_sb); cifs_sb = CIFS_SB(inode->i_sb);
@ -83,11 +83,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
* &ExtAttrMask); * &ExtAttrMask);
*/ */
} }
cFYI(1, "set flags not implemented yet"); cifs_dbg(FYI, "set flags not implemented yet\n");
break; break;
#endif /* CONFIG_CIFS_POSIX */ #endif /* CONFIG_CIFS_POSIX */
default: default:
cFYI(1, "unsupported ioctl"); cifs_dbg(FYI, "unsupported ioctl\n");
break; break;
} }

Просмотреть файл

@ -56,14 +56,14 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
md5 = crypto_alloc_shash("md5", 0, 0); md5 = crypto_alloc_shash("md5", 0, 0);
if (IS_ERR(md5)) { if (IS_ERR(md5)) {
rc = PTR_ERR(md5); rc = PTR_ERR(md5);
cERROR(1, "%s: Crypto md5 allocation error %d", __func__, rc); cifs_dbg(VFS, "%s: Crypto md5 allocation error %d\n",
__func__, rc);
return rc; return rc;
} }
size = sizeof(struct shash_desc) + crypto_shash_descsize(md5); size = sizeof(struct shash_desc) + crypto_shash_descsize(md5);
sdescmd5 = kmalloc(size, GFP_KERNEL); sdescmd5 = kmalloc(size, GFP_KERNEL);
if (!sdescmd5) { if (!sdescmd5) {
rc = -ENOMEM; rc = -ENOMEM;
cERROR(1, "%s: Memory allocation failure", __func__);
goto symlink_hash_err; goto symlink_hash_err;
} }
sdescmd5->shash.tfm = md5; sdescmd5->shash.tfm = md5;
@ -71,17 +71,17 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
rc = crypto_shash_init(&sdescmd5->shash); rc = crypto_shash_init(&sdescmd5->shash);
if (rc) { if (rc) {
cERROR(1, "%s: Could not init md5 shash", __func__); cifs_dbg(VFS, "%s: Could not init md5 shash\n", __func__);
goto symlink_hash_err; goto symlink_hash_err;
} }
rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len); rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with link_str", __func__); cifs_dbg(VFS, "%s: Could not update with link_str\n", __func__);
goto symlink_hash_err; goto symlink_hash_err;
} }
rc = crypto_shash_final(&sdescmd5->shash, md5_hash); rc = crypto_shash_final(&sdescmd5->shash, md5_hash);
if (rc) if (rc)
cERROR(1, "%s: Could not generate md5 hash", __func__); cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
symlink_hash_err: symlink_hash_err:
crypto_free_shash(md5); crypto_free_shash(md5);
@ -115,7 +115,7 @@ CIFSParseMFSymlink(const u8 *buf,
rc = symlink_hash(link_len, link_str, md5_hash); rc = symlink_hash(link_len, link_str, md5_hash);
if (rc) { if (rc) {
cFYI(1, "%s: MD5 hash failure: %d", __func__, rc); cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
return rc; return rc;
} }
@ -154,7 +154,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str)
rc = symlink_hash(link_len, link_str, md5_hash); rc = symlink_hash(link_len, link_str, md5_hash);
if (rc) { if (rc) {
cFYI(1, "%s: MD5 hash failure: %d", __func__, rc); cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
return rc; return rc;
} }
@ -521,7 +521,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
if (!full_path) if (!full_path)
goto out; goto out;
cFYI(1, "Full path: %s inode = 0x%p", full_path, inode); cifs_dbg(FYI, "Full path: %s inode = 0x%p\n", full_path, inode);
rc = -EACCES; rc = -EACCES;
/* /*
@ -578,8 +578,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
goto symlink_exit; goto symlink_exit;
} }
cFYI(1, "Full path: %s", full_path); cifs_dbg(FYI, "Full path: %s\n", full_path);
cFYI(1, "symname is %s", symname); cifs_dbg(FYI, "symname is %s\n", symname);
/* BB what if DFS and this volume is on different share? BB */ /* BB what if DFS and this volume is on different share? BB */
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS)
@ -601,8 +601,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
inode->i_sb, xid, NULL); inode->i_sb, xid, NULL);
if (rc != 0) { if (rc != 0) {
cFYI(1, "Create symlink ok, getinodeinfo fail rc = %d", cifs_dbg(FYI, "Create symlink ok, getinodeinfo fail rc = %d\n",
rc); rc);
} else { } else {
d_instantiate(direntry, newinode); d_instantiate(direntry, newinode);
} }

Просмотреть файл

@ -54,7 +54,7 @@ _get_xid(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"); cifs_dbg(FYI, "warning: more than 65000 requests active\n");
xid = GlobalCurrentXid++; xid = GlobalCurrentXid++;
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
return xid; return xid;
@ -91,7 +91,7 @@ void
sesInfoFree(struct cifs_ses *buf_to_free) sesInfoFree(struct cifs_ses *buf_to_free)
{ {
if (buf_to_free == NULL) { if (buf_to_free == NULL) {
cFYI(1, "Null buffer passed to sesInfoFree"); cifs_dbg(FYI, "Null buffer passed to sesInfoFree\n");
return; return;
} }
@ -130,7 +130,7 @@ void
tconInfoFree(struct cifs_tcon *buf_to_free) tconInfoFree(struct cifs_tcon *buf_to_free)
{ {
if (buf_to_free == NULL) { if (buf_to_free == NULL) {
cFYI(1, "Null buffer passed to tconInfoFree"); cifs_dbg(FYI, "Null buffer passed to tconInfoFree\n");
return; return;
} }
atomic_dec(&tconInfoAllocCount); atomic_dec(&tconInfoAllocCount);
@ -180,7 +180,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");*/ /* cifs_dbg(FYI, "Null buffer passed to cifs_buf_release\n");*/
return; return;
} }
mempool_free(buf_to_free, cifs_req_poolp); mempool_free(buf_to_free, cifs_req_poolp);
@ -216,7 +216,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"); cifs_dbg(FYI, "Null buffer passed to cifs_small_buf_release\n");
return; return;
} }
mempool_free(buf_to_free, cifs_sm_req_poolp); mempool_free(buf_to_free, cifs_sm_req_poolp);
@ -282,15 +282,15 @@ check_smb_hdr(struct smb_hdr *smb, __u16 mid)
{ {
/* does it have the right SMB "signature" ? */ /* does it have the right SMB "signature" ? */
if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) { if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) {
cERROR(1, "Bad protocol string signature header 0x%x", cifs_dbg(VFS, "Bad protocol string signature header 0x%x\n",
*(unsigned int *)smb->Protocol); *(unsigned int *)smb->Protocol);
return 1; return 1;
} }
/* Make sure that message ids match */ /* Make sure that message ids match */
if (mid != smb->Mid) { if (mid != smb->Mid) {
cERROR(1, "Mids do not match. received=%u expected=%u", cifs_dbg(VFS, "Mids do not match. received=%u expected=%u\n",
smb->Mid, mid); smb->Mid, mid);
return 1; return 1;
} }
@ -302,7 +302,7 @@ check_smb_hdr(struct smb_hdr *smb, __u16 mid)
if (smb->Command == SMB_COM_LOCKING_ANDX) if (smb->Command == SMB_COM_LOCKING_ANDX)
return 0; return 0;
cERROR(1, "Server sent request, not response. mid=%u", smb->Mid); cifs_dbg(VFS, "Server sent request, not response. mid=%u\n", smb->Mid);
return 1; return 1;
} }
@ -313,8 +313,8 @@ checkSMB(char *buf, unsigned int total_read)
__u16 mid = smb->Mid; __u16 mid = smb->Mid;
__u32 rfclen = be32_to_cpu(smb->smb_buf_length); __u32 rfclen = be32_to_cpu(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", cifs_dbg(FYI, "checkSMB Length: 0x%x, smb_buf_length: 0x%x\n",
total_read, rfclen); total_read, rfclen);
/* is this frame too small to even get to a BCC? */ /* is this frame too small to even get to a BCC? */
if (total_read < 2 + sizeof(struct smb_hdr)) { if (total_read < 2 + sizeof(struct smb_hdr)) {
@ -340,9 +340,9 @@ checkSMB(char *buf, unsigned int total_read)
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)"); cifs_dbg(VFS, "rcvd invalid byte count (bcc)\n");
} else { } else {
cERROR(1, "Length less than smb header size"); cifs_dbg(VFS, "Length less than smb header size\n");
} }
return -EIO; return -EIO;
} }
@ -353,8 +353,8 @@ checkSMB(char *buf, unsigned int total_read)
clc_len = smbCalcSize(smb); clc_len = smbCalcSize(smb);
if (4 + rfclen != total_read) { if (4 + rfclen != total_read) {
cERROR(1, "Length read does not match RFC1001 length %d", cifs_dbg(VFS, "Length read does not match RFC1001 length %d\n",
rfclen); rfclen);
return -EIO; return -EIO;
} }
@ -365,12 +365,12 @@ checkSMB(char *buf, unsigned int total_read)
if (((4 + rfclen) & 0xFFFF) == (clc_len & 0xFFFF)) if (((4 + rfclen) & 0xFFFF) == (clc_len & 0xFFFF))
return 0; /* bcc wrapped */ return 0; /* bcc wrapped */
} }
cFYI(1, "Calculated size %u vs length %u mismatch for mid=%u", cifs_dbg(FYI, "Calculated size %u vs length %u mismatch for mid=%u\n",
clc_len, 4 + rfclen, smb->Mid); clc_len, 4 + rfclen, smb->Mid);
if (4 + rfclen < clc_len) { if (4 + rfclen < clc_len) {
cERROR(1, "RFC1001 size %u smaller than SMB for mid=%u", cifs_dbg(VFS, "RFC1001 size %u smaller than SMB for mid=%u\n",
rfclen, smb->Mid); rfclen, smb->Mid);
return -EIO; return -EIO;
} else if (rfclen > clc_len + 512) { } else if (rfclen > clc_len + 512) {
/* /*
@ -382,8 +382,8 @@ checkSMB(char *buf, unsigned int total_read)
* trailing data, we choose limit the amount of extra * trailing data, we choose limit the amount of extra
* data to 512 bytes. * data to 512 bytes.
*/ */
cERROR(1, "RFC1001 size %u more than 512 bytes larger " cifs_dbg(VFS, "RFC1001 size %u more than 512 bytes larger than SMB for mid=%u\n",
"than SMB for mid=%u", rfclen, smb->Mid); rfclen, smb->Mid);
return -EIO; return -EIO;
} }
} }
@ -401,7 +401,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
struct cifsInodeInfo *pCifsInode; struct cifsInodeInfo *pCifsInode;
struct cifsFileInfo *netfile; struct cifsFileInfo *netfile;
cFYI(1, "Checking for oplock break or dnotify response"); cifs_dbg(FYI, "Checking for oplock break or dnotify response\n");
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 =
@ -413,15 +413,15 @@ is_valid_oplock_break(char *buffer, 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", cifs_dbg(FYI, "dnotify on %s Action: 0x%x\n",
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", cifs_dbg(FYI, "notify err 0x%d\n",
pSMBr->hdr.Status.CifsError); pSMBr->hdr.Status.CifsError);
return true; return true;
} }
return false; return false;
@ -435,7 +435,7 @@ is_valid_oplock_break(char *buffer, 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"); cifs_dbg(FYI, "invalid handle on oplock break\n");
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)) {
@ -447,7 +447,7 @@ is_valid_oplock_break(char *buffer, 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", cifs_dbg(FYI, "oplock type 0x%d level 0x%d\n",
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;
@ -469,7 +469,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
if (pSMB->Fid != netfile->fid.netfid) if (pSMB->Fid != netfile->fid.netfid)
continue; continue;
cFYI(1, "file id match, oplock break"); cifs_dbg(FYI, "file id match, oplock break\n");
pCifsInode = CIFS_I(netfile->dentry->d_inode); pCifsInode = CIFS_I(netfile->dentry->d_inode);
cifs_set_oplock_level(pCifsInode, cifs_set_oplock_level(pCifsInode,
@ -484,12 +484,12 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
} }
spin_unlock(&cifs_file_list_lock); spin_unlock(&cifs_file_list_lock);
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
cFYI(1, "No matching file for oplock break"); cifs_dbg(FYI, "No matching file for oplock break\n");
return true; return true;
} }
} }
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
cFYI(1, "Can not process oplock break for non-existent connection"); cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
return true; return true;
} }
@ -536,12 +536,8 @@ 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 " cifs_dbg(VFS, "Autodisabling the use of server inode numbers on %s. This server doesn't seem to support them properly. Hardlinks will not be recognized on this mount. Consider mounting with the \"noserverino\" option to silence this message.\n",
"%s. This server doesn't seem to support them " cifs_sb_master_tcon(cifs_sb)->treeName);
"properly. Hardlinks will not be recognized on this "
"mount. Consider mounting with the \"noserverino\" "
"option to silence this message.",
cifs_sb_master_tcon(cifs_sb)->treeName);
} }
} }
@ -552,13 +548,13 @@ void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock)
if (oplock == OPLOCK_EXCLUSIVE) { if (oplock == OPLOCK_EXCLUSIVE) {
cinode->clientCanCacheAll = true; cinode->clientCanCacheAll = true;
cinode->clientCanCacheRead = true; cinode->clientCanCacheRead = true;
cFYI(1, "Exclusive Oplock granted on inode %p", cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n",
&cinode->vfs_inode); &cinode->vfs_inode);
} else if (oplock == OPLOCK_READ) { } else if (oplock == OPLOCK_READ) {
cinode->clientCanCacheAll = false; cinode->clientCanCacheAll = false;
cinode->clientCanCacheRead = true; cinode->clientCanCacheRead = true;
cFYI(1, "Level II Oplock granted on inode %p", cifs_dbg(FYI, "Level II Oplock granted on inode %p\n",
&cinode->vfs_inode); &cinode->vfs_inode);
} else { } else {
cinode->clientCanCacheAll = false; cinode->clientCanCacheAll = false;
cinode->clientCanCacheRead = false; cinode->clientCanCacheRead = false;

Просмотреть файл

@ -150,8 +150,8 @@ cifs_inet_pton(const int address_family, const char *cp, int len, void *dst)
else if (address_family == AF_INET6) else if (address_family == AF_INET6)
ret = in6_pton(cp, len, dst , '\\', NULL); ret = in6_pton(cp, len, dst , '\\', NULL);
cFYI(DBG2, "address conversion returned %d for %*.*s", cifs_dbg(NOISY, "address conversion returned %d for %*.*s\n",
ret, len, len, cp); ret, len, len, cp);
if (ret > 0) if (ret > 0)
ret = 1; ret = 1;
return ret; return ret;
@ -887,7 +887,7 @@ map_smb_to_linux_error(char *buf, bool logErr)
} }
/* else ERRHRD class errors or junk - return EIO */ /* else ERRHRD class errors or junk - return EIO */
cFYI(1, "Mapping smb error code 0x%x to POSIX err %d", cifs_dbg(FYI, "Mapping smb error code 0x%x to POSIX err %d\n",
le32_to_cpu(smb->Status.CifsError), rc); le32_to_cpu(smb->Status.CifsError), rc);
/* generic corrective action e.g. reconnect SMB session on /* generic corrective action e.g. reconnect SMB session on
@ -951,20 +951,20 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
SMB_TIME *st = (SMB_TIME *)&time; SMB_TIME *st = (SMB_TIME *)&time;
SMB_DATE *sd = (SMB_DATE *)&date; SMB_DATE *sd = (SMB_DATE *)&date;
cFYI(1, "date %d time %d", date, time); cifs_dbg(FYI, "date %d time %d\n", date, time);
sec = 2 * st->TwoSeconds; sec = 2 * st->TwoSeconds;
min = st->Minutes; min = st->Minutes;
if ((sec > 59) || (min > 59)) if ((sec > 59) || (min > 59))
cERROR(1, "illegal time min %d sec %d", min, sec); cifs_dbg(VFS, "illegal time min %d sec %d\n", min, sec);
sec += (min * 60); sec += (min * 60);
sec += 60 * 60 * st->Hours; sec += 60 * 60 * st->Hours;
if (st->Hours > 24) if (st->Hours > 24)
cERROR(1, "illegal hours %d", st->Hours); cifs_dbg(VFS, "illegal hours %d\n", st->Hours);
days = sd->Day; days = sd->Day;
month = sd->Month; month = sd->Month;
if ((days > 31) || (month > 12)) { if ((days > 31) || (month > 12)) {
cERROR(1, "illegal date, month %d day: %d", month, days); cifs_dbg(VFS, "illegal date, month %d day: %d\n", month, days);
if (month > 12) if (month > 12)
month = 12; month = 12;
} }
@ -990,7 +990,7 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
ts.tv_sec = sec + offset; ts.tv_sec = sec + offset;
/* cFYI(1, "sec after cnvrt dos to unix time %d",sec); */ /* cifs_dbg(FYI, "sec after cnvrt dos to unix time %d\n",sec); */
ts.tv_nsec = 0; ts.tv_nsec = 0;
return ts; return ts;

Просмотреть файл

@ -48,15 +48,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"); cifs_dbg(FYI, "empty cifs private file data\n");
return; return;
} }
if (cf->invalidHandle) if (cf->invalidHandle)
cFYI(1, "invalid handle"); cifs_dbg(FYI, "invalid handle\n");
if (cf->srch_inf.endOfSearch) if (cf->srch_inf.endOfSearch)
cFYI(1, "end of search"); cifs_dbg(FYI, "end of search\n");
if (cf->srch_inf.emptyDir) if (cf->srch_inf.emptyDir)
cFYI(1, "empty dir"); cifs_dbg(FYI, "empty dir\n");
} }
} }
#else #else
@ -80,7 +80,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
struct super_block *sb = parent->d_inode->i_sb; struct super_block *sb = parent->d_inode->i_sb;
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
cFYI(1, "%s: for %s", __func__, name->name); cifs_dbg(FYI, "%s: for %s\n", __func__, name->name);
dentry = d_hash_and_lookup(parent, name); dentry = d_hash_and_lookup(parent, name);
if (unlikely(IS_ERR(dentry))) if (unlikely(IS_ERR(dentry)))
@ -233,7 +233,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"); cifs_dbg(FYI, "Error closing temporary reparsepoint open\n");
} }
} }
} }
@ -285,7 +285,7 @@ initiate_cifs_search(const unsigned int xid, struct file *file)
goto error_exit; goto error_exit;
} }
cFYI(1, "Full path: %s start at: %lld", full_path, file->f_pos); cifs_dbg(FYI, "Full path: %s start at: %lld\n", full_path, file->f_pos);
ffirst_retry: ffirst_retry:
/* test for Unix extensions */ /* test for Unix extensions */
@ -336,7 +336,7 @@ static int cifs_unicode_bytelen(const 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"); cifs_dbg(FYI, "Unicode string longer than PATH_MAX found\n");
return len << 1; return len << 1;
} }
@ -353,18 +353,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); cifs_dbg(FYI, "new entry %p old entry %p\n", 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, "search entry %p began after end of SMB %p old entry %p", cifs_dbg(VFS, "search entry %p began after end of SMB %p old entry %p\n",
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", cifs_dbg(VFS, "search entry %p extends after end of SMB %p\n",
new_entry, end_of_smb); new_entry, end_of_smb);
return NULL; return NULL;
} else } else
return new_entry; return new_entry;
@ -457,7 +457,7 @@ static int cifs_fill_dirent(struct cifs_dirent *de, const void *info,
cifs_fill_dirent_std(de, info); cifs_fill_dirent_std(de, info);
break; break;
default: default:
cFYI(1, "Unknown findfirst level %d", level); cifs_dbg(FYI, "Unknown findfirst level %d\n", level);
return -EINVAL; return -EINVAL;
} }
@ -572,7 +572,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
if (((index_to_find < cfile->srch_inf.index_of_last_entry) && if (((index_to_find < cfile->srch_inf.index_of_last_entry) &&
is_dir_changed(file)) || (index_to_find < first_entry_in_buffer)) { is_dir_changed(file)) || (index_to_find < first_entry_in_buffer)) {
/* close and restart search */ /* close and restart search */
cFYI(1, "search backing up - close and restart search"); cifs_dbg(FYI, "search backing up - close and restart search\n");
spin_lock(&cifs_file_list_lock); spin_lock(&cifs_file_list_lock);
if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) { if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) {
cfile->invalidHandle = true; cfile->invalidHandle = true;
@ -582,7 +582,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
} else } else
spin_unlock(&cifs_file_list_lock); spin_unlock(&cifs_file_list_lock);
if (cfile->srch_inf.ntwrk_buf_start) { if (cfile->srch_inf.ntwrk_buf_start) {
cFYI(1, "freeing SMB ff cache buf on search rewind"); cifs_dbg(FYI, "freeing SMB ff cache buf on search rewind\n");
if (cfile->srch_inf.smallBuf) if (cfile->srch_inf.smallBuf)
cifs_small_buf_release(cfile->srch_inf. cifs_small_buf_release(cfile->srch_inf.
ntwrk_buf_start); ntwrk_buf_start);
@ -593,7 +593,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
} }
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", cifs_dbg(FYI, "error %d reinitiating a search on rewind\n",
rc); rc);
return rc; return rc;
} }
@ -608,7 +608,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
while ((index_to_find >= cfile->srch_inf.index_of_last_entry) && while ((index_to_find >= cfile->srch_inf.index_of_last_entry) &&
(rc == 0) && !cfile->srch_inf.endOfSearch) { (rc == 0) && !cfile->srch_inf.endOfSearch) {
cFYI(1, "calling findnext2"); cifs_dbg(FYI, "calling findnext2\n");
rc = server->ops->query_dir_next(xid, tcon, &cfile->fid, rc = server->ops->query_dir_next(xid, tcon, &cfile->fid,
search_flags, search_flags,
&cfile->srch_inf); &cfile->srch_inf);
@ -631,7 +631,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
first_entry_in_buffer = cfile->srch_inf.index_of_last_entry first_entry_in_buffer = cfile->srch_inf.index_of_last_entry
- cfile->srch_inf.entries_in_buffer; - cfile->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); cifs_dbg(FYI, "found entry - pos_in_buf %d\n", pos_in_buf);
for (i = 0; (i < (pos_in_buf)) && (cur_ent != NULL); i++) { for (i = 0; (i < (pos_in_buf)) && (cur_ent != NULL); i++) {
/* go entry by entry figuring out which is first */ /* go entry by entry figuring out which is first */
@ -640,19 +640,18 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon,
} }
if ((cur_ent == NULL) && (i < pos_in_buf)) { if ((cur_ent == 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" cifs_dbg(VFS, "reached end of buf searching for pos in buf %d index to find %lld rc %d\n",
" %d index to find %lld rc %d", pos_in_buf, pos_in_buf, index_to_find, rc);
index_to_find, rc);
} }
rc = 0; rc = 0;
*current_entry = cur_ent; *current_entry = cur_ent;
} else { } else {
cFYI(1, "index not in buffer - could not findnext into it"); cifs_dbg(FYI, "index not in buffer - could not findnext into it\n");
return 0; return 0;
} }
if (pos_in_buf >= cfile->srch_inf.entries_in_buffer) { if (pos_in_buf >= cfile->srch_inf.entries_in_buffer) {
cFYI(1, "can not return entries pos_in_buf beyond last"); cifs_dbg(FYI, "can not return entries pos_in_buf beyond last\n");
*num_to_ret = 0; *num_to_ret = 0;
} else } else
*num_to_ret = cfile->srch_inf.entries_in_buffer - pos_in_buf; *num_to_ret = cfile->srch_inf.entries_in_buffer - pos_in_buf;
@ -678,8 +677,8 @@ static int cifs_filldir(char *find_entry, struct file *file, filldir_t filldir,
return rc; return rc;
if (de.namelen > max_len) { if (de.namelen > max_len) {
cERROR(1, "bad search response length %zd past smb end", cifs_dbg(VFS, "bad search response length %zd past smb end\n",
de.namelen); de.namelen);
return -EINVAL; return -EINVAL;
} }
@ -768,7 +767,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); cifs_dbg(FYI, "initiate cifs search rc %d\n", rc);
if (rc) if (rc)
goto rddir2_exit; goto rddir2_exit;
} }
@ -777,7 +776,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_inode(file)->i_ino, DT_DIR) < 0) { file_inode(file)->i_ino, DT_DIR) < 0) {
cERROR(1, "Filldir for current dir failed"); cifs_dbg(VFS, "Filldir for current dir failed\n");
rc = -ENOMEM; rc = -ENOMEM;
break; break;
} }
@ -785,7 +784,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,
parent_ino(file->f_path.dentry), DT_DIR) < 0) { parent_ino(file->f_path.dentry), DT_DIR) < 0) {
cERROR(1, "Filldir for parent dir failed"); cifs_dbg(VFS, "Filldir for parent dir failed\n");
rc = -ENOMEM; rc = -ENOMEM;
break; break;
} }
@ -804,7 +803,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"); cifs_dbg(FYI, "End of search, empty dir\n");
rc = 0; rc = 0;
break; break;
} }
@ -817,16 +816,16 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
rc = find_cifs_entry(xid, tcon, file, &current_entry, rc = find_cifs_entry(xid, tcon, file, &current_entry,
&num_to_fill); &num_to_fill);
if (rc) { if (rc) {
cFYI(1, "fce error %d", rc); cifs_dbg(FYI, "fce error %d\n", 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); cifs_dbg(FYI, "entry %lld found\n", file->f_pos);
} else { } else {
cFYI(1, "could not find entry"); cifs_dbg(FYI, "could not find entry\n");
goto rddir2_exit; goto rddir2_exit;
} }
cFYI(1, "loop through %d times filling dir for net buf %p", cifs_dbg(FYI, "loop through %d times filling dir for net buf %p\n",
num_to_fill, cifsFile->srch_inf.ntwrk_buf_start); num_to_fill, cifsFile->srch_inf.ntwrk_buf_start);
max_len = tcon->ses->server->ops->calc_smb_size( max_len = tcon->ses->server->ops->calc_smb_size(
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;
@ -840,8 +839,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", cifs_dbg(VFS, "past SMB end, num to fill %d i %d\n",
num_to_fill, i); num_to_fill, i);
break; break;
} }
/* /*
@ -858,8 +857,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", cifs_dbg(FYI, "last entry in buf at pos %lld %s\n",
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

Просмотреть файл

@ -283,11 +283,11 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifs_ses *ses,
int len; int len;
char *data = *pbcc_area; char *data = *pbcc_area;
cFYI(1, "bleft %d", bleft); cifs_dbg(FYI, "bleft %d\n", bleft);
kfree(ses->serverOS); kfree(ses->serverOS);
ses->serverOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp); ses->serverOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp);
cFYI(1, "serverOS=%s", ses->serverOS); cifs_dbg(FYI, "serverOS=%s\n", 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;
@ -296,7 +296,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifs_ses *ses,
kfree(ses->serverNOS); kfree(ses->serverNOS);
ses->serverNOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp); ses->serverNOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp);
cFYI(1, "serverNOS=%s", ses->serverNOS); cifs_dbg(FYI, "serverNOS=%s\n", 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;
@ -305,7 +305,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifs_ses *ses,
kfree(ses->serverDomain); kfree(ses->serverDomain);
ses->serverDomain = cifs_strndup_from_utf16(data, bleft, true, nls_cp); ses->serverDomain = cifs_strndup_from_utf16(data, bleft, true, nls_cp);
cFYI(1, "serverDomain=%s", ses->serverDomain); cifs_dbg(FYI, "serverDomain=%s\n", ses->serverDomain);
return; return;
} }
@ -318,7 +318,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
int len; int len;
char *bcc_ptr = *pbcc_area; char *bcc_ptr = *pbcc_area;
cFYI(1, "decode sessetup ascii. bleft %d", bleft); cifs_dbg(FYI, "decode sessetup ascii. bleft %d\n", bleft);
len = strnlen(bcc_ptr, bleft); len = strnlen(bcc_ptr, bleft);
if (len >= bleft) if (len >= bleft)
@ -330,7 +330,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 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"); cifs_dbg(FYI, "OS/2 server\n");
ses->flags |= CIFS_SES_OS2; ses->flags |= CIFS_SES_OS2;
} }
@ -359,7 +359,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 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); cifs_dbg(FYI, "ascii: bytes left %d\n", bleft);
return rc; return rc;
} }
@ -373,16 +373,18 @@ 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); cifs_dbg(VFS, "challenge blob len %d too small\n", 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); cifs_dbg(VFS, "blob signature incorrect %s\n",
pblob->Signature);
return -EINVAL; return -EINVAL;
} }
if (pblob->MessageType != NtLmChallenge) { if (pblob->MessageType != NtLmChallenge) {
cERROR(1, "Incorrect message type %d", pblob->MessageType); cifs_dbg(VFS, "Incorrect message type %d\n",
pblob->MessageType);
return -EINVAL; return -EINVAL;
} }
@ -395,14 +397,15 @@ int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len,
tioffset = le32_to_cpu(pblob->TargetInfoArray.BufferOffset); tioffset = le32_to_cpu(pblob->TargetInfoArray.BufferOffset);
tilen = le16_to_cpu(pblob->TargetInfoArray.Length); tilen = le16_to_cpu(pblob->TargetInfoArray.Length);
if (tioffset > blob_len || tioffset + tilen > blob_len) { if (tioffset > blob_len || tioffset + tilen > blob_len) {
cERROR(1, "tioffset + tilen too high %u + %u", tioffset, tilen); cifs_dbg(VFS, "tioffset + tilen too high %u + %u",
tioffset, tilen);
return -EINVAL; return -EINVAL;
} }
if (tilen) { if (tilen) {
ses->auth_key.response = kmemdup(bcc_ptr + tioffset, tilen, ses->auth_key.response = kmemdup(bcc_ptr + tioffset, tilen,
GFP_KERNEL); GFP_KERNEL);
if (!ses->auth_key.response) { if (!ses->auth_key.response) {
cERROR(1, "Challenge target info allocation failure"); cifs_dbg(VFS, "Challenge target info alloc failure");
return -ENOMEM; return -ENOMEM;
} }
ses->auth_key.len = tilen; ses->auth_key.len = tilen;
@ -486,7 +489,7 @@ int build_ntlmssp_auth_blob(unsigned char *pbuffer,
sec_blob->NtChallengeResponse.BufferOffset = cpu_to_le32(tmp - pbuffer); sec_blob->NtChallengeResponse.BufferOffset = cpu_to_le32(tmp - pbuffer);
rc = setup_ntlmv2_rsp(ses, nls_cp); rc = setup_ntlmv2_rsp(ses, nls_cp);
if (rc) { if (rc) {
cERROR(1, "Error %d during NTLMSSP authentication", rc); cifs_dbg(VFS, "Error %d during NTLMSSP authentication\n", rc);
goto setup_ntlmv2_ret; goto setup_ntlmv2_ret;
} }
memcpy(tmp, ses->auth_key.response + CIFS_SESS_KEY_SIZE, memcpy(tmp, ses->auth_key.response + CIFS_SESS_KEY_SIZE,
@ -580,7 +583,7 @@ CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
return -EINVAL; return -EINVAL;
type = ses->server->secType; type = ses->server->secType;
cFYI(1, "sess setup type %d", type); cifs_dbg(FYI, "sess setup type %d\n", type);
if (type == RawNTLMSSP) { if (type == RawNTLMSSP) {
/* if memory allocation is successful, caller of this function /* if memory allocation is successful, caller of this function
* frees it. * frees it.
@ -674,7 +677,7 @@ ssetup_ntlmssp_authenticate:
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"); cifs_dbg(FYI, "Negotiating LANMAN setting up strings\n");
/* 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
@ -688,7 +691,8 @@ ssetup_ntlmssp_authenticate:
/* calculate ntlm response and session key */ /* calculate ntlm response and session key */
rc = setup_ntlm_response(ses, nls_cp); rc = setup_ntlm_response(ses, nls_cp);
if (rc) { if (rc) {
cERROR(1, "Error %d during NTLM authentication", rc); cifs_dbg(VFS, "Error %d during NTLM authentication\n",
rc);
goto ssetup_exit; goto ssetup_exit;
} }
@ -718,7 +722,8 @@ ssetup_ntlmssp_authenticate:
/* calculate nlmv2 response and session key */ /* calculate nlmv2 response and session key */
rc = setup_ntlmv2_rsp(ses, nls_cp); rc = setup_ntlmv2_rsp(ses, nls_cp);
if (rc) { if (rc) {
cERROR(1, "Error %d during NTLMv2 authentication", rc); cifs_dbg(VFS, "Error %d during NTLMv2 authentication\n",
rc);
goto ssetup_exit; goto ssetup_exit;
} }
memcpy(bcc_ptr, ses->auth_key.response + CIFS_SESS_KEY_SIZE, memcpy(bcc_ptr, ses->auth_key.response + CIFS_SESS_KEY_SIZE,
@ -754,8 +759,8 @@ ssetup_ntlmssp_authenticate:
/* 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" cifs_dbg(VFS, "incorrect version of cifs.upcall "
" %d but got %d)", "expected %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;
@ -764,7 +769,7 @@ ssetup_ntlmssp_authenticate:
ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len,
GFP_KERNEL); GFP_KERNEL);
if (!ses->auth_key.response) { if (!ses->auth_key.response) {
cERROR(1, "Kerberos can't allocate (%u bytes) memory", cifs_dbg(VFS, "Kerberos can't allocate (%u bytes) memory",
msg->sesskey_len); msg->sesskey_len);
rc = -ENOMEM; rc = -ENOMEM;
goto ssetup_exit; goto ssetup_exit;
@ -790,18 +795,18 @@ ssetup_ntlmssp_authenticate:
/* 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!"); cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n");
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
#endif /* CONFIG_CIFS_UPCALL */ #endif /* CONFIG_CIFS_UPCALL */
} else if (type == RawNTLMSSP) { } else 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"); cifs_dbg(VFS, "NTLMSSP requires Unicode support\n");
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
} }
cFYI(1, "ntlmssp session setup phase %d", phase); cifs_dbg(FYI, "ntlmssp session setup phase %d\n", 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);
@ -824,7 +829,6 @@ ssetup_ntlmssp_authenticate:
5*sizeof(struct _AUTHENTICATE_MESSAGE), 5*sizeof(struct _AUTHENTICATE_MESSAGE),
GFP_KERNEL); GFP_KERNEL);
if (!ntlmsspblob) { if (!ntlmsspblob) {
cERROR(1, "Can't allocate NTLMSSP blob");
rc = -ENOMEM; rc = -ENOMEM;
goto ssetup_exit; goto ssetup_exit;
} }
@ -844,7 +848,7 @@ ssetup_ntlmssp_authenticate:
smb_buf->Uid = ses->Suid; smb_buf->Uid = ses->Suid;
break; break;
default: default:
cERROR(1, "invalid phase %d", phase); cifs_dbg(VFS, "invalid phase %d\n", phase);
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
} }
@ -855,7 +859,7 @@ ssetup_ntlmssp_authenticate:
} }
unicode_oslm_strings(&bcc_ptr, nls_cp); unicode_oslm_strings(&bcc_ptr, nls_cp);
} else { } else {
cERROR(1, "secType %d not supported!", type); cifs_dbg(VFS, "secType %d not supported!\n", type);
rc = -ENOSYS; rc = -ENOSYS;
goto ssetup_exit; goto ssetup_exit;
} }
@ -880,7 +884,7 @@ ssetup_ntlmssp_authenticate:
(smb_buf->Status.CifsError == (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"); cifs_dbg(VFS, "Unexpected more processing error\n");
goto ssetup_exit; goto ssetup_exit;
} }
/* NTLMSSP Negotiate sent now processing challenge (response) */ /* NTLMSSP Negotiate sent now processing challenge (response) */
@ -892,14 +896,14 @@ ssetup_ntlmssp_authenticate:
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); cifs_dbg(VFS, "bad word count %d\n", 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? */ cifs_dbg(FYI, "Guest login\n"); /* 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 = %llu ", ses->Suid); cifs_dbg(FYI, "UID = %llu\n", 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 = get_bcc(smb_buf); bytes_remaining = get_bcc(smb_buf);
@ -908,7 +912,8 @@ ssetup_ntlmssp_authenticate:
if (smb_buf->WordCount == 4) { if (smb_buf->WordCount == 4) {
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); cifs_dbg(VFS, "bad security blob length %d\n",
blob_len);
rc = -EINVAL; rc = -EINVAL;
goto ssetup_exit; goto ssetup_exit;
} }
@ -946,7 +951,7 @@ ssetup_exit:
kfree(ntlmsspblob); kfree(ntlmsspblob);
ntlmsspblob = NULL; ntlmsspblob = NULL;
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); cifs_dbg(FYI, "ssetup freeing small buf %p\n", 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);

Просмотреть файл

@ -63,8 +63,8 @@ send_nt_cancel(struct TCP_Server_Info *server, void *buf,
rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
mutex_unlock(&server->srv_mutex); mutex_unlock(&server->srv_mutex);
cFYI(1, "issued NT_CANCEL for mid %u, rc = %d", cifs_dbg(FYI, "issued NT_CANCEL for mid %u, rc = %d\n",
in_buf->Mid, rc); in_buf->Mid, rc);
return rc; return rc;
} }
@ -249,7 +249,7 @@ check2ndT2(char *buf)
/* 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"); cifs_dbg(FYI, "invalid transact2 word count\n");
return -EINVAL; return -EINVAL;
} }
@ -261,18 +261,18 @@ check2ndT2(char *buf)
if (total_data_size == data_in_this_rsp) if (total_data_size == data_in_this_rsp)
return 0; return 0;
else if (total_data_size < data_in_this_rsp) { else if (total_data_size < data_in_this_rsp) {
cFYI(1, "total data %d smaller than data in frame %d", cifs_dbg(FYI, "total data %d smaller than data in frame %d\n",
total_data_size, data_in_this_rsp); total_data_size, data_in_this_rsp);
return -EINVAL; return -EINVAL;
} }
remaining = total_data_size - data_in_this_rsp; remaining = total_data_size - data_in_this_rsp;
cFYI(1, "missing %d bytes from transact2, check next response", cifs_dbg(FYI, "missing %d bytes from transact2, check next response\n",
remaining); remaining);
if (total_data_size > CIFSMaxBufSize) { if (total_data_size > CIFSMaxBufSize) {
cERROR(1, "TotalDataSize %d is over maximum buffer %d", cifs_dbg(VFS, "TotalDataSize %d is over maximum buffer %d\n",
total_data_size, CIFSMaxBufSize); total_data_size, CIFSMaxBufSize);
return -EINVAL; return -EINVAL;
} }
return remaining; return remaining;
@ -293,28 +293,28 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
tgt_total_cnt = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount); tgt_total_cnt = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
if (tgt_total_cnt != src_total_cnt) if (tgt_total_cnt != src_total_cnt)
cFYI(1, "total data count of primary and secondary t2 differ " cifs_dbg(FYI, "total data count of primary and secondary t2 differ source=%hu target=%hu\n",
"source=%hu target=%hu", src_total_cnt, tgt_total_cnt); src_total_cnt, tgt_total_cnt);
total_in_tgt = get_unaligned_le16(&pSMBt->t2_rsp.DataCount); total_in_tgt = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);
remaining = tgt_total_cnt - total_in_tgt; remaining = tgt_total_cnt - total_in_tgt;
if (remaining < 0) { if (remaining < 0) {
cFYI(1, "Server sent too much data. tgt_total_cnt=%hu " cifs_dbg(FYI, "Server sent too much data. tgt_total_cnt=%hu total_in_tgt=%hu\n",
"total_in_tgt=%hu", tgt_total_cnt, total_in_tgt); tgt_total_cnt, total_in_tgt);
return -EPROTO; return -EPROTO;
} }
if (remaining == 0) { if (remaining == 0) {
/* nothing to do, ignore */ /* nothing to do, ignore */
cFYI(1, "no more data remains"); cifs_dbg(FYI, "no more data remains\n");
return 0; return 0;
} }
total_in_src = get_unaligned_le16(&pSMBs->t2_rsp.DataCount); total_in_src = get_unaligned_le16(&pSMBs->t2_rsp.DataCount);
if (remaining < total_in_src) if (remaining < total_in_src)
cFYI(1, "transact2 2nd response contains too much data"); cifs_dbg(FYI, "transact2 2nd response contains too much data\n");
/* find end of first SMB data area */ /* find end of first SMB data area */
data_area_of_tgt = (char *)&pSMBt->hdr.Protocol + data_area_of_tgt = (char *)&pSMBt->hdr.Protocol +
@ -329,7 +329,8 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
total_in_tgt += total_in_src; total_in_tgt += total_in_src;
/* is the result too big for the field? */ /* is the result too big for the field? */
if (total_in_tgt > USHRT_MAX) { if (total_in_tgt > USHRT_MAX) {
cFYI(1, "coalesced DataCount too large (%u)", total_in_tgt); cifs_dbg(FYI, "coalesced DataCount too large (%u)\n",
total_in_tgt);
return -EPROTO; return -EPROTO;
} }
put_unaligned_le16(total_in_tgt, &pSMBt->t2_rsp.DataCount); put_unaligned_le16(total_in_tgt, &pSMBt->t2_rsp.DataCount);
@ -339,7 +340,7 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
byte_count += total_in_src; byte_count += total_in_src;
/* is the result too big for the field? */ /* is the result too big for the field? */
if (byte_count > USHRT_MAX) { if (byte_count > USHRT_MAX) {
cFYI(1, "coalesced BCC too large (%u)", byte_count); cifs_dbg(FYI, "coalesced BCC too large (%u)\n", byte_count);
return -EPROTO; return -EPROTO;
} }
put_bcc(byte_count, target_hdr); put_bcc(byte_count, target_hdr);
@ -348,7 +349,8 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
byte_count += total_in_src; byte_count += total_in_src;
/* don't allow buffer to overflow */ /* don't allow buffer to overflow */
if (byte_count > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { if (byte_count > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cFYI(1, "coalesced BCC exceeds buffer size (%u)", byte_count); cifs_dbg(FYI, "coalesced BCC exceeds buffer size (%u)\n",
byte_count);
return -ENOBUFS; return -ENOBUFS;
} }
target_hdr->smb_buf_length = cpu_to_be32(byte_count); target_hdr->smb_buf_length = cpu_to_be32(byte_count);
@ -358,12 +360,12 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
if (remaining != total_in_src) { if (remaining != total_in_src) {
/* more responses to go */ /* more responses to go */
cFYI(1, "waiting for more secondary responses"); cifs_dbg(FYI, "waiting for more secondary responses\n");
return 1; return 1;
} }
/* we are done */ /* we are done */
cFYI(1, "found the last secondary response"); cifs_dbg(FYI, "found the last secondary response\n");
return 0; return 0;
} }
@ -388,7 +390,7 @@ cifs_check_trans2(struct mid_q_entry *mid, struct TCP_Server_Info *server,
} }
if (!server->large_buf) { if (!server->large_buf) {
/*FIXME: switch to already allocated largebuf?*/ /*FIXME: switch to already allocated largebuf?*/
cERROR(1, "1st trans2 resp needs bigbuf"); cifs_dbg(VFS, "1st trans2 resp needs bigbuf\n");
} else { } else {
/* Have first buffer */ /* Have first buffer */
mid->resp_buf = buf; mid->resp_buf = buf;
@ -776,8 +778,7 @@ smb_set_file_info(struct inode *inode, const char *full_path,
goto out; goto out;
} }
cFYI(1, "calling SetFileInfo since SetPathInfo for times not supported " cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for times not supported by this server\n");
"by this server");
rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR,
&netfid, &oplock, NULL, cifs_sb->local_nls, &netfid, &oplock, NULL, cifs_sb->local_nls,

Просмотреть файл

@ -43,13 +43,13 @@ smb2_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock)
if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE) { if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE) {
cinode->clientCanCacheAll = true; cinode->clientCanCacheAll = true;
cinode->clientCanCacheRead = true; cinode->clientCanCacheRead = true;
cFYI(1, "Exclusive Oplock granted on inode %p", cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n",
&cinode->vfs_inode); &cinode->vfs_inode);
} else if (oplock == SMB2_OPLOCK_LEVEL_II) { } else if (oplock == SMB2_OPLOCK_LEVEL_II) {
cinode->clientCanCacheAll = false; cinode->clientCanCacheAll = false;
cinode->clientCanCacheRead = true; cinode->clientCanCacheRead = true;
cFYI(1, "Level II Oplock granted on inode %p", cifs_dbg(FYI, "Level II Oplock granted on inode %p\n",
&cinode->vfs_inode); &cinode->vfs_inode);
} else { } else {
cinode->clientCanCacheAll = false; cinode->clientCanCacheAll = false;
cinode->clientCanCacheRead = false; cinode->clientCanCacheRead = false;

Просмотреть файл

@ -92,7 +92,7 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon,
(FILE_BASIC_INFO *)data); (FILE_BASIC_INFO *)data);
break; break;
default: default:
cERROR(1, "Invalid command"); cifs_dbg(VFS, "Invalid command\n");
break; break;
} }

Просмотреть файл

@ -2472,7 +2472,7 @@ map_smb2_to_linux_error(char *buf, bool log_err)
/* on error mapping not found - return EIO */ /* on error mapping not found - return EIO */
cFYI(1, "Mapping SMB2 status code %d to POSIX err %d", cifs_dbg(FYI, "Mapping SMB2 status code %d to POSIX err %d\n",
smb2err, rc); smb2err, rc);
return rc; return rc;

Просмотреть файл

@ -45,17 +45,17 @@ check_smb2_hdr(struct smb2_hdr *hdr, __u64 mid)
if (hdr->Command == SMB2_OPLOCK_BREAK) if (hdr->Command == SMB2_OPLOCK_BREAK)
return 0; return 0;
else else
cERROR(1, "Received Request not response"); cifs_dbg(VFS, "Received Request not response\n");
} }
} else { /* bad signature or mid */ } else { /* bad signature or mid */
if (*(__le32 *)hdr->ProtocolId != SMB2_PROTO_NUMBER) if (*(__le32 *)hdr->ProtocolId != SMB2_PROTO_NUMBER)
cERROR(1, "Bad protocol string signature header %x", cifs_dbg(VFS, "Bad protocol string signature header %x\n",
*(unsigned int *) hdr->ProtocolId); *(unsigned int *) hdr->ProtocolId);
if (mid != hdr->MessageId) if (mid != hdr->MessageId)
cERROR(1, "Mids do not match: %llu and %llu", mid, cifs_dbg(VFS, "Mids do not match: %llu and %llu\n",
hdr->MessageId); mid, hdr->MessageId);
} }
cERROR(1, "Bad SMB detected. The Mid=%llu", hdr->MessageId); cifs_dbg(VFS, "Bad SMB detected. The Mid=%llu\n", hdr->MessageId);
return 1; return 1;
} }
@ -101,7 +101,8 @@ smb2_check_message(char *buf, unsigned int length)
int command; int command;
/* BB disable following printk later */ /* BB disable following printk later */
cFYI(1, "%s length: 0x%x, smb_buf_length: 0x%x", __func__, length, len); cifs_dbg(FYI, "%s length: 0x%x, smb_buf_length: 0x%x\n",
__func__, length, len);
/* /*
* Add function to do table lookup of StructureSize by command * Add function to do table lookup of StructureSize by command
@ -117,12 +118,13 @@ smb2_check_message(char *buf, unsigned int length)
*/ */
return 0; return 0;
} else { } else {
cERROR(1, "Length less than SMB header size"); cifs_dbg(VFS, "Length less than SMB header size\n");
} }
return 1; return 1;
} }
if (len > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE - 4) { if (len > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE - 4) {
cERROR(1, "SMB length greater than maximum, mid=%llu", mid); cifs_dbg(VFS, "SMB length greater than maximum, mid=%llu\n",
mid);
return 1; return 1;
} }
@ -130,14 +132,14 @@ smb2_check_message(char *buf, unsigned int length)
return 1; return 1;
if (hdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) { if (hdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) {
cERROR(1, "Illegal structure size %u", cifs_dbg(VFS, "Illegal structure size %u\n",
le16_to_cpu(hdr->StructureSize)); le16_to_cpu(hdr->StructureSize));
return 1; return 1;
} }
command = le16_to_cpu(hdr->Command); command = le16_to_cpu(hdr->Command);
if (command >= NUMBER_OF_SMB2_COMMANDS) { if (command >= NUMBER_OF_SMB2_COMMANDS) {
cERROR(1, "Illegal SMB2 command %d", command); cifs_dbg(VFS, "Illegal SMB2 command %d\n", command);
return 1; return 1;
} }
@ -145,30 +147,30 @@ smb2_check_message(char *buf, unsigned int length)
if (command != SMB2_OPLOCK_BREAK_HE && (hdr->Status == 0 || if (command != SMB2_OPLOCK_BREAK_HE && (hdr->Status == 0 ||
pdu->StructureSize2 != SMB2_ERROR_STRUCTURE_SIZE2)) { pdu->StructureSize2 != SMB2_ERROR_STRUCTURE_SIZE2)) {
/* error packets have 9 byte structure size */ /* error packets have 9 byte structure size */
cERROR(1, "Illegal response size %u for command %d", cifs_dbg(VFS, "Illegal response size %u for command %d\n",
le16_to_cpu(pdu->StructureSize2), command); le16_to_cpu(pdu->StructureSize2), command);
return 1; return 1;
} else if (command == SMB2_OPLOCK_BREAK_HE && (hdr->Status == 0) } else if (command == SMB2_OPLOCK_BREAK_HE && (hdr->Status == 0)
&& (le16_to_cpu(pdu->StructureSize2) != 44) && (le16_to_cpu(pdu->StructureSize2) != 44)
&& (le16_to_cpu(pdu->StructureSize2) != 36)) { && (le16_to_cpu(pdu->StructureSize2) != 36)) {
/* special case for SMB2.1 lease break message */ /* special case for SMB2.1 lease break message */
cERROR(1, "Illegal response size %d for oplock break", cifs_dbg(VFS, "Illegal response size %d for oplock break\n",
le16_to_cpu(pdu->StructureSize2)); le16_to_cpu(pdu->StructureSize2));
return 1; return 1;
} }
} }
if (4 + len != length) { if (4 + len != length) {
cERROR(1, "Total length %u RFC1002 length %u mismatch mid %llu", cifs_dbg(VFS, "Total length %u RFC1002 length %u mismatch mid %llu\n",
length, 4 + len, mid); length, 4 + len, mid);
return 1; return 1;
} }
clc_len = smb2_calc_size(hdr); clc_len = smb2_calc_size(hdr);
if (4 + len != clc_len) { if (4 + len != clc_len) {
cFYI(1, "Calculated size %u length %u mismatch mid %llu", cifs_dbg(FYI, "Calculated size %u length %u mismatch mid %llu\n",
clc_len, 4 + len, mid); clc_len, 4 + len, mid);
/* Windows 7 server returns 24 bytes more */ /* Windows 7 server returns 24 bytes more */
if (clc_len + 20 == len && command == SMB2_OPLOCK_BREAK_HE) if (clc_len + 20 == len && command == SMB2_OPLOCK_BREAK_HE)
return 0; return 0;
@ -267,7 +269,7 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr)
case SMB2_CHANGE_NOTIFY: case SMB2_CHANGE_NOTIFY:
default: default:
/* BB FIXME for unimplemented cases above */ /* BB FIXME for unimplemented cases above */
cERROR(1, "no length check for command"); cifs_dbg(VFS, "no length check for command\n");
break; break;
} }
@ -276,20 +278,20 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr)
* we have little choice but to ignore the data area in this case. * we have little choice but to ignore the data area in this case.
*/ */
if (*off > 4096) { if (*off > 4096) {
cERROR(1, "offset %d too large, data area ignored", *off); cifs_dbg(VFS, "offset %d too large, data area ignored\n", *off);
*len = 0; *len = 0;
*off = 0; *off = 0;
} else if (*off < 0) { } else if (*off < 0) {
cERROR(1, "negative offset %d to data invalid ignore data area", cifs_dbg(VFS, "negative offset %d to data invalid ignore data area\n",
*off); *off);
*off = 0; *off = 0;
*len = 0; *len = 0;
} else if (*len < 0) { } else if (*len < 0) {
cERROR(1, "negative data length %d invalid, data area ignored", cifs_dbg(VFS, "negative data length %d invalid, data area ignored\n",
*len); *len);
*len = 0; *len = 0;
} else if (*len > 128 * 1024) { } else if (*len > 128 * 1024) {
cERROR(1, "data area larger than 128K: %d", *len); cifs_dbg(VFS, "data area larger than 128K: %d\n", *len);
*len = 0; *len = 0;
} }
@ -324,7 +326,7 @@ smb2_calc_size(void *buf)
goto calc_size_exit; goto calc_size_exit;
smb2_get_data_area_len(&offset, &data_length, hdr); smb2_get_data_area_len(&offset, &data_length, hdr);
cFYI(1, "SMB2 data length %d offset %d", data_length, offset); cifs_dbg(FYI, "SMB2 data length %d offset %d\n", data_length, offset);
if (data_length > 0) { if (data_length > 0) {
/* /*
@ -335,15 +337,15 @@ smb2_calc_size(void *buf)
* the size of the RFC1001 hdr. * the size of the RFC1001 hdr.
*/ */
if (offset + 4 + 1 < len) { if (offset + 4 + 1 < len) {
cERROR(1, "data area offset %d overlaps SMB2 header %d", cifs_dbg(VFS, "data area offset %d overlaps SMB2 header %d\n",
offset + 4 + 1, len); offset + 4 + 1, len);
data_length = 0; data_length = 0;
} else { } else {
len = 4 + offset + data_length; len = 4 + offset + data_length;
} }
} }
calc_size_exit: calc_size_exit:
cFYI(1, "SMB2 len %d", len); cifs_dbg(FYI, "SMB2 len %d\n", len);
return len; return len;
} }
@ -405,7 +407,7 @@ cifs_ses_oplock_break(struct work_struct *work)
rc = SMB2_lease_break(0, tlink_tcon(lw->tlink), lw->lease_key, rc = SMB2_lease_break(0, tlink_tcon(lw->tlink), lw->lease_key,
lw->lease_state); lw->lease_state);
cFYI(1, "Lease release rc %d", rc); cifs_dbg(FYI, "Lease release rc %d\n", rc);
cifs_put_tlink(lw->tlink); cifs_put_tlink(lw->tlink);
kfree(lw); kfree(lw);
} }
@ -426,15 +428,13 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED); SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED);
lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL); lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL);
if (!lw) { if (!lw)
cERROR(1, "Memory allocation failed during lease break check");
return false; return false;
}
INIT_WORK(&lw->lease_break, cifs_ses_oplock_break); INIT_WORK(&lw->lease_break, cifs_ses_oplock_break);
lw->lease_state = rsp->NewLeaseState; lw->lease_state = rsp->NewLeaseState;
cFYI(1, "Checking for lease break"); cifs_dbg(FYI, "Checking for lease break\n");
/* look up tcon based on tid & uid */ /* look up tcon based on tid & uid */
spin_lock(&cifs_tcp_ses_lock); spin_lock(&cifs_tcp_ses_lock);
@ -455,9 +455,9 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
SMB2_LEASE_KEY_SIZE)) SMB2_LEASE_KEY_SIZE))
continue; continue;
cFYI(1, "found in the open list"); cifs_dbg(FYI, "found in the open list\n");
cFYI(1, "lease key match, lease break 0x%d", cifs_dbg(FYI, "lease key match, lease break 0x%d\n",
le32_to_cpu(rsp->NewLeaseState)); le32_to_cpu(rsp->NewLeaseState));
smb2_set_oplock_level(cinode, smb2_set_oplock_level(cinode,
smb2_map_lease_to_oplock(rsp->NewLeaseState)); smb2_map_lease_to_oplock(rsp->NewLeaseState));
@ -489,9 +489,9 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
&lw->lease_break); &lw->lease_break);
} }
cFYI(1, "found in the pending open list"); cifs_dbg(FYI, "found in the pending open list\n");
cFYI(1, "lease key match, lease break 0x%d", cifs_dbg(FYI, "lease key match, lease break 0x%d\n",
le32_to_cpu(rsp->NewLeaseState)); le32_to_cpu(rsp->NewLeaseState));
open->oplock = open->oplock =
smb2_map_lease_to_oplock(rsp->NewLeaseState); smb2_map_lease_to_oplock(rsp->NewLeaseState);
@ -506,7 +506,7 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
} }
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
kfree(lw); kfree(lw);
cFYI(1, "Can not process lease break - no lease matched"); cifs_dbg(FYI, "Can not process lease break - no lease matched\n");
return false; return false;
} }
@ -520,7 +520,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
struct cifsInodeInfo *cinode; struct cifsInodeInfo *cinode;
struct cifsFileInfo *cfile; struct cifsFileInfo *cfile;
cFYI(1, "Checking for oplock break"); cifs_dbg(FYI, "Checking for oplock break\n");
if (rsp->hdr.Command != SMB2_OPLOCK_BREAK) if (rsp->hdr.Command != SMB2_OPLOCK_BREAK)
return false; return false;
@ -533,7 +533,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
return false; return false;
} }
cFYI(1, "oplock level 0x%d", rsp->OplockLevel); cifs_dbg(FYI, "oplock level 0x%d\n", rsp->OplockLevel);
/* look up tcon based on tid & uid */ /* look up tcon based on tid & uid */
spin_lock(&cifs_tcp_ses_lock); spin_lock(&cifs_tcp_ses_lock);
@ -553,7 +553,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
cfile->fid.volatile_fid) cfile->fid.volatile_fid)
continue; continue;
cFYI(1, "file id match, oplock break"); cifs_dbg(FYI, "file id match, oplock break\n");
cinode = CIFS_I(cfile->dentry->d_inode); cinode = CIFS_I(cfile->dentry->d_inode);
if (!cinode->clientCanCacheAll && if (!cinode->clientCanCacheAll &&
@ -573,11 +573,11 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
} }
spin_unlock(&cifs_file_list_lock); spin_unlock(&cifs_file_list_lock);
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
cFYI(1, "No matching file for oplock break"); cifs_dbg(FYI, "No matching file for oplock break\n");
return true; return true;
} }
} }
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
cFYI(1, "Can not process oplock break for non-existent connection"); cifs_dbg(FYI, "Can not process oplock break for non-existent connection\n");
return false; return false;
} }

Просмотреть файл

@ -38,13 +38,13 @@ change_conf(struct TCP_Server_Info *server)
case 1: case 1:
server->echoes = false; server->echoes = false;
server->oplocks = false; server->oplocks = false;
cERROR(1, "disabling echoes and oplocks"); cifs_dbg(VFS, "disabling echoes and oplocks\n");
break; break;
case 2: case 2:
server->echoes = true; server->echoes = true;
server->oplocks = false; server->oplocks = false;
server->echo_credits = 1; server->echo_credits = 1;
cFYI(1, "disabling oplocks"); cifs_dbg(FYI, "disabling oplocks\n");
break; break;
default: default:
server->echoes = true; server->echoes = true;
@ -147,10 +147,10 @@ smb2_dump_detail(void *buf)
#ifdef CONFIG_CIFS_DEBUG2 #ifdef CONFIG_CIFS_DEBUG2
struct smb2_hdr *smb = (struct smb2_hdr *)buf; struct smb2_hdr *smb = (struct smb2_hdr *)buf;
cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d", cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d\n",
smb->Command, smb->Status, smb->Flags, smb->MessageId, smb->Command, smb->Status, smb->Flags, smb->MessageId,
smb->ProcessId); smb->ProcessId);
cERROR(1, "smb buf %p len %u", smb, smb2_calc_size(smb)); cifs_dbg(VFS, "smb buf %p len %u\n", smb, smb2_calc_size(smb));
#endif #endif
} }
@ -436,7 +436,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
&oplock, NULL); &oplock, NULL);
kfree(utf16_path); kfree(utf16_path);
if (rc) { if (rc) {
cERROR(1, "open dir failed"); cifs_dbg(VFS, "open dir failed\n");
return rc; return rc;
} }
@ -448,7 +448,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
rc = SMB2_query_directory(xid, tcon, persistent_fid, volatile_fid, 0, rc = SMB2_query_directory(xid, tcon, persistent_fid, volatile_fid, 0,
srch_inf); srch_inf);
if (rc) { if (rc) {
cERROR(1, "query directory failed"); cifs_dbg(VFS, "query directory failed\n");
SMB2_close(xid, tcon, persistent_fid, volatile_fid); SMB2_close(xid, tcon, persistent_fid, volatile_fid);
} }
return rc; return rc;

Просмотреть файл

@ -155,8 +155,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
if ((smb2_command != SMB2_WRITE) && if ((smb2_command != SMB2_WRITE) &&
(smb2_command != SMB2_CREATE) && (smb2_command != SMB2_CREATE) &&
(smb2_command != SMB2_TREE_DISCONNECT)) { (smb2_command != SMB2_TREE_DISCONNECT)) {
cFYI(1, "can not send cmd %d while umounting", cifs_dbg(FYI, "can not send cmd %d while umounting\n",
smb2_command); smb2_command);
return -ENODEV; return -ENODEV;
} }
} }
@ -200,7 +200,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
* back on-line * back on-line
*/ */
if (!tcon->retry) { if (!tcon->retry) {
cFYI(1, "gave up waiting on reconnect in smb_init"); cifs_dbg(FYI, "gave up waiting on reconnect in smb_init\n");
return -EHOSTDOWN; return -EHOSTDOWN;
} }
} }
@ -227,7 +227,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
cifs_mark_open_files_invalid(tcon); cifs_mark_open_files_invalid(tcon);
rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage); rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage);
mutex_unlock(&tcon->ses->session_mutex); mutex_unlock(&tcon->ses->session_mutex);
cFYI(1, "reconnect tcon rc = %d", rc); cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
if (rc) if (rc)
goto out; goto out;
atomic_inc(&tconInfoReconnectCount); atomic_inc(&tconInfoReconnectCount);
@ -335,7 +335,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
char *security_blob; char *security_blob;
int flags = CIFS_NEG_OP; int flags = CIFS_NEG_OP;
cFYI(1, "Negotiate protocol"); cifs_dbg(FYI, "Negotiate protocol\n");
if (ses->server) if (ses->server)
server = ses->server; server = ses->server;
@ -354,7 +354,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
else /* if override flags set only sign/seal OR them with global auth */ else /* if override flags set only sign/seal OR them with global auth */
sec_flags = global_secflags | ses->overrideSecFlg; sec_flags = global_secflags | ses->overrideSecFlg;
cFYI(1, "sec_flags 0x%x", sec_flags); cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags);
req->hdr.SessionId = 0; req->hdr.SessionId = 0;
@ -389,19 +389,19 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
if (rc != 0) if (rc != 0)
goto neg_exit; goto neg_exit;
cFYI(1, "mode 0x%x", rsp->SecurityMode); cifs_dbg(FYI, "mode 0x%x\n", rsp->SecurityMode);
/* BB we may eventually want to match the negotiated vs. requested /* BB we may eventually want to match the negotiated vs. requested
dialect, even though we are only requesting one at a time */ dialect, even though we are only requesting one at a time */
if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID))
cFYI(1, "negotiated smb2.0 dialect"); cifs_dbg(FYI, "negotiated smb2.0 dialect\n");
else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID))
cFYI(1, "negotiated smb2.1 dialect"); cifs_dbg(FYI, "negotiated smb2.1 dialect\n");
else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID)) else if (rsp->DialectRevision == cpu_to_le16(SMB30_PROT_ID))
cFYI(1, "negotiated smb3.0 dialect"); cifs_dbg(FYI, "negotiated smb3.0 dialect\n");
else { else {
cERROR(1, "Illegal dialect returned by server %d", cifs_dbg(VFS, "Illegal dialect returned by server %d\n",
le16_to_cpu(rsp->DialectRevision)); le16_to_cpu(rsp->DialectRevision));
rc = -EIO; rc = -EIO;
goto neg_exit; goto neg_exit;
} }
@ -419,35 +419,34 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
security_blob = smb2_get_data_area_len(&blob_offset, &blob_length, security_blob = smb2_get_data_area_len(&blob_offset, &blob_length,
&rsp->hdr); &rsp->hdr);
if (blob_length == 0) { if (blob_length == 0) {
cERROR(1, "missing security blob on negprot"); cifs_dbg(VFS, "missing security blob on negprot\n");
rc = -EIO; rc = -EIO;
goto neg_exit; goto neg_exit;
} }
cFYI(1, "sec_flags 0x%x", sec_flags); cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags);
if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) {
cFYI(1, "Signing required"); cifs_dbg(FYI, "Signing required\n");
if (!(server->sec_mode & (SMB2_NEGOTIATE_SIGNING_REQUIRED | if (!(server->sec_mode & (SMB2_NEGOTIATE_SIGNING_REQUIRED |
SMB2_NEGOTIATE_SIGNING_ENABLED))) { SMB2_NEGOTIATE_SIGNING_ENABLED))) {
cERROR(1, "signing required but server lacks support"); cifs_dbg(VFS, "signing required but server lacks support\n");
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto neg_exit; goto neg_exit;
} }
server->sec_mode |= SECMODE_SIGN_REQUIRED; server->sec_mode |= SECMODE_SIGN_REQUIRED;
} else if (sec_flags & CIFSSEC_MAY_SIGN) { } else if (sec_flags & CIFSSEC_MAY_SIGN) {
cFYI(1, "Signing optional"); cifs_dbg(FYI, "Signing optional\n");
if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) { if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) {
cFYI(1, "Server requires signing"); cifs_dbg(FYI, "Server requires signing\n");
server->sec_mode |= SECMODE_SIGN_REQUIRED; server->sec_mode |= SECMODE_SIGN_REQUIRED;
} else { } else {
server->sec_mode &= server->sec_mode &=
~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED);
} }
} else { } else {
cFYI(1, "Signing disabled"); cifs_dbg(FYI, "Signing disabled\n");
if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) { if (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) {
cERROR(1, "Server requires packet signing to be enabled" cifs_dbg(VFS, "Server requires packet signing to be enabled in /proc/fs/cifs/SecurityFlags\n");
" in /proc/fs/cifs/SecurityFlags.");
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto neg_exit; goto neg_exit;
} }
@ -489,7 +488,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
char *ntlmssp_blob = NULL; char *ntlmssp_blob = NULL;
bool use_spnego = false; /* else use raw ntlmssp */ bool use_spnego = false; /* else use raw ntlmssp */
cFYI(1, "Session Setup"); cifs_dbg(FYI, "Session Setup\n");
if (ses->server) if (ses->server)
server = ses->server; server = ses->server;
@ -522,7 +521,7 @@ ssetup_ntlmssp_authenticate:
else /* if override flags set only sign/seal OR them with global auth */ else /* if override flags set only sign/seal OR them with global auth */
sec_flags = global_secflags | ses->overrideSecFlg; sec_flags = global_secflags | ses->overrideSecFlg;
cFYI(1, "sec_flags 0x%x", sec_flags); cifs_dbg(FYI, "sec_flags 0x%x\n", sec_flags);
req->hdr.SessionId = 0; /* First session, not a reauthenticate */ req->hdr.SessionId = 0; /* First session, not a reauthenticate */
req->VcNumber = 0; /* MBZ */ req->VcNumber = 0; /* MBZ */
@ -558,7 +557,7 @@ ssetup_ntlmssp_authenticate:
sizeof(struct _NEGOTIATE_MESSAGE), sizeof(struct _NEGOTIATE_MESSAGE),
ntlmssp_blob); */ ntlmssp_blob); */
/* BB eventually need to add this */ /* BB eventually need to add this */
cERROR(1, "spnego not supported for SMB2 yet"); cifs_dbg(VFS, "spnego not supported for SMB2 yet\n");
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
kfree(ntlmssp_blob); kfree(ntlmssp_blob);
goto ssetup_exit; goto ssetup_exit;
@ -572,14 +571,14 @@ ssetup_ntlmssp_authenticate:
ntlmssp_blob = kzalloc(sizeof(struct _NEGOTIATE_MESSAGE) + 500, ntlmssp_blob = kzalloc(sizeof(struct _NEGOTIATE_MESSAGE) + 500,
GFP_KERNEL); GFP_KERNEL);
if (ntlmssp_blob == NULL) { if (ntlmssp_blob == NULL) {
cERROR(1, "failed to malloc ntlmssp blob");
rc = -ENOMEM; rc = -ENOMEM;
goto ssetup_exit; goto ssetup_exit;
} }
rc = build_ntlmssp_auth_blob(ntlmssp_blob, &blob_length, ses, rc = build_ntlmssp_auth_blob(ntlmssp_blob, &blob_length, ses,
nls_cp); nls_cp);
if (rc) { if (rc) {
cFYI(1, "build_ntlmssp_auth_blob failed %d", rc); cifs_dbg(FYI, "build_ntlmssp_auth_blob failed %d\n",
rc);
goto ssetup_exit; /* BB double check error handling */ goto ssetup_exit; /* BB double check error handling */
} }
if (use_spnego) { if (use_spnego) {
@ -587,7 +586,7 @@ ssetup_ntlmssp_authenticate:
&security_blob, &security_blob,
blob_length, blob_length,
ntlmssp_blob); */ ntlmssp_blob); */
cERROR(1, "spnego not supported for SMB2 yet"); cifs_dbg(VFS, "spnego not supported for SMB2 yet\n");
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
kfree(ntlmssp_blob); kfree(ntlmssp_blob);
goto ssetup_exit; goto ssetup_exit;
@ -595,7 +594,7 @@ ssetup_ntlmssp_authenticate:
security_blob = ntlmssp_blob; security_blob = ntlmssp_blob;
} }
} else { } else {
cERROR(1, "illegal ntlmssp phase"); cifs_dbg(VFS, "illegal ntlmssp phase\n");
rc = -EIO; rc = -EIO;
goto ssetup_exit; goto ssetup_exit;
} }
@ -620,13 +619,13 @@ ssetup_ntlmssp_authenticate:
if (resp_buftype != CIFS_NO_BUFFER && if (resp_buftype != CIFS_NO_BUFFER &&
rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) { rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) {
if (phase != NtLmNegotiate) { if (phase != NtLmNegotiate) {
cERROR(1, "Unexpected more processing error"); cifs_dbg(VFS, "Unexpected more processing error\n");
goto ssetup_exit; goto ssetup_exit;
} }
if (offsetof(struct smb2_sess_setup_rsp, Buffer) - 4 != if (offsetof(struct smb2_sess_setup_rsp, Buffer) - 4 !=
le16_to_cpu(rsp->SecurityBufferOffset)) { le16_to_cpu(rsp->SecurityBufferOffset)) {
cERROR(1, "Invalid security buffer offset %d", cifs_dbg(VFS, "Invalid security buffer offset %d\n",
le16_to_cpu(rsp->SecurityBufferOffset)); le16_to_cpu(rsp->SecurityBufferOffset));
rc = -EIO; rc = -EIO;
goto ssetup_exit; goto ssetup_exit;
} }
@ -667,7 +666,7 @@ SMB2_logoff(const unsigned int xid, struct cifs_ses *ses)
int rc = 0; int rc = 0;
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
cFYI(1, "disconnect session %p", ses); cifs_dbg(FYI, "disconnect session %p\n", ses);
if (ses && (ses->server)) if (ses && (ses->server))
server = ses->server; server = ses->server;
@ -711,7 +710,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
__le16 *unc_path = NULL; __le16 *unc_path = NULL;
cFYI(1, "TCON"); cifs_dbg(FYI, "TCON\n");
if ((ses->server) && tree) if ((ses->server) && tree)
server = ses->server; server = ses->server;
@ -775,15 +774,15 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
} }
if (rsp->ShareType & SMB2_SHARE_TYPE_DISK) if (rsp->ShareType & SMB2_SHARE_TYPE_DISK)
cFYI(1, "connection to disk share"); cifs_dbg(FYI, "connection to disk share\n");
else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) { else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) {
tcon->ipc = true; tcon->ipc = true;
cFYI(1, "connection to pipe share"); cifs_dbg(FYI, "connection to pipe share\n");
} else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) { } else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) {
tcon->print = true; tcon->print = true;
cFYI(1, "connection to printer"); cifs_dbg(FYI, "connection to printer\n");
} else { } else {
cERROR(1, "unknown share type %d", rsp->ShareType); cifs_dbg(VFS, "unknown share type %d\n", rsp->ShareType);
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto tcon_error_exit; goto tcon_error_exit;
} }
@ -797,7 +796,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) &&
((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0))
cERROR(1, "DFS capability contradicts DFS flag"); cifs_dbg(VFS, "DFS capability contradicts DFS flag\n");
tcon_exit: tcon_exit:
free_rsp_buf(resp_buftype, rsp); free_rsp_buf(resp_buftype, rsp);
@ -806,7 +805,7 @@ tcon_exit:
tcon_error_exit: tcon_error_exit:
if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) { if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) {
cERROR(1, "BAD_NETWORK_NAME: %s", tree); cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree);
tcon->bad_network_name = true; tcon->bad_network_name = true;
} }
goto tcon_exit; goto tcon_exit;
@ -820,7 +819,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
struct cifs_ses *ses = tcon->ses; struct cifs_ses *ses = tcon->ses;
cFYI(1, "Tree Disconnect"); cifs_dbg(FYI, "Tree Disconnect\n");
if (ses && (ses->server)) if (ses && (ses->server))
server = ses->server; server = ses->server;
@ -923,7 +922,7 @@ SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path,
int rc = 0; int rc = 0;
int num_iovecs = 2; int num_iovecs = 2;
cFYI(1, "create/open"); cifs_dbg(FYI, "create/open\n");
if (ses && (ses->server)) if (ses && (ses->server))
server = ses->server; server = ses->server;
@ -1049,7 +1048,7 @@ SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
int resp_buftype; int resp_buftype;
int rc = 0; int rc = 0;
cFYI(1, "Close"); cifs_dbg(FYI, "Close\n");
if (ses && (ses->server)) if (ses && (ses->server))
server = ses->server; server = ses->server;
@ -1095,20 +1094,20 @@ validate_buf(unsigned int offset, unsigned int buffer_length,
if (buffer_length < min_buf_size) { if (buffer_length < min_buf_size) {
cERROR(1, "buffer length %d smaller than minimum size %d", cifs_dbg(VFS, "buffer length %d smaller than minimum size %d\n",
buffer_length, min_buf_size); buffer_length, min_buf_size);
return -EINVAL; return -EINVAL;
} }
/* check if beyond RFC1001 maximum length */ /* check if beyond RFC1001 maximum length */
if ((smb_len > 0x7FFFFF) || (buffer_length > 0x7FFFFF)) { if ((smb_len > 0x7FFFFF) || (buffer_length > 0x7FFFFF)) {
cERROR(1, "buffer length %d or smb length %d too large", cifs_dbg(VFS, "buffer length %d or smb length %d too large\n",
buffer_length, smb_len); buffer_length, smb_len);
return -EINVAL; return -EINVAL;
} }
if ((begin_of_buf > end_of_smb) || (end_of_buf > end_of_smb)) { if ((begin_of_buf > end_of_smb) || (end_of_buf > end_of_smb)) {
cERROR(1, "illegal server response, bad offset to data"); cifs_dbg(VFS, "illegal server response, bad offset to data\n");
return -EINVAL; return -EINVAL;
} }
@ -1153,7 +1152,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon,
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
struct cifs_ses *ses = tcon->ses; struct cifs_ses *ses = tcon->ses;
cFYI(1, "Query Info"); cifs_dbg(FYI, "Query Info\n");
if (ses && (ses->server)) if (ses && (ses->server))
server = ses->server; server = ses->server;
@ -1245,7 +1244,7 @@ SMB2_echo(struct TCP_Server_Info *server)
struct smb_rqst rqst = { .rq_iov = &iov, struct smb_rqst rqst = { .rq_iov = &iov,
.rq_nvec = 1 }; .rq_nvec = 1 };
cFYI(1, "In echo request"); cifs_dbg(FYI, "In echo request\n");
rc = small_smb2_init(SMB2_ECHO, NULL, (void **)&req); rc = small_smb2_init(SMB2_ECHO, NULL, (void **)&req);
if (rc) if (rc)
@ -1260,7 +1259,7 @@ SMB2_echo(struct TCP_Server_Info *server)
rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, server, rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, server,
CIFS_ECHO_OP); CIFS_ECHO_OP);
if (rc) if (rc)
cFYI(1, "Echo request failed: %d", rc); cifs_dbg(FYI, "Echo request failed: %d\n", rc);
cifs_small_buf_release(req); cifs_small_buf_release(req);
return rc; return rc;
@ -1277,7 +1276,7 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
int resp_buftype; int resp_buftype;
int rc = 0; int rc = 0;
cFYI(1, "Flush"); cifs_dbg(FYI, "Flush\n");
if (ses && (ses->server)) if (ses && (ses->server))
server = ses->server; server = ses->server;
@ -1377,8 +1376,9 @@ smb2_readv_callback(struct mid_q_entry *mid)
.rq_pagesz = rdata->pagesz, .rq_pagesz = rdata->pagesz,
.rq_tailsz = rdata->tailsz }; .rq_tailsz = rdata->tailsz };
cFYI(1, "%s: mid=%llu state=%d result=%d bytes=%u", __func__, cifs_dbg(FYI, "%s: mid=%llu state=%d result=%d bytes=%u\n",
mid->mid, mid->mid_state, rdata->result, rdata->bytes); __func__, mid->mid, mid->mid_state, rdata->result,
rdata->bytes);
switch (mid->mid_state) { switch (mid->mid_state) {
case MID_RESPONSE_RECEIVED: case MID_RESPONSE_RECEIVED:
@ -1390,8 +1390,8 @@ smb2_readv_callback(struct mid_q_entry *mid)
rc = smb2_verify_signature(&rqst, server); rc = smb2_verify_signature(&rqst, server);
if (rc) if (rc)
cERROR(1, "SMB signature verification returned " cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
"error = %d", rc); rc);
} }
/* FIXME: should this be counted toward the initiating task? */ /* FIXME: should this be counted toward the initiating task? */
task_io_account_read(rdata->bytes); task_io_account_read(rdata->bytes);
@ -1424,8 +1424,8 @@ smb2_async_readv(struct cifs_readdata *rdata)
struct smb_rqst rqst = { .rq_iov = &rdata->iov, struct smb_rqst rqst = { .rq_iov = &rdata->iov,
.rq_nvec = 1 }; .rq_nvec = 1 };
cFYI(1, "%s: offset=%llu bytes=%u", __func__, cifs_dbg(FYI, "%s: offset=%llu bytes=%u\n",
rdata->offset, rdata->bytes); __func__, rdata->offset, rdata->bytes);
io_parms.tcon = tlink_tcon(rdata->cfile->tlink); io_parms.tcon = tlink_tcon(rdata->cfile->tlink);
io_parms.offset = rdata->offset; io_parms.offset = rdata->offset;
@ -1479,13 +1479,13 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
if (rc) { if (rc) {
cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE); cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE);
cERROR(1, "Send error in read = %d", rc); cifs_dbg(VFS, "Send error in read = %d\n", rc);
} else { } else {
*nbytes = le32_to_cpu(rsp->DataLength); *nbytes = le32_to_cpu(rsp->DataLength);
if ((*nbytes > CIFS_MAX_MSGSIZE) || if ((*nbytes > CIFS_MAX_MSGSIZE) ||
(*nbytes > io_parms->length)) { (*nbytes > io_parms->length)) {
cFYI(1, "bad length %d for count %d", *nbytes, cifs_dbg(FYI, "bad length %d for count %d\n",
io_parms->length); *nbytes, io_parms->length);
rc = -EIO; rc = -EIO;
*nbytes = 0; *nbytes = 0;
} }
@ -1595,7 +1595,8 @@ smb2_async_writev(struct cifs_writedata *wdata)
rqst.rq_pagesz = wdata->pagesz; rqst.rq_pagesz = wdata->pagesz;
rqst.rq_tailsz = wdata->tailsz; rqst.rq_tailsz = wdata->tailsz;
cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); cifs_dbg(FYI, "async write at %llu %u bytes\n",
wdata->offset, wdata->bytes);
req->Length = cpu_to_le32(wdata->bytes); req->Length = cpu_to_le32(wdata->bytes);
@ -1668,7 +1669,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
if (rc) { if (rc) {
cifs_stats_fail_inc(io_parms->tcon, SMB2_WRITE_HE); cifs_stats_fail_inc(io_parms->tcon, SMB2_WRITE_HE);
cERROR(1, "Send error in write = %d", rc); cifs_dbg(VFS, "Send error in write = %d\n", rc);
} else } else
*nbytes = le32_to_cpu(rsp->DataLength); *nbytes = le32_to_cpu(rsp->DataLength);
@ -1694,14 +1695,14 @@ num_entries(char *bufstart, char *end_of_buf, char **lastentry, size_t size)
((char *)entryptr + next_offset); ((char *)entryptr + next_offset);
if ((char *)entryptr + size > end_of_buf) { if ((char *)entryptr + size > end_of_buf) {
cERROR(1, "malformed search entry would overflow"); cifs_dbg(VFS, "malformed search entry would overflow\n");
break; break;
} }
len = le32_to_cpu(entryptr->FileNameLength); len = le32_to_cpu(entryptr->FileNameLength);
if ((char *)entryptr + len + size > end_of_buf) { if ((char *)entryptr + len + size > end_of_buf) {
cERROR(1, "directory entry name would overflow frame " cifs_dbg(VFS, "directory entry name would overflow frame end of buf %p\n",
"end of buf %p", end_of_buf); end_of_buf);
break; break;
} }
@ -1757,8 +1758,8 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
info_buf_size = sizeof(SEARCH_ID_FULL_DIR_INFO) - 1; info_buf_size = sizeof(SEARCH_ID_FULL_DIR_INFO) - 1;
break; break;
default: default:
cERROR(1, "info level %u isn't supported", cifs_dbg(VFS, "info level %u isn't supported\n",
srch_inf->info_level); srch_inf->info_level);
rc = -EINVAL; rc = -EINVAL;
goto qdir_exit; goto qdir_exit;
} }
@ -1822,15 +1823,15 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
num_entries(srch_inf->srch_entries_start, end_of_smb, num_entries(srch_inf->srch_entries_start, end_of_smb,
&srch_inf->last_entry, info_buf_size); &srch_inf->last_entry, info_buf_size);
srch_inf->index_of_last_entry += srch_inf->entries_in_buffer; srch_inf->index_of_last_entry += srch_inf->entries_in_buffer;
cFYI(1, "num entries %d last_index %lld srch start %p srch end %p", cifs_dbg(FYI, "num entries %d last_index %lld srch start %p srch end %p\n",
srch_inf->entries_in_buffer, srch_inf->index_of_last_entry, srch_inf->entries_in_buffer, srch_inf->index_of_last_entry,
srch_inf->srch_entries_start, srch_inf->last_entry); srch_inf->srch_entries_start, srch_inf->last_entry);
if (resp_buftype == CIFS_LARGE_BUFFER) if (resp_buftype == CIFS_LARGE_BUFFER)
srch_inf->smallBuf = false; srch_inf->smallBuf = false;
else if (resp_buftype == CIFS_SMALL_BUFFER) else if (resp_buftype == CIFS_SMALL_BUFFER)
srch_inf->smallBuf = true; srch_inf->smallBuf = true;
else else
cERROR(1, "illegal search buffer type"); cifs_dbg(VFS, "illegal search buffer type\n");
if (rsp->hdr.Status == STATUS_NO_MORE_FILES) if (rsp->hdr.Status == STATUS_NO_MORE_FILES)
srch_inf->endOfSearch = 1; srch_inf->endOfSearch = 1;
@ -2015,7 +2016,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon,
int rc; int rc;
struct smb2_oplock_break *req = NULL; struct smb2_oplock_break *req = NULL;
cFYI(1, "SMB2_oplock_break"); cifs_dbg(FYI, "SMB2_oplock_break\n");
rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req); rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req);
if (rc) if (rc)
@ -2031,7 +2032,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon,
if (rc) { if (rc) {
cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE);
cFYI(1, "Send error in Oplock Break = %d", rc); cifs_dbg(FYI, "Send error in Oplock Break = %d\n", rc);
} }
return rc; return rc;
@ -2056,7 +2057,7 @@ build_qfs_info_req(struct kvec *iov, struct cifs_tcon *tcon, int level,
int rc; int rc;
struct smb2_query_info_req *req; struct smb2_query_info_req *req;
cFYI(1, "Query FSInfo level %d", level); cifs_dbg(FYI, "Query FSInfo level %d\n", level);
if ((tcon->ses == NULL) || (tcon->ses->server == NULL)) if ((tcon->ses == NULL) || (tcon->ses->server == NULL))
return -EIO; return -EIO;
@ -2129,7 +2130,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon,
int resp_buf_type; int resp_buf_type;
unsigned int count; unsigned int count;
cFYI(1, "smb2_lockv num lock %d", num_lock); cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock);
rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req);
if (rc) if (rc)
@ -2153,7 +2154,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon,
cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP);
if (rc) { if (rc) {
cFYI(1, "Send error in smb2_lockv = %d", rc); cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc);
cifs_stats_fail_inc(tcon, SMB2_LOCK_HE); cifs_stats_fail_inc(tcon, SMB2_LOCK_HE);
} }
@ -2184,7 +2185,7 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon,
int rc; int rc;
struct smb2_lease_ack *req = NULL; struct smb2_lease_ack *req = NULL;
cFYI(1, "SMB2_lease_break"); cifs_dbg(FYI, "SMB2_lease_break\n");
rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req); rc = small_smb2_init(SMB2_OPLOCK_BREAK, tcon, (void **) &req);
if (rc) if (rc)
@ -2202,7 +2203,7 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon,
if (rc) { if (rc) {
cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE);
cFYI(1, "Send error in Lease Break = %d", rc); cifs_dbg(FYI, "Send error in Lease Break = %d\n", rc);
} }
return rc; return rc;

Просмотреть файл

@ -55,13 +55,13 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
rc = crypto_shash_setkey(server->secmech.hmacsha256, rc = crypto_shash_setkey(server->secmech.hmacsha256,
server->session_key.response, SMB2_NTLMV2_SESSKEY_SIZE); server->session_key.response, SMB2_NTLMV2_SESSKEY_SIZE);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with response\n", __func__); cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
return rc; return rc;
} }
rc = crypto_shash_init(&server->secmech.sdeschmacsha256->shash); rc = crypto_shash_init(&server->secmech.sdeschmacsha256->shash);
if (rc) { if (rc) {
cERROR(1, "%s: Could not init md5\n", __func__); cifs_dbg(VFS, "%s: Could not init md5\n", __func__);
return rc; return rc;
} }
@ -69,7 +69,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
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"); cifs_dbg(VFS, "null iovec entry\n");
return -EIO; return -EIO;
} }
/* /*
@ -90,8 +90,8 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
iov[i].iov_base, iov[i].iov_len); iov[i].iov_base, iov[i].iov_len);
} }
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with payload\n", cifs_dbg(VFS, "%s: Could not update with payload\n",
__func__); __func__);
return rc; return rc;
} }
} }
@ -109,7 +109,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash, rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash,
sigptr); sigptr);
if (rc) if (rc)
cERROR(1, "%s: Could not generate sha256 hash\n", __func__); cifs_dbg(VFS, "%s: Could not generate sha256 hash\n", __func__);
memcpy(smb2_pdu->Signature, sigptr, SMB2_SIGNATURE_SIZE); memcpy(smb2_pdu->Signature, sigptr, SMB2_SIGNATURE_SIZE);
@ -119,7 +119,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
int int
smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
{ {
cFYI(1, "smb3 signatures not supported yet"); cifs_dbg(FYI, "smb3 signatures not supported yet\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
@ -163,8 +163,8 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
/* Do not need to verify session setups with signature "BSRSPYL " */ /* Do not need to verify session setups with signature "BSRSPYL " */
if (memcmp(smb2_pdu->Signature, "BSRSPYL ", 8) == 0) if (memcmp(smb2_pdu->Signature, "BSRSPYL ", 8) == 0)
cFYI(1, "dummy signature received for smb command 0x%x", cifs_dbg(FYI, "dummy signature received for smb command 0x%x\n",
smb2_pdu->Command); smb2_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
@ -205,7 +205,7 @@ smb2_mid_entry_alloc(const struct smb2_hdr *smb_buffer,
struct mid_q_entry *temp; struct mid_q_entry *temp;
if (server == NULL) { if (server == NULL) {
cERROR(1, "Null TCP session in smb2_mid_entry_alloc"); cifs_dbg(VFS, "Null TCP session in smb2_mid_entry_alloc\n");
return NULL; return NULL;
} }
@ -241,7 +241,7 @@ smb2_get_mid_entry(struct cifs_ses *ses, struct smb2_hdr *buf,
return -ENOENT; return -ENOENT;
if (ses->server->tcpStatus == CifsNeedReconnect) { if (ses->server->tcpStatus == CifsNeedReconnect) {
cFYI(1, "tcp session dead - return to caller to retry"); cifs_dbg(FYI, "tcp session dead - return to caller to retry\n");
return -EAGAIN; return -EAGAIN;
} }
@ -281,8 +281,8 @@ smb2_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
rc = smb2_verify_signature(&rqst, server); rc = smb2_verify_signature(&rqst, server);
if (rc) if (rc)
cERROR(1, "SMB signature verification returned error = " cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
"%d", rc); rc);
} }
return map_smb2_to_linux_error(mid->resp_buf, log_error); return map_smb2_to_linux_error(mid->resp_buf, log_error);

Просмотреть файл

@ -78,7 +78,7 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
tfm_des = crypto_alloc_blkcipher("ecb(des)", 0, CRYPTO_ALG_ASYNC); tfm_des = crypto_alloc_blkcipher("ecb(des)", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(tfm_des)) { if (IS_ERR(tfm_des)) {
rc = PTR_ERR(tfm_des); rc = PTR_ERR(tfm_des);
cERROR(1, "could not allocate des crypto API"); cifs_dbg(VFS, "could not allocate des crypto API\n");
goto smbhash_err; goto smbhash_err;
} }
@ -91,7 +91,7 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, 8); rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, 8);
if (rc) if (rc)
cERROR(1, "could not encrypt crypt key rc: %d", rc); cifs_dbg(VFS, "could not encrypt crypt key rc: %d\n", rc);
crypto_free_blkcipher(tfm_des); crypto_free_blkcipher(tfm_des);
smbhash_err: smbhash_err:
@ -139,14 +139,14 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len)
md4 = crypto_alloc_shash("md4", 0, 0); md4 = crypto_alloc_shash("md4", 0, 0);
if (IS_ERR(md4)) { if (IS_ERR(md4)) {
rc = PTR_ERR(md4); rc = PTR_ERR(md4);
cERROR(1, "%s: Crypto md4 allocation error %d", __func__, rc); cifs_dbg(VFS, "%s: Crypto md4 allocation error %d\n",
__func__, rc);
return rc; return rc;
} }
size = sizeof(struct shash_desc) + crypto_shash_descsize(md4); size = sizeof(struct shash_desc) + crypto_shash_descsize(md4);
sdescmd4 = kmalloc(size, GFP_KERNEL); sdescmd4 = kmalloc(size, GFP_KERNEL);
if (!sdescmd4) { if (!sdescmd4) {
rc = -ENOMEM; rc = -ENOMEM;
cERROR(1, "%s: Memory allocation failure", __func__);
goto mdfour_err; goto mdfour_err;
} }
sdescmd4->shash.tfm = md4; sdescmd4->shash.tfm = md4;
@ -154,17 +154,17 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len)
rc = crypto_shash_init(&sdescmd4->shash); rc = crypto_shash_init(&sdescmd4->shash);
if (rc) { if (rc) {
cERROR(1, "%s: Could not init md4 shash", __func__); cifs_dbg(VFS, "%s: Could not init md4 shash\n", __func__);
goto mdfour_err; goto mdfour_err;
} }
rc = crypto_shash_update(&sdescmd4->shash, link_str, link_len); rc = crypto_shash_update(&sdescmd4->shash, link_str, link_len);
if (rc) { if (rc) {
cERROR(1, "%s: Could not update with link_str", __func__); cifs_dbg(VFS, "%s: Could not update with link_str\n", __func__);
goto mdfour_err; goto mdfour_err;
} }
rc = crypto_shash_final(&sdescmd4->shash, md4_hash); rc = crypto_shash_final(&sdescmd4->shash, md4_hash);
if (rc) if (rc)
cERROR(1, "%s: Could not genereate md4 hash", __func__); cifs_dbg(VFS, "%s: Could not generate md4 hash\n", __func__);
mdfour_err: mdfour_err:
crypto_free_shash(md4); crypto_free_shash(md4);
@ -238,7 +238,8 @@ SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24,
rc = E_md4hash(passwd, p16, codepage); rc = E_md4hash(passwd, p16, codepage);
if (rc) { if (rc) {
cFYI(1, "%s Can't generate NT hash, error: %d", __func__, rc); cifs_dbg(FYI, "%s Can't generate NT hash, error: %d\n",
__func__, rc);
return rc; return rc;
} }
memcpy(p21, p16, 16); memcpy(p21, p16, 16);

Просмотреть файл

@ -49,7 +49,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"); cifs_dbg(VFS, "Null TCP session in AllocMidQEntry\n");
return NULL; return NULL;
} }
@ -61,7 +61,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 = cpu_to_le16(smb_buffer->Command); temp->command = cpu_to_le16(smb_buffer->Command);
cFYI(1, "For smb_command %d", smb_buffer->Command); cifs_dbg(FYI, "For smb_command %d\n", smb_buffer->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;
@ -188,8 +188,8 @@ smb_send_kvec(struct TCP_Server_Info *server, struct kvec *iov, size_t n_vec,
WARN_ON_ONCE(rc == -ENOSPC); WARN_ON_ONCE(rc == -ENOSPC);
i++; i++;
if (i >= 14 || (!server->noblocksnd && (i > 2))) { if (i >= 14 || (!server->noblocksnd && (i > 2))) {
cERROR(1, "sends on sock %p stuck for 15 " cifs_dbg(VFS, "sends on sock %p stuck for 15 seconds\n",
"seconds", ssocket); ssocket);
rc = -EAGAIN; rc = -EAGAIN;
break; break;
} }
@ -209,14 +209,14 @@ smb_send_kvec(struct TCP_Server_Info *server, struct kvec *iov, size_t n_vec,
} }
if (rc > remaining) { if (rc > remaining) {
cERROR(1, "sent %d requested %d", rc, remaining); cifs_dbg(VFS, "sent %d requested %d\n", rc, remaining);
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"); cifs_dbg(VFS, "tcp sent no data\n");
msleep(500); msleep(500);
continue; continue;
} }
@ -291,7 +291,7 @@ smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst)
if (ssocket == NULL) if (ssocket == NULL)
return -ENOTSOCK; return -ENOTSOCK;
cFYI(1, "Sending smb: smb_len=%u", smb_buf_length); cifs_dbg(FYI, "Sending smb: smb_len=%u\n", smb_buf_length);
dump_smb(iov[0].iov_base, iov[0].iov_len); dump_smb(iov[0].iov_base, iov[0].iov_len);
/* cork the socket */ /* cork the socket */
@ -324,8 +324,8 @@ uncork:
(char *)&val, sizeof(val)); (char *)&val, sizeof(val));
if ((total_len > 0) && (total_len != smb_buf_length + 4)) { if ((total_len > 0) && (total_len != smb_buf_length + 4)) {
cFYI(1, "partial send (wanted=%u sent=%zu): terminating " cifs_dbg(FYI, "partial send (wanted=%u sent=%zu): terminating session\n",
"session", smb_buf_length + 4, total_len); smb_buf_length + 4, total_len);
/* /*
* If we have only sent part of an SMB then the next SMB could * If we have only sent part of an SMB then the next SMB could
* be taken as the remainder of this one. We need to kill the * be taken as the remainder of this one. We need to kill the
@ -335,7 +335,8 @@ uncork:
} }
if (rc < 0 && rc != -EINTR) if (rc < 0 && rc != -EINTR)
cERROR(1, "Error %d sending data on socket to server", rc); cifs_dbg(VFS, "Error %d sending data on socket to server\n",
rc);
else else
rc = 0; rc = 0;
@ -427,7 +428,7 @@ static int allocate_mid(struct cifs_ses *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"); cifs_dbg(FYI, "tcp session dead - return to caller to retry\n");
return -EAGAIN; return -EAGAIN;
} }
@ -559,7 +560,7 @@ SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
iov[0].iov_len = get_rfc1002_length(in_buf) + 4; iov[0].iov_len = get_rfc1002_length(in_buf) + 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); cifs_dbg(NOISY, "SendRcvNoRsp flags %d rc %d\n", flags, rc);
return rc; return rc;
} }
@ -569,8 +570,8 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
{ {
int rc = 0; int rc = 0;
cFYI(1, "%s: cmd=%d mid=%llu state=%d", __func__, cifs_dbg(FYI, "%s: cmd=%d mid=%llu state=%d\n",
le16_to_cpu(mid->command), mid->mid, mid->mid_state); __func__, le16_to_cpu(mid->command), mid->mid, mid->mid_state);
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
switch (mid->mid_state) { switch (mid->mid_state) {
@ -588,8 +589,8 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
break; break;
default: default:
list_del_init(&mid->qhead); list_del_init(&mid->qhead);
cERROR(1, "%s: invalid mid state mid=%llu state=%d", __func__, cifs_dbg(VFS, "%s: invalid mid state mid=%llu state=%d\n",
mid->mid, mid->mid_state); __func__, mid->mid, mid->mid_state);
rc = -EIO; rc = -EIO;
} }
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
@ -626,8 +627,8 @@ cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
rc = cifs_verify_signature(&rqst, server, rc = cifs_verify_signature(&rqst, server,
mid->sequence_number + 1); mid->sequence_number + 1);
if (rc) if (rc)
cERROR(1, "SMB signature verification returned error = " cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
"%d", rc); rc);
} }
/* BB special case reconnect tid and uid here? */ /* BB special case reconnect tid and uid here? */
@ -672,7 +673,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
if ((ses == NULL) || (ses->server == NULL)) { if ((ses == NULL) || (ses->server == NULL)) {
cifs_small_buf_release(buf); cifs_small_buf_release(buf);
cERROR(1, "Null session"); cifs_dbg(VFS, "Null session\n");
return -EIO; return -EIO;
} }
@ -752,7 +753,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
if (!midQ->resp_buf || midQ->mid_state != MID_RESPONSE_RECEIVED) { if (!midQ->resp_buf || midQ->mid_state != MID_RESPONSE_RECEIVED) {
rc = -EIO; rc = -EIO;
cFYI(1, "Bad MID state?"); cifs_dbg(FYI, "Bad MID state?\n");
goto out; goto out;
} }
@ -788,11 +789,11 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
struct mid_q_entry *midQ; struct mid_q_entry *midQ;
if (ses == NULL) { if (ses == NULL) {
cERROR(1, "Null smb session"); cifs_dbg(VFS, "Null smb session\n");
return -EIO; return -EIO;
} }
if (ses->server == NULL) { if (ses->server == NULL) {
cERROR(1, "Null tcp session"); cifs_dbg(VFS, "Null tcp session\n");
return -EIO; return -EIO;
} }
@ -805,8 +806,8 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize + if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize +
MAX_CIFS_HDR_SIZE - 4) { MAX_CIFS_HDR_SIZE - 4) {
cERROR(1, "Illegal length, greater than maximum frame, %d", cifs_dbg(VFS, "Illegal length, greater than maximum frame, %d\n",
be32_to_cpu(in_buf->smb_buf_length)); be32_to_cpu(in_buf->smb_buf_length));
return -EIO; return -EIO;
} }
@ -871,7 +872,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
if (!midQ->resp_buf || !out_buf || if (!midQ->resp_buf || !out_buf ||
midQ->mid_state != MID_RESPONSE_RECEIVED) { midQ->mid_state != MID_RESPONSE_RECEIVED) {
rc = -EIO; rc = -EIO;
cERROR(1, "Bad MID state?"); cifs_dbg(VFS, "Bad MID state?\n");
goto out; goto out;
} }
@ -921,13 +922,13 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
struct cifs_ses *ses; struct cifs_ses *ses;
if (tcon == NULL || tcon->ses == NULL) { if (tcon == NULL || tcon->ses == NULL) {
cERROR(1, "Null smb session"); cifs_dbg(VFS, "Null smb session\n");
return -EIO; return -EIO;
} }
ses = tcon->ses; ses = tcon->ses;
if (ses->server == NULL) { if (ses->server == NULL) {
cERROR(1, "Null tcp session"); cifs_dbg(VFS, "Null tcp session\n");
return -EIO; return -EIO;
} }
@ -940,8 +941,8 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize + if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize +
MAX_CIFS_HDR_SIZE - 4) { MAX_CIFS_HDR_SIZE - 4) {
cERROR(1, "Illegal length, greater than maximum frame, %d", cifs_dbg(VFS, "Illegal length, greater than maximum frame, %d\n",
be32_to_cpu(in_buf->smb_buf_length)); be32_to_cpu(in_buf->smb_buf_length));
return -EIO; return -EIO;
} }
@ -1038,7 +1039,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
/* rcvd frame is ok */ /* rcvd frame is ok */
if (out_buf == NULL || midQ->mid_state != MID_RESPONSE_RECEIVED) { if (out_buf == NULL || midQ->mid_state != MID_RESPONSE_RECEIVED) {
rc = -EIO; rc = -EIO;
cERROR(1, "Bad MID state?"); cifs_dbg(VFS, "Bad MID state?\n");
goto out; goto out;
} }

Просмотреть файл

@ -68,12 +68,12 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
goto remove_ea_exit; goto remove_ea_exit;
} }
if (ea_name == NULL) { if (ea_name == NULL) {
cFYI(1, "Null xattr names not supported"); cifs_dbg(FYI, "Null xattr names not supported\n");
} else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)
&& (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))) { && (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))) {
cFYI(1, cifs_dbg(FYI,
"illegal xattr request %s (only user namespace supported)", "illegal xattr request %s (only user namespace supported)\n",
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? */
@ -134,19 +134,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"); cifs_dbg(FYI, "size of EA value too large\n");
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto set_ea_exit; goto set_ea_exit;
} }
if (ea_name == NULL) { if (ea_name == NULL) {
cFYI(1, "Null xattr names not supported"); cifs_dbg(FYI, "Null xattr names not supported\n");
} else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)
== 0) { == 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"); cifs_dbg(FYI, "attempt to set cifs inode metadata\n");
ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */ ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value, rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
@ -167,8 +167,6 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
struct cifs_ntsd *pacl; struct cifs_ntsd *pacl;
pacl = kmalloc(value_size, GFP_KERNEL); pacl = kmalloc(value_size, GFP_KERNEL);
if (!pacl) { if (!pacl) {
cFYI(1, "%s: Can't allocate memory for ACL",
__func__);
rc = -ENOMEM; rc = -ENOMEM;
} else { } else {
memcpy(pacl, ea_value, value_size); memcpy(pacl, ea_value, value_size);
@ -179,7 +177,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
kfree(pacl); kfree(pacl);
} }
#else #else
cFYI(1, "Set CIFS ACL not supported yet"); cifs_dbg(FYI, "Set CIFS ACL not supported yet\n");
#endif /* CONFIG_CIFS_ACL */ #endif /* CONFIG_CIFS_ACL */
} else { } else {
int temp; int temp;
@ -193,9 +191,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); cifs_dbg(FYI, "set POSIX ACL rc %d\n", rc);
#else #else
cFYI(1, "set POSIX ACL not supported"); cifs_dbg(FYI, "set POSIX ACL not supported\n");
#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) {
@ -206,13 +204,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); cifs_dbg(FYI, "set POSIX default ACL rc %d\n", rc);
#else #else
cFYI(1, "set default POSIX ACL not supported"); cifs_dbg(FYI, "set default POSIX ACL not supported\n");
#endif #endif
} else { } else {
cFYI(1, "illegal xattr request %s (only user namespace" cifs_dbg(FYI, "illegal xattr request %s (only user namespace supported)\n",
" 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? */
@ -263,14 +261,14 @@ 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"); cifs_dbg(FYI, "Null xattr names not supported\n");
} else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) } else if (strncmp(ea_name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)
== 0) { == 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"); cifs_dbg(FYI, "attempt to query cifs inode metadata\n");
/* 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 += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */ ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
@ -295,7 +293,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
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 ACL not supported yet"); cifs_dbg(FYI, "Query POSIX ACL not supported yet\n");
#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) {
@ -307,7 +305,7 @@ 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"); cifs_dbg(FYI, "Query POSIX default ACL not supported yet\n");
#endif /* CONFIG_CIFS_POSIX */ #endif /* CONFIG_CIFS_POSIX */
} else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL, } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL,
strlen(CIFS_XATTR_CIFS_ACL)) == 0) { strlen(CIFS_XATTR_CIFS_ACL)) == 0) {
@ -319,8 +317,8 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
full_path, &acllen); full_path, &acllen);
if (IS_ERR(pacl)) { if (IS_ERR(pacl)) {
rc = PTR_ERR(pacl); rc = PTR_ERR(pacl);
cERROR(1, "%s: error %zd getting sec desc", cifs_dbg(VFS, "%s: error %zd getting sec desc\n",
__func__, rc); __func__, rc);
} else { } else {
if (ea_value) { if (ea_value) {
if (acllen > buf_size) if (acllen > buf_size)
@ -332,18 +330,18 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
kfree(pacl); kfree(pacl);
} }
#else #else
cFYI(1, "Query CIFS ACL not supported yet"); cifs_dbg(FYI, "Query CIFS ACL not supported yet\n");
#endif /* CONFIG_CIFS_ACL */ #endif /* CONFIG_CIFS_ACL */
} else if (strncmp(ea_name, } else if (strncmp(ea_name,
XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) { XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) {
cFYI(1, "Trusted xattr namespace not supported yet"); cifs_dbg(FYI, "Trusted xattr namespace not supported yet\n");
} else if (strncmp(ea_name, } else if (strncmp(ea_name,
XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) { XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) {
cFYI(1, "Security xattr namespace not supported yet"); cifs_dbg(FYI, "Security xattr namespace not supported yet\n");
} else } else
cFYI(1, cifs_dbg(FYI,
"illegal xattr request %s (only user namespace supported)", "illegal xattr request %s (only user namespace supported)\n",
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