Commit a0a3036b authored by Joe Perches's avatar Joe Perches Committed by Steve French

cifs: Standardize logging output

Use pr_fmt to standardize all logging for fs/cifs.

Some logging output had no CIFS: specific prefix.

Now all output has one of three prefixes:

o CIFS:
o CIFS: VFS:
o Root-CIFS:

Miscellanea:

o Convert printks to pr_<level>
o Neaten macro definitions
o Remove embedded CIFS: prefixes from formats
o Convert "illegal" to "invalid"
o Coalesce formats
o Add missing '\n' format terminations
o Consolidate multiple cifs_dbg continuations into single calls
o More consistent use of upper case first word output logging
o Multiline statement argument alignment and wrapping
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 82e9367c
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
#ifndef _H_CIFS_DEBUG #ifndef _H_CIFS_DEBUG
#define _H_CIFS_DEBUG #define _H_CIFS_DEBUG
#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) "CIFS: " fmt
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 *buf, struct TCP_Server_Info *ptcp_info); void cifs_dump_detail(void *buf, struct TCP_Server_Info *ptcp_info);
void cifs_dump_mids(struct TCP_Server_Info *); void cifs_dump_mids(struct TCP_Server_Info *);
...@@ -46,92 +52,81 @@ extern int cifsFYI; ...@@ -46,92 +52,81 @@ extern int cifsFYI;
*/ */
/* Information level messages, minor events */ /* Information level messages, minor events */
#define cifs_info_func(ratefunc, fmt, ...) \ #define cifs_info_func(ratefunc, fmt, ...) \
do { \ pr_info_ ## ratefunc(fmt, ##__VA_ARGS__)
pr_info_ ## ratefunc("CIFS: " fmt, ##__VA_ARGS__); \
} while (0)
#define cifs_info(fmt, ...) \ #define cifs_info(fmt, ...) \
do { \ cifs_info_func(ratelimited, fmt, ##__VA_ARGS__)
cifs_info_func(ratelimited, fmt, ##__VA_ARGS__); \
} while (0)
/* information message: e.g., configuration, major event */ /* information message: e.g., configuration, major event */
#define cifs_dbg_func(ratefunc, type, fmt, ...) \ #define cifs_dbg_func(ratefunc, type, fmt, ...) \
do { \ do { \
if ((type) & FYI && cifsFYI & CIFS_INFO) { \ if ((type) & FYI && cifsFYI & CIFS_INFO) { \
pr_debug_ ## ratefunc("%s: " \ pr_debug_ ## ratefunc("%s: " fmt, \
fmt, __FILE__, ##__VA_ARGS__); \ __FILE__, ##__VA_ARGS__); \
} else if ((type) & VFS) { \ } else if ((type) & VFS) { \
pr_err_ ## ratefunc("CIFS VFS: " \ pr_err_ ## ratefunc("VFS: " fmt, ##__VA_ARGS__); \
fmt, ##__VA_ARGS__); \ } else if ((type) & NOISY && (NOISY != 0)) { \
} else if ((type) & NOISY && (NOISY != 0)) { \ pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \
pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \ } \
} \
} while (0) } while (0)
#define cifs_dbg(type, fmt, ...) \ #define cifs_dbg(type, fmt, ...) \
do { \ do { \
if ((type) & ONCE) \ if ((type) & ONCE) \
cifs_dbg_func(once, \ cifs_dbg_func(once, type, fmt, ##__VA_ARGS__); \
type, fmt, ##__VA_ARGS__); \ else \
else \ cifs_dbg_func(ratelimited, type, fmt, ##__VA_ARGS__); \
cifs_dbg_func(ratelimited, \
type, fmt, ##__VA_ARGS__); \
} while (0) } while (0)
#define cifs_server_dbg_func(ratefunc, type, fmt, ...) \ #define cifs_server_dbg_func(ratefunc, type, fmt, ...) \
do { \ do { \
const char *sn = ""; \ const char *sn = ""; \
if (server && server->hostname) \ if (server && server->hostname) \
sn = server->hostname; \ sn = server->hostname; \
if ((type) & FYI && cifsFYI & CIFS_INFO) { \ if ((type) & FYI && cifsFYI & CIFS_INFO) { \
pr_debug_ ## ratefunc("%s: \\\\%s " fmt, \ pr_debug_ ## ratefunc("%s: \\\\%s " fmt, \
__FILE__, sn, ##__VA_ARGS__); \ __FILE__, sn, ##__VA_ARGS__); \
} else if ((type) & VFS) { \ } else if ((type) & VFS) { \
pr_err_ ## ratefunc("CIFS VFS: \\\\%s " fmt, \ pr_err_ ## ratefunc("VFS: \\\\%s " fmt, \
sn, ##__VA_ARGS__); \ sn, ##__VA_ARGS__); \
} else if ((type) & NOISY && (NOISY != 0)) { \ } else if ((type) & NOISY && (NOISY != 0)) { \
pr_debug_ ## ratefunc("\\\\%s " fmt, \ pr_debug_ ## ratefunc("\\\\%s " fmt, \
sn, ##__VA_ARGS__); \ sn, ##__VA_ARGS__); \
} \ } \
} while (0) } while (0)
#define cifs_server_dbg(type, fmt, ...) \ #define cifs_server_dbg(type, fmt, ...) \
do { \ do { \
if ((type) & ONCE) \ if ((type) & ONCE) \
cifs_server_dbg_func(once, \ cifs_server_dbg_func(once, type, fmt, ##__VA_ARGS__); \
type, fmt, ##__VA_ARGS__); \ else \
else \ cifs_server_dbg_func(ratelimited, type, fmt, \
cifs_server_dbg_func(ratelimited, \ ##__VA_ARGS__); \
type, fmt, ##__VA_ARGS__); \
} while (0) } while (0)
#define cifs_tcon_dbg_func(ratefunc, type, fmt, ...) \ #define cifs_tcon_dbg_func(ratefunc, type, fmt, ...) \
do { \ do { \
const char *tn = ""; \ const char *tn = ""; \
if (tcon && tcon->treeName) \ if (tcon && tcon->treeName) \
tn = tcon->treeName; \ tn = tcon->treeName; \
if ((type) & FYI && cifsFYI & CIFS_INFO) { \ if ((type) & FYI && cifsFYI & CIFS_INFO) { \
pr_debug_ ## ratefunc("%s: %s " fmt, \ pr_debug_ ## ratefunc("%s: %s " fmt, \
__FILE__, tn, ##__VA_ARGS__); \ __FILE__, tn, ##__VA_ARGS__); \
} else if ((type) & VFS) { \ } else if ((type) & VFS) { \
pr_err_ ## ratefunc("CIFS VFS: %s " fmt, \ pr_err_ ## ratefunc("VFS: %s " fmt, tn, ##__VA_ARGS__); \
tn, ##__VA_ARGS__); \ } else if ((type) & NOISY && (NOISY != 0)) { \
} else if ((type) & NOISY && (NOISY != 0)) { \ pr_debug_ ## ratefunc("%s " fmt, tn, ##__VA_ARGS__); \
pr_debug_ ## ratefunc("%s " fmt, \ } \
tn, ##__VA_ARGS__); \
} \
} while (0) } while (0)
#define cifs_tcon_dbg(type, fmt, ...) \ #define cifs_tcon_dbg(type, fmt, ...) \
do { \ do { \
if ((type) & ONCE) \ if ((type) & ONCE) \
cifs_tcon_dbg_func(once, \ cifs_tcon_dbg_func(once, type, fmt, ##__VA_ARGS__); \
type, fmt, ##__VA_ARGS__); \ else \
else \ cifs_tcon_dbg_func(ratelimited, type, fmt, \
cifs_tcon_dbg_func(ratelimited, \ ##__VA_ARGS__); \
type, fmt, ##__VA_ARGS__); \
} while (0) } while (0)
/* /*
...@@ -159,9 +154,7 @@ do { \ ...@@ -159,9 +154,7 @@ do { \
} while (0) } while (0)
#define cifs_info(fmt, ...) \ #define cifs_info(fmt, ...) \
do { \ pr_info(fmt, ##__VA_ARGS__)
pr_info("CIFS: "fmt, ##__VA_ARGS__); \
} while (0)
#endif #endif
#endif /* _H_CIFS_DEBUG */ #endif /* _H_CIFS_DEBUG */
...@@ -520,7 +520,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, ...@@ -520,7 +520,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
if (rc) { if (rc) {
cifs_dbg(VFS, "%s: could not init hmacmd5\n", __func__); cifs_dbg(VFS, "%s: Could not init hmacmd5\n", __func__);
return rc; return rc;
} }
...@@ -624,7 +624,7 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash) ...@@ -624,7 +624,7 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
if (rc) { if (rc) {
cifs_dbg(VFS, "%s: could not init hmacmd5\n", __func__); cifs_dbg(VFS, "%s: Could not init hmacmd5\n", __func__);
return rc; return rc;
} }
...@@ -723,7 +723,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) ...@@ -723,7 +723,7 @@ 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) {
cifs_dbg(VFS, "could not get v2 hash rc %d\n", rc); cifs_dbg(VFS, "Could not get v2 hash rc %d\n", rc);
goto unlock; goto unlock;
} }
...@@ -783,7 +783,7 @@ calc_seckey(struct cifs_ses *ses) ...@@ -783,7 +783,7 @@ calc_seckey(struct cifs_ses *ses)
ctx_arc4 = kmalloc(sizeof(*ctx_arc4), GFP_KERNEL); ctx_arc4 = kmalloc(sizeof(*ctx_arc4), GFP_KERNEL);
if (!ctx_arc4) { if (!ctx_arc4) {
cifs_dbg(VFS, "could not allocate arc4 context\n"); cifs_dbg(VFS, "Could not allocate arc4 context\n");
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -45,25 +45,25 @@ extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *, ...@@ -45,25 +45,25 @@ extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
unsigned int /* length */); unsigned int /* length */);
extern unsigned int _get_xid(void); extern unsigned int _get_xid(void);
extern void _free_xid(unsigned int); extern void _free_xid(unsigned int);
#define get_xid() \ #define get_xid() \
({ \ ({ \
unsigned int __xid = _get_xid(); \ unsigned int __xid = _get_xid(); \
cifs_dbg(FYI, "CIFS VFS: in %s as Xid: %u with uid: %d\n", \ cifs_dbg(FYI, "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())); \
trace_smb3_enter(__xid, __func__); \ trace_smb3_enter(__xid, __func__); \
__xid; \ __xid; \
}) })
#define free_xid(curr_xid) \ #define free_xid(curr_xid) \
do { \ do { \
_free_xid(curr_xid); \ _free_xid(curr_xid); \
cifs_dbg(FYI, "CIFS VFS: leaving %s (xid = %u) rc = %d\n", \ cifs_dbg(FYI, "VFS: leaving %s (xid = %u) rc = %d\n", \
__func__, curr_xid, (int)rc); \ __func__, curr_xid, (int)rc); \
if (rc) \ if (rc) \
trace_smb3_exit_err(curr_xid, __func__, (int)rc); \ trace_smb3_exit_err(curr_xid, __func__, (int)rc); \
else \ else \
trace_smb3_exit_done(curr_xid, __func__); \ trace_smb3_exit_done(curr_xid, __func__); \
} 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);
......
...@@ -56,7 +56,7 @@ static int __init cifs_root_setup(char *line) ...@@ -56,7 +56,7 @@ static int __init cifs_root_setup(char *line)
/* len is strlen(unc) + '\0' */ /* len is strlen(unc) + '\0' */
len = s - line + 1; len = s - line + 1;
if (len > sizeof(root_dev)) { if (len > sizeof(root_dev)) {
printk(KERN_ERR "Root-CIFS: UNC path too long\n"); pr_err("Root-CIFS: UNC path too long\n");
return 1; return 1;
} }
strlcpy(root_dev, line, len); strlcpy(root_dev, line, len);
...@@ -66,7 +66,7 @@ static int __init cifs_root_setup(char *line) ...@@ -66,7 +66,7 @@ static int __init cifs_root_setup(char *line)
sizeof(root_opts), "%s,%s", sizeof(root_opts), "%s,%s",
DEFAULT_MNT_OPTS, s + 1); DEFAULT_MNT_OPTS, s + 1);
if (n >= sizeof(root_opts)) { if (n >= sizeof(root_opts)) {
printk(KERN_ERR "Root-CIFS: mount options string too long\n"); pr_err("Root-CIFS: mount options string too long\n");
root_opts[sizeof(root_opts)-1] = '\0'; root_opts[sizeof(root_opts)-1] = '\0';
return 1; return 1;
} }
...@@ -83,7 +83,7 @@ __setup("cifsroot=", cifs_root_setup); ...@@ -83,7 +83,7 @@ __setup("cifsroot=", cifs_root_setup);
int __init cifs_root_data(char **dev, char **opts) int __init cifs_root_data(char **dev, char **opts)
{ {
if (!root_dev[0] || root_server_addr == htonl(INADDR_NONE)) { if (!root_dev[0] || root_server_addr == htonl(INADDR_NONE)) {
printk(KERN_ERR "Root-CIFS: no SMB server address\n"); pr_err("Root-CIFS: no SMB server address\n");
return -1; return -1;
} }
......
...@@ -281,8 +281,8 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command) ...@@ -281,8 +281,8 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
(server->tcpStatus != CifsNeedReconnect), (server->tcpStatus != CifsNeedReconnect),
10 * HZ); 10 * HZ);
if (rc < 0) { if (rc < 0) {
cifs_dbg(FYI, "%s: aborting reconnect due to a received" cifs_dbg(FYI, "%s: aborting reconnect due to a received signal by the process\n",
" signal by the process\n", __func__); __func__);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
...@@ -343,7 +343,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command) ...@@ -343,7 +343,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc); cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
if (rc) { if (rc) {
printk_once(KERN_WARNING "reconnect tcon failed rc = %d\n", rc); pr_warn_once("reconnect tcon failed rc = %d\n", rc);
goto out; goto out;
} }
...@@ -576,7 +576,7 @@ cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required) ...@@ -576,7 +576,7 @@ cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required)
/* If server requires signing, does client allow it? */ /* If server requires signing, does client allow it? */
if (srv_sign_required) { if (srv_sign_required) {
if (!mnt_sign_enabled) { if (!mnt_sign_enabled) {
cifs_dbg(VFS, "Server requires signing, but it's disabled in SecurityFlags!"); cifs_dbg(VFS, "Server requires signing, but it's disabled in SecurityFlags!\n");
return -ENOTSUPP; return -ENOTSUPP;
} }
server->sign = true; server->sign = true;
...@@ -585,14 +585,14 @@ cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required) ...@@ -585,14 +585,14 @@ cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required)
/* If client requires signing, does server allow it? */ /* If client requires signing, does server allow it? */
if (mnt_sign_required) { if (mnt_sign_required) {
if (!srv_sign_enabled) { if (!srv_sign_enabled) {
cifs_dbg(VFS, "Server does not support signing!"); cifs_dbg(VFS, "Server does not support signing!\n");
return -ENOTSUPP; return -ENOTSUPP;
} }
server->sign = true; server->sign = true;
} }
if (cifs_rdma_enabled(server) && server->sign) if (cifs_rdma_enabled(server) && server->sign)
cifs_dbg(VFS, "Signing is enabled, and RDMA read/write will be disabled"); cifs_dbg(VFS, "Signing is enabled, and RDMA read/write will be disabled\n");
return 0; return 0;
} }
...@@ -722,7 +722,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses) ...@@ -722,7 +722,7 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS); pSMB->hdr.Flags2 |= (SMBFLG2_UNICODE | SMBFLG2_ERR_STATUS);
if (should_set_ext_sec_flag(ses->sectype)) { if (should_set_ext_sec_flag(ses->sectype)) {
cifs_dbg(FYI, "Requesting extended security."); cifs_dbg(FYI, "Requesting extended security\n");
pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC; pSMB->hdr.Flags2 |= SMBFLG2_EXT_SEC;
} }
...@@ -3887,7 +3887,7 @@ CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -3887,7 +3887,7 @@ CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
struct file_chattr_info *pfinfo; struct file_chattr_info *pfinfo;
/* BB Do we need a cast or hash here ? */ /* BB Do we need a cast or hash here ? */
if (count != 16) { if (count != 16) {
cifs_dbg(FYI, "Illegal size ret in GetExtAttr\n"); cifs_dbg(FYI, "Invalid size ret in GetExtAttr\n");
rc = -EIO; rc = -EIO;
goto GetExtAttrOut; goto GetExtAttrOut;
} }
...@@ -4263,7 +4263,7 @@ CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -4263,7 +4263,7 @@ CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
(struct smb_hdr *) pSMBr, &bytes_returned, 0); (struct smb_hdr *) pSMBr, &bytes_returned, 0);
if (rc) { if (rc) {
cifs_dbg(FYI, "Send error in QFileInfo = %d", rc); cifs_dbg(FYI, "Send error in QFileInfo = %d\n", rc);
} else { /* decode response */ } else { /* decode response */
rc = validate_t2((struct smb_t2_rsp *)pSMBr); rc = validate_t2((struct smb_t2_rsp *)pSMBr);
...@@ -4430,7 +4430,7 @@ CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -4430,7 +4430,7 @@ CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
(struct smb_hdr *) pSMBr, &bytes_returned, 0); (struct smb_hdr *) pSMBr, &bytes_returned, 0);
if (rc) { if (rc) {
cifs_dbg(FYI, "Send error in UnixQFileInfo = %d", rc); cifs_dbg(FYI, "Send error in UnixQFileInfo = %d\n", rc);
} else { /* decode response */ } else { /* decode response */
rc = validate_t2((struct smb_t2_rsp *)pSMBr); rc = validate_t2((struct smb_t2_rsp *)pSMBr);
...@@ -4512,7 +4512,7 @@ CIFSSMBUnixQPathInfo(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -4512,7 +4512,7 @@ CIFSSMBUnixQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
(struct smb_hdr *) pSMBr, &bytes_returned, 0); (struct smb_hdr *) pSMBr, &bytes_returned, 0);
if (rc) { if (rc) {
cifs_dbg(FYI, "Send error in UnixQPathInfo = %d", rc); cifs_dbg(FYI, "Send error in UnixQPathInfo = %d\n", rc);
} else { /* decode response */ } else { /* decode response */
rc = validate_t2((struct smb_t2_rsp *)pSMBr); rc = validate_t2((struct smb_t2_rsp *)pSMBr);
...@@ -4932,7 +4932,7 @@ CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -4932,7 +4932,7 @@ CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
struct file_internal_info *pfinfo; struct file_internal_info *pfinfo;
/* BB Do we need a cast or hash here ? */ /* BB Do we need a cast or hash here ? */
if (count < 8) { if (count < 8) {
cifs_dbg(FYI, "Illegal size ret in QryIntrnlInf\n"); cifs_dbg(FYI, "Invalid size ret in QryIntrnlInf\n");
rc = -EIO; rc = -EIO;
goto GetInodeNumOut; goto GetInodeNumOut;
} }
......
This diff is collapsed.
...@@ -198,7 +198,7 @@ static ssize_t dfscache_proc_write(struct file *file, const char __user *buffer, ...@@ -198,7 +198,7 @@ static ssize_t dfscache_proc_write(struct file *file, const char __user *buffer,
if (c != '0') if (c != '0')
return -EINVAL; return -EINVAL;
cifs_dbg(FYI, "clearing dfs cache"); cifs_dbg(FYI, "clearing dfs cache\n");
down_write(&htable_rw_lock); down_write(&htable_rw_lock);
flush_cache_ents(); flush_cache_ents();
...@@ -234,8 +234,8 @@ static inline void dump_tgts(const struct cache_entry *ce) ...@@ -234,8 +234,8 @@ static inline void dump_tgts(const struct cache_entry *ce)
static inline void dump_ce(const struct cache_entry *ce) static inline void dump_ce(const struct cache_entry *ce)
{ {
cifs_dbg(FYI, "cache entry: path=%s,type=%s,ttl=%d,etime=%ld," cifs_dbg(FYI, "cache entry: path=%s,type=%s,ttl=%d,etime=%ld,interlink=%s,path_consumed=%d,expired=%s\n",
"interlink=%s,path_consumed=%d,expired=%s\n", ce->path, ce->path,
ce->srvtype == DFS_TYPE_ROOT ? "root" : "link", ce->ttl, ce->srvtype == DFS_TYPE_ROOT ? "root" : "link", ce->ttl,
ce->etime.tv_nsec, ce->etime.tv_nsec,
IS_INTERLINK_SET(ce->flags) ? "yes" : "no", IS_INTERLINK_SET(ce->flags) ? "yes" : "no",
...@@ -453,11 +453,11 @@ static void remove_oldest_entry(void) ...@@ -453,11 +453,11 @@ static void remove_oldest_entry(void)
} }
if (!to_del) { if (!to_del) {
cifs_dbg(FYI, "%s: no entry to remove", __func__); cifs_dbg(FYI, "%s: no entry to remove\n", __func__);
return; return;
} }
cifs_dbg(FYI, "%s: removing entry", __func__); cifs_dbg(FYI, "%s: removing entry\n", __func__);
dump_ce(to_del); dump_ce(to_del);
flush_cache_ent(to_del); flush_cache_ent(to_del);
} }
...@@ -696,8 +696,8 @@ static int __dfs_cache_find(const unsigned int xid, struct cifs_ses *ses, ...@@ -696,8 +696,8 @@ static int __dfs_cache_find(const unsigned int xid, struct cifs_ses *ses,
} }
if (atomic_read(&cache_count) >= CACHE_MAX_ENTRIES) { if (atomic_read(&cache_count) >= CACHE_MAX_ENTRIES) {
cifs_dbg(FYI, "%s: reached max cache size (%d)", __func__, cifs_dbg(FYI, "%s: reached max cache size (%d)\n",
CACHE_MAX_ENTRIES); __func__, CACHE_MAX_ENTRIES);
down_write(&htable_rw_lock); down_write(&htable_rw_lock);
remove_oldest_entry(); remove_oldest_entry();
up_write(&htable_rw_lock); up_write(&htable_rw_lock);
......
...@@ -857,7 +857,7 @@ cifs_reopen_persistent_handles(struct cifs_tcon *tcon) ...@@ -857,7 +857,7 @@ cifs_reopen_persistent_handles(struct cifs_tcon *tcon)
tcon->need_reopen_files = false; tcon->need_reopen_files = false;
cifs_dbg(FYI, "Reopen persistent handles"); cifs_dbg(FYI, "Reopen persistent handles\n");
INIT_LIST_HEAD(&tmp_list); INIT_LIST_HEAD(&tmp_list);
/* list all files open on tree connection, reopen resilient handles */ /* list all files open on tree connection, reopen resilient handles */
...@@ -2056,7 +2056,7 @@ find_writable_file(struct cifsInodeInfo *cifs_inode, int flags) ...@@ -2056,7 +2056,7 @@ find_writable_file(struct cifsInodeInfo *cifs_inode, int flags)
rc = cifs_get_writable_file(cifs_inode, flags, &cfile); rc = cifs_get_writable_file(cifs_inode, flags, &cfile);
if (rc) if (rc)
cifs_dbg(FYI, "couldn't find writable handle rc=%d", rc); cifs_dbg(FYI, "Couldn't find writable handle rc=%d\n", rc);
return cfile; return cfile;
} }
...@@ -2923,11 +2923,9 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from, ...@@ -2923,11 +2923,9 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from,
from, &pagevec, cur_len, &start); from, &pagevec, cur_len, &start);
if (result < 0) { if (result < 0) {
cifs_dbg(VFS, cifs_dbg(VFS,
"direct_writev couldn't get user pages " "direct_writev couldn't get user pages (rc=%zd) iter type %d iov_offset %zd count %zd\n",
"(rc=%zd) iter type %d iov_offset %zd " result, iov_iter_type(from),
"count %zd\n", from->iov_offset, from->count);
result, iov_iter_type(from),
from->iov_offset, from->count);
dump_stack(); dump_stack();
rc = result; rc = result;
...@@ -3654,12 +3652,10 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file, ...@@ -3654,12 +3652,10 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file,
cur_len, &start); cur_len, &start);
if (result < 0) { if (result < 0) {
cifs_dbg(VFS, cifs_dbg(VFS,
"couldn't get user pages (rc=%zd)" "Couldn't get user pages (rc=%zd) iter type %d iov_offset %zd count %zd\n",
" iter type %d" result, iov_iter_type(&direct_iov),
" iov_offset %zd count %zd\n", direct_iov.iov_offset,
result, iov_iter_type(&direct_iov), direct_iov.count);
direct_iov.iov_offset,
direct_iov.count);
dump_stack(); dump_stack();
rc = result; rc = result;
...@@ -4828,7 +4824,7 @@ static int cifs_swap_activate(struct swap_info_struct *sis, ...@@ -4828,7 +4824,7 @@ static int cifs_swap_activate(struct swap_info_struct *sis,
} }
*span = sis->pages; *span = sis->pages;
printk_once(KERN_WARNING "Swap support over SMB3 is experimental\n"); pr_warn_once("Swap support over SMB3 is experimental\n");
/* /*
* TODO: consider adding ACL (or documenting how) to prevent other * TODO: consider adding ACL (or documenting how) to prevent other
......
...@@ -1155,7 +1155,7 @@ struct inode *cifs_root_iget(struct super_block *sb) ...@@ -1155,7 +1155,7 @@ struct inode *cifs_root_iget(struct super_block *sb)
/* some servers mistakenly claim POSIX support */ /* some servers mistakenly claim POSIX support */
if (rc != -EOPNOTSUPP) if (rc != -EOPNOTSUPP)
goto iget_no_retry; goto iget_no_retry;
cifs_dbg(VFS, "server does not support POSIX extensions"); cifs_dbg(VFS, "server does not support POSIX extensions\n");
tcon->unix_ext = false; tcon->unix_ext = false;
} }
...@@ -2010,7 +2010,7 @@ cifs_invalidate_mapping(struct inode *inode) ...@@ -2010,7 +2010,7 @@ 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)
cifs_dbg(VFS, "%s: could not invalidate inode %p\n", cifs_dbg(VFS, "%s: Could not invalidate inode %p\n",
__func__, inode); __func__, inode);
} }
......
...@@ -424,7 +424,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv) ...@@ -424,7 +424,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
if (data_offset > if (data_offset >
len - sizeof(struct file_notify_information)) { len - sizeof(struct file_notify_information)) {
cifs_dbg(FYI, "invalid data_offset %u\n", cifs_dbg(FYI, "Invalid data_offset %u\n",
data_offset); data_offset);
return true; return true;
} }
...@@ -452,7 +452,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv) ...@@ -452,7 +452,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)) {
cifs_dbg(FYI, "invalid handle on oplock break\n"); 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)) {
...@@ -533,9 +533,9 @@ cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb) ...@@ -533,9 +533,9 @@ cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb)
cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM; cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM;
cifs_sb->mnt_cifs_serverino_autodisabled = true; cifs_sb->mnt_cifs_serverino_autodisabled = true;
cifs_dbg(VFS, "Autodisabling the use of server inode numbers on %s.\n", cifs_dbg(VFS, "Autodisabling the use of server inode numbers on %s\n",
tcon ? tcon->treeName : "new server"); tcon ? tcon->treeName : "new server");
cifs_dbg(VFS, "The server doesn't seem to support them properly or the files might be on different servers (DFS).\n"); cifs_dbg(VFS, "The server doesn't seem to support them properly or the files might be on different servers (DFS)\n");
cifs_dbg(VFS, "Hardlinks will not be recognized on this mount. Consider mounting with the \"noserverino\" option to silence this message.\n"); cifs_dbg(VFS, "Hardlinks will not be recognized on this mount. Consider mounting with the \"noserverino\" option to silence this message.\n");
} }
...@@ -877,7 +877,7 @@ setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw) ...@@ -877,7 +877,7 @@ setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw)
while (count && npages < max_pages) { while (count && npages < max_pages) {
rc = iov_iter_get_pages(iter, pages, count, max_pages, &start); rc = iov_iter_get_pages(iter, pages, count, max_pages, &start);
if (rc < 0) { if (rc < 0) {
cifs_dbg(VFS, "couldn't get user pages (rc=%zd)\n", rc); cifs_dbg(VFS, "Couldn't get user pages (rc=%zd)\n", rc);
break; break;
} }
...@@ -936,7 +936,7 @@ cifs_alloc_hash(const char *name, ...@@ -936,7 +936,7 @@ cifs_alloc_hash(const char *name,
*shash = crypto_alloc_shash(name, 0, 0); *shash = crypto_alloc_shash(name, 0, 0);
if (IS_ERR(*shash)) { if (IS_ERR(*shash)) {
cifs_dbg(VFS, "could not allocate crypto %s\n", name); cifs_dbg(VFS, "Could not allocate crypto %s\n", name);
rc = PTR_ERR(*shash); rc = PTR_ERR(*shash);
*shash = NULL; *shash = NULL;
*sdesc = NULL; *sdesc = NULL;
......
...@@ -957,15 +957,15 @@ struct timespec64 cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset) ...@@ -957,15 +957,15 @@ struct timespec64 cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
sec = 2 * st->TwoSeconds; sec = 2 * st->TwoSeconds;
min = st->Minutes; min = st->Minutes;
if ((sec > 59) || (min > 59)) if ((sec > 59) || (min > 59))
cifs_dbg(VFS, "illegal time min %d sec %lld\n", min, sec); cifs_dbg(VFS, "Invalid time min %d sec %lld\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)
cifs_dbg(VFS, "illegal hours %d\n", st->Hours); cifs_dbg(VFS, "Invalid hours %d\n", st->Hours);
day = sd->Day; day = sd->Day;
month = sd->Month; month = sd->Month;
if (day < 1 || day > 31 || month < 1 || month > 12) { if (day < 1 || day > 31 || month < 1 || month > 12) {
cifs_dbg(VFS, "illegal date, month %d day: %d\n", month, day); cifs_dbg(VFS, "Invalid date, month %d day: %d\n", month, day);
day = clamp(day, 1, 31); day = clamp(day, 1, 31);
month = clamp(month, 1, 12); month = clamp(month, 1, 12);
} }
......
...@@ -53,7 +53,7 @@ static void dump_cifs_file_struct(struct file *file, char *label) ...@@ -53,7 +53,7 @@ static void dump_cifs_file_struct(struct file *file, char *label)
return; return;
} }
if (cf->invalidHandle) if (cf->invalidHandle)
cifs_dbg(FYI, "invalid handle\n"); cifs_dbg(FYI, "Invalid handle\n");
if (cf->srch_inf.endOfSearch) if (cf->srch_inf.endOfSearch)
cifs_dbg(FYI, "end of search\n"); cifs_dbg(FYI, "end of search\n");
if (cf->srch_inf.emptyDir) if (cf->srch_inf.emptyDir)
...@@ -246,7 +246,7 @@ cifs_posix_to_fattr(struct cifs_fattr *fattr, struct smb2_posix_info *info, ...@@ -246,7 +246,7 @@ cifs_posix_to_fattr(struct cifs_fattr *fattr, struct smb2_posix_info *info,
*/ */
fattr->cf_mode = le32_to_cpu(info->Mode) & ~S_IFMT; fattr->cf_mode = le32_to_cpu(info->Mode) & ~S_IFMT;
cifs_dbg(FYI, "posix fattr: dev %d, reparse %d, mode %o", cifs_dbg(FYI, "posix fattr: dev %d, reparse %d, mode %o\n",
le32_to_cpu(info->DeviceId), le32_to_cpu(info->DeviceId),
le32_to_cpu(info->ReparseTag), le32_to_cpu(info->ReparseTag),
le32_to_cpu(info->Mode)); le32_to_cpu(info->Mode));
...@@ -478,7 +478,7 @@ static char *nxt_dir_entry(char *old_entry, char *end_of_smb, int level) ...@@ -478,7 +478,7 @@ static char *nxt_dir_entry(char *old_entry, char *end_of_smb, int level)
u32 next_offset = le32_to_cpu(pDirInfo->NextEntryOffset); u32 next_offset = le32_to_cpu(pDirInfo->NextEntryOffset);
if (old_entry + next_offset < old_entry) { if (old_entry + next_offset < old_entry) {
cifs_dbg(VFS, "invalid offset %u\n", next_offset); cifs_dbg(VFS, "Invalid offset %u\n", next_offset);
return NULL; return NULL;
} }
new_entry = old_entry + next_offset; new_entry = old_entry + next_offset;
...@@ -515,7 +515,7 @@ static void cifs_fill_dirent_posix(struct cifs_dirent *de, ...@@ -515,7 +515,7 @@ static void cifs_fill_dirent_posix(struct cifs_dirent *de,
/* payload should have already been checked at this point */ /* payload should have already been checked at this point */
if (posix_info_parse(info, NULL, &parsed) < 0) { if (posix_info_parse(info, NULL, &parsed) < 0) {
cifs_dbg(VFS, "invalid POSIX info payload"); cifs_dbg(VFS, "Invalid POSIX info payload\n");
return; return;
} }
...@@ -968,7 +968,7 @@ int cifs_readdir(struct file *file, struct dir_context *ctx) ...@@ -968,7 +968,7 @@ int cifs_readdir(struct file *file, struct dir_context *ctx)
} else if (current_entry != NULL) { } else if (current_entry != NULL) {
cifs_dbg(FYI, "entry %lld found\n", ctx->pos); cifs_dbg(FYI, "entry %lld found\n", ctx->pos);
} else { } else {
cifs_dbg(FYI, "could not find entry\n"); cifs_dbg(FYI, "Could not find entry\n");
goto rddir2_exit; goto rddir2_exit;
} }
cifs_dbg(FYI, "loop through %d times filling dir for net buf %p\n", cifs_dbg(FYI, "loop through %d times filling dir for net buf %p\n",
......
...@@ -162,12 +162,14 @@ cifs_ses_add_channel(struct cifs_ses *ses, struct cifs_server_iface *iface) ...@@ -162,12 +162,14 @@ cifs_ses_add_channel(struct cifs_ses *ses, struct cifs_server_iface *iface)
int rc; int rc;
unsigned int xid = get_xid(); unsigned int xid = get_xid();
cifs_dbg(FYI, "adding channel to ses %p (speed:%zu bps rdma:%s ",
ses, iface->speed, iface->rdma_capable ? "yes" : "no");
if (iface->sockaddr.ss_family == AF_INET) if (iface->sockaddr.ss_family == AF_INET)
cifs_dbg(FYI, "ip:%pI4)\n", &ipv4->sin_addr); cifs_dbg(FYI, "adding channel to ses %p (speed:%zu bps rdma:%s ip:%pI4)\n",
ses, iface->speed, iface->rdma_capable ? "yes" : "no",
&ipv4->sin_addr);
else else
cifs_dbg(FYI, "ip:%pI6)\n", &ipv6->sin6_addr); cifs_dbg(FYI, "adding channel to ses %p (speed:%zu bps rdma:%s ip:%pI4)\n",
ses, iface->speed, iface->rdma_capable ? "yes" : "no",
&ipv6->sin6_addr);
/* /*
* Setup a smb_vol with mostly the same info as the existing * Setup a smb_vol with mostly the same info as the existing
...@@ -569,15 +571,15 @@ int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, ...@@ -569,15 +571,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) {
cifs_dbg(VFS, "tioffset + tilen too high %u + %u", cifs_dbg(VFS, "tioffset + tilen too high %u + %u\n",
tioffset, tilen); 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) {
cifs_dbg(VFS, "Challenge target info alloc failure"); cifs_dbg(VFS, "Challenge target info alloc failure\n");
return -ENOMEM; return -ENOMEM;
} }
ses->auth_key.len = tilen; ses->auth_key.len = tilen;
...@@ -1303,9 +1305,8 @@ sess_auth_kerberos(struct sess_data *sess_data) ...@@ -1303,9 +1305,8 @@ sess_auth_kerberos(struct sess_data *sess_data)
* 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) {
cifs_dbg(VFS, cifs_dbg(VFS, "incorrect version of cifs.upcall (expected %d but got %d)\n",
"incorrect version of cifs.upcall (expected %d but got %d)", CIFS_SPNEGO_UPCALL_VERSION, msg->version);
CIFS_SPNEGO_UPCALL_VERSION, msg->version);
rc = -EKEYREJECTED; rc = -EKEYREJECTED;
goto out_put_spnego_key; goto out_put_spnego_key;
} }
...@@ -1313,8 +1314,8 @@ sess_auth_kerberos(struct sess_data *sess_data) ...@@ -1313,8 +1314,8 @@ sess_auth_kerberos(struct sess_data *sess_data)
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) {
cifs_dbg(VFS, "Kerberos can't allocate (%u bytes) memory", cifs_dbg(VFS, "Kerberos can't allocate (%u bytes) memory\n",
msg->sesskey_len); msg->sesskey_len);
rc = -ENOMEM; rc = -ENOMEM;
goto out_put_spnego_key; goto out_put_spnego_key;
} }
...@@ -1657,8 +1658,7 @@ static int select_sec(struct cifs_ses *ses, struct sess_data *sess_data) ...@@ -1657,8 +1658,7 @@ static int select_sec(struct cifs_ses *ses, struct sess_data *sess_data)
type = cifs_select_sectype(ses->server, ses->sectype); type = cifs_select_sectype(ses->server, ses->sectype);
cifs_dbg(FYI, "sess setup type %d\n", type); cifs_dbg(FYI, "sess setup type %d\n", type);
if (type == Unspecified) { if (type == Unspecified) {
cifs_dbg(VFS, cifs_dbg(VFS, "Unable to select appropriate authentication method!\n");
"Unable to select appropriate authentication method!");
return -EINVAL; return -EINVAL;
} }
......
...@@ -247,7 +247,7 @@ check2ndT2(char *buf) ...@@ -247,7 +247,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 */
cifs_dbg(FYI, "invalid transact2 word count\n"); cifs_dbg(FYI, "Invalid transact2 word count\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -337,8 +337,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -337,8 +337,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
SMB2_open_free(&rqst[0]); SMB2_open_free(&rqst[0]);
if (rc == -EREMCHG) { if (rc == -EREMCHG) {
printk_once(KERN_WARNING "server share %s deleted\n", pr_warn_once("server share %s deleted\n", tcon->treeName);
tcon->treeName);
tcon->need_reconnect = true; tcon->need_reconnect = true;
} }
......
...@@ -110,14 +110,14 @@ static __u32 get_neg_ctxt_len(struct smb2_sync_hdr *hdr, __u32 len, ...@@ -110,14 +110,14 @@ static __u32 get_neg_ctxt_len(struct smb2_sync_hdr *hdr, __u32 len,
/* Make sure that negotiate contexts start after gss security blob */ /* Make sure that negotiate contexts start after gss security blob */
nc_offset = le32_to_cpu(pneg_rsp->NegotiateContextOffset); nc_offset = le32_to_cpu(pneg_rsp->NegotiateContextOffset);
if (nc_offset < non_ctxlen) { if (nc_offset < non_ctxlen) {
printk_once(KERN_WARNING "invalid negotiate context offset\n"); pr_warn_once("Invalid negotiate context offset\n");
return 0; return 0;
} }
size_of_pad_before_neg_ctxts = nc_offset - non_ctxlen; size_of_pad_before_neg_ctxts = nc_offset - non_ctxlen;
/* Verify that at least minimal negotiate contexts fit within frame */ /* Verify that at least minimal negotiate contexts fit within frame */
if (len < nc_offset + (neg_count * sizeof(struct smb2_neg_context))) { if (len < nc_offset + (neg_count * sizeof(struct smb2_neg_context))) {
printk_once(KERN_WARNING "negotiate context goes beyond end\n"); pr_warn_once("negotiate context goes beyond end\n");
return 0; return 0;
} }
...@@ -190,14 +190,14 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr) ...@@ -190,14 +190,14 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr)
return 1; return 1;
if (shdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) { if (shdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) {
cifs_dbg(VFS, "Illegal structure size %u\n", cifs_dbg(VFS, "Invalid structure size %u\n",
le16_to_cpu(shdr->StructureSize)); le16_to_cpu(shdr->StructureSize));
return 1; return 1;
} }
command = le16_to_cpu(shdr->Command); command = le16_to_cpu(shdr->Command);
if (command >= NUMBER_OF_SMB2_COMMANDS) { if (command >= NUMBER_OF_SMB2_COMMANDS) {
cifs_dbg(VFS, "Illegal SMB2 command %d\n", command); cifs_dbg(VFS, "Invalid SMB2 command %d\n", command);
return 1; return 1;
} }
...@@ -205,7 +205,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr) ...@@ -205,7 +205,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr)
if (command != SMB2_OPLOCK_BREAK_HE && (shdr->Status == 0 || if (command != SMB2_OPLOCK_BREAK_HE && (shdr->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 */
cifs_dbg(VFS, "Illegal response size %u for command %d\n", cifs_dbg(VFS, "Invalid 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 } else if (command == SMB2_OPLOCK_BREAK_HE
...@@ -213,7 +213,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr) ...@@ -213,7 +213,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr)
&& (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 */
cifs_dbg(VFS, "Illegal response size %d for oplock break\n", cifs_dbg(VFS, "Invalid response size %d for oplock break\n",
le16_to_cpu(pdu->StructureSize2)); le16_to_cpu(pdu->StructureSize2));
return 1; return 1;
} }
...@@ -864,14 +864,14 @@ smb311_update_preauth_hash(struct cifs_ses *ses, struct kvec *iov, int nvec) ...@@ -864,14 +864,14 @@ smb311_update_preauth_hash(struct cifs_ses *ses, struct kvec *iov, int nvec)
d = server->secmech.sdescsha512; d = server->secmech.sdescsha512;
rc = crypto_shash_init(&d->shash); rc = crypto_shash_init(&d->shash);
if (rc) { if (rc) {
cifs_dbg(VFS, "%s: could not init sha512 shash\n", __func__); cifs_dbg(VFS, "%s: Could not init sha512 shash\n", __func__);
return rc; return rc;
} }
rc = crypto_shash_update(&d->shash, ses->preauth_sha_hash, rc = crypto_shash_update(&d->shash, ses->preauth_sha_hash,
SMB2_PREAUTH_HASH_SIZE); SMB2_PREAUTH_HASH_SIZE);
if (rc) { if (rc) {
cifs_dbg(VFS, "%s: could not update sha512 shash\n", __func__); cifs_dbg(VFS, "%s: Could not update sha512 shash\n", __func__);
return rc; return rc;
} }
...@@ -879,7 +879,7 @@ smb311_update_preauth_hash(struct cifs_ses *ses, struct kvec *iov, int nvec) ...@@ -879,7 +879,7 @@ smb311_update_preauth_hash(struct cifs_ses *ses, struct kvec *iov, int nvec)
rc = crypto_shash_update(&d->shash, rc = crypto_shash_update(&d->shash,
iov[i].iov_base, iov[i].iov_len); iov[i].iov_base, iov[i].iov_len);
if (rc) { if (rc) {
cifs_dbg(VFS, "%s: could not update sha512 shash\n", cifs_dbg(VFS, "%s: Could not update sha512 shash\n",
__func__); __func__);
return rc; return rc;
} }
...@@ -887,7 +887,7 @@ smb311_update_preauth_hash(struct cifs_ses *ses, struct kvec *iov, int nvec) ...@@ -887,7 +887,7 @@ smb311_update_preauth_hash(struct cifs_ses *ses, struct kvec *iov, int nvec)
rc = crypto_shash_final(&d->shash, ses->preauth_sha_hash); rc = crypto_shash_final(&d->shash, ses->preauth_sha_hash);
if (rc) { if (rc) {
cifs_dbg(VFS, "%s: could not finalize sha512 shash\n", cifs_dbg(VFS, "%s: Could not finalize sha512 shash\n",
__func__); __func__);
return rc; return rc;
} }
......
...@@ -79,7 +79,7 @@ smb2_add_credits(struct TCP_Server_Info *server, ...@@ -79,7 +79,7 @@ smb2_add_credits(struct TCP_Server_Info *server,
if (*val > 65000) { if (*val > 65000) {
*val = 65000; /* Don't get near 64K credits, avoid srv bugs */ *val = 65000; /* Don't get near 64K credits, avoid srv bugs */
printk_once(KERN_WARNING "server overflowed SMB3 credits\n"); pr_warn_once("server overflowed SMB3 credits\n");
} }
server->in_flight--; server->in_flight--;
if (server->in_flight == 0 && (optype & CIFS_OP_MASK) != CIFS_NEG_OP) if (server->in_flight == 0 && (optype & CIFS_OP_MASK) != CIFS_NEG_OP)
...@@ -767,8 +767,8 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, ...@@ -767,8 +767,8 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon,
if (rc) { if (rc) {
if (rc == -EREMCHG) { if (rc == -EREMCHG) {
tcon->need_reconnect = true; tcon->need_reconnect = true;
printk_once(KERN_WARNING "server share %s deleted\n", pr_warn_once("server share %s deleted\n",
tcon->treeName); tcon->treeName);
} }
goto oshr_exit; goto oshr_exit;
} }
...@@ -1601,7 +1601,8 @@ smb2_ioctl_query_info(const unsigned int xid, ...@@ -1601,7 +1601,8 @@ smb2_ioctl_query_info(const unsigned int xid,
qi.input_buffer_length, qi.input_buffer_length,
qi.output_buffer_length, buffer); qi.output_buffer_length, buffer);
} else { /* unknown flags */ } else { /* unknown flags */
cifs_tcon_dbg(VFS, "invalid passthru query flags: 0x%x\n", qi.flags); cifs_tcon_dbg(VFS, "Invalid passthru query flags: 0x%x\n",
qi.flags);
rc = -EINVAL; rc = -EINVAL;
} }
...@@ -1731,7 +1732,7 @@ smb2_copychunk_range(const unsigned int xid, ...@@ -1731,7 +1732,7 @@ smb2_copychunk_range(const unsigned int xid,
if (rc == 0) { if (rc == 0) {
if (ret_data_len != if (ret_data_len !=
sizeof(struct copychunk_ioctl_rsp)) { sizeof(struct copychunk_ioctl_rsp)) {
cifs_tcon_dbg(VFS, "invalid cchunk response size\n"); cifs_tcon_dbg(VFS, "Invalid cchunk response size\n");
rc = -EIO; rc = -EIO;
goto cchunk_out; goto cchunk_out;
} }
...@@ -1745,12 +1746,12 @@ smb2_copychunk_range(const unsigned int xid, ...@@ -1745,12 +1746,12 @@ smb2_copychunk_range(const unsigned int xid,
*/ */
if (le32_to_cpu(retbuf->TotalBytesWritten) > if (le32_to_cpu(retbuf->TotalBytesWritten) >
le32_to_cpu(pcchunk->Length)) { le32_to_cpu(pcchunk->Length)) {
cifs_tcon_dbg(VFS, "invalid copy chunk response\n"); cifs_tcon_dbg(VFS, "Invalid copy chunk response\n");
rc = -EIO; rc = -EIO;
goto cchunk_out; goto cchunk_out;
} }
if (le32_to_cpu(retbuf->ChunksWritten) != 1) { if (le32_to_cpu(retbuf->ChunksWritten) != 1) {
cifs_tcon_dbg(VFS, "invalid num chunks written\n"); cifs_tcon_dbg(VFS, "Invalid num chunks written\n");
rc = -EIO; rc = -EIO;
goto cchunk_out; goto cchunk_out;
} }
...@@ -2484,8 +2485,8 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -2484,8 +2485,8 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon,
free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base); free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base);
if (rc == -EREMCHG) { if (rc == -EREMCHG) {
tcon->need_reconnect = true; tcon->need_reconnect = true;
printk_once(KERN_WARNING "server share %s deleted\n", pr_warn_once("server share %s deleted\n",
tcon->treeName); tcon->treeName);
} }
goto qic_exit; goto qic_exit;
} }
...@@ -2765,15 +2766,15 @@ parse_reparse_point(struct reparse_data_buffer *buf, ...@@ -2765,15 +2766,15 @@ parse_reparse_point(struct reparse_data_buffer *buf,
struct cifs_sb_info *cifs_sb) struct cifs_sb_info *cifs_sb)
{ {
if (plen < sizeof(struct reparse_data_buffer)) { if (plen < sizeof(struct reparse_data_buffer)) {
cifs_dbg(VFS, "reparse buffer is too small. Must be " cifs_dbg(VFS, "reparse buffer is too small. Must be at least 8 bytes but was %d\n",
"at least 8 bytes but was %d\n", plen); plen);
return -EIO; return -EIO;
} }
if (plen < le16_to_cpu(buf->ReparseDataLength) + if (plen < le16_to_cpu(buf->ReparseDataLength) +
sizeof(struct reparse_data_buffer)) { sizeof(struct reparse_data_buffer)) {
cifs_dbg(VFS, "srv returned invalid reparse buf " cifs_dbg(VFS, "srv returned invalid reparse buf length: %d\n",
"length: %d\n", plen); plen);
return -EIO; return -EIO;
} }
...@@ -2788,8 +2789,8 @@ parse_reparse_point(struct reparse_data_buffer *buf, ...@@ -2788,8 +2789,8 @@ parse_reparse_point(struct reparse_data_buffer *buf,
(struct reparse_symlink_data_buffer *)buf, (struct reparse_symlink_data_buffer *)buf,
plen, target_path, cifs_sb); plen, target_path, cifs_sb);
default: default:
cifs_dbg(VFS, "srv returned unknown symlink buffer " cifs_dbg(VFS, "srv returned unknown symlink buffer tag:0x%08x\n",
"tag:0x%08x\n", le32_to_cpu(buf->ReparseTag)); le32_to_cpu(buf->ReparseTag));
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
} }
......
...@@ -334,8 +334,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) ...@@ -334,8 +334,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
(server->tcpStatus != CifsNeedReconnect), (server->tcpStatus != CifsNeedReconnect),
10 * HZ); 10 * HZ);
if (rc < 0) { if (rc < 0) {
cifs_dbg(FYI, "%s: aborting reconnect due to a received" cifs_dbg(FYI, "%s: aborting reconnect due to a received signal by the process\n",
" signal by the process\n", __func__); __func__);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
...@@ -404,7 +404,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) ...@@ -404,7 +404,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc); cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
if (rc) { if (rc) {
/* If sess reconnected but tcon didn't, something strange ... */ /* If sess reconnected but tcon didn't, something strange ... */
printk_once(KERN_WARNING "reconnect tcon failed rc = %d\n", rc); pr_warn_once("reconnect tcon failed rc = %d\n", rc);
goto out; goto out;
} }
...@@ -646,13 +646,13 @@ static void decode_preauth_context(struct smb2_preauth_neg_context *ctxt) ...@@ -646,13 +646,13 @@ static void decode_preauth_context(struct smb2_preauth_neg_context *ctxt)
/* If invalid preauth context warn but use what we requested, SHA-512 */ /* If invalid preauth context warn but use what we requested, SHA-512 */
if (len < MIN_PREAUTH_CTXT_DATA_LEN) { if (len < MIN_PREAUTH_CTXT_DATA_LEN) {
printk_once(KERN_WARNING "server sent bad preauth context\n"); pr_warn_once("server sent bad preauth context\n");
return; return;
} }
if (le16_to_cpu(ctxt->HashAlgorithmCount) != 1) if (le16_to_cpu(ctxt->HashAlgorithmCount) != 1)
printk_once(KERN_WARNING "illegal SMB3 hash algorithm count\n"); pr_warn_once("Invalid SMB3 hash algorithm count\n");
if (ctxt->HashAlgorithms != SMB2_PREAUTH_INTEGRITY_SHA512) if (ctxt->HashAlgorithms != SMB2_PREAUTH_INTEGRITY_SHA512)
printk_once(KERN_WARNING "unknown SMB3 hash algorithm\n"); pr_warn_once("unknown SMB3 hash algorithm\n");
} }
static void decode_compress_ctx(struct TCP_Server_Info *server, static void decode_compress_ctx(struct TCP_Server_Info *server,
...@@ -662,15 +662,15 @@ static void decode_compress_ctx(struct TCP_Server_Info *server, ...@@ -662,15 +662,15 @@ static void decode_compress_ctx(struct TCP_Server_Info *server,
/* sizeof compress context is a one element compression capbility struct */ /* sizeof compress context is a one element compression capbility struct */
if (len < 10) { if (len < 10) {
printk_once(KERN_WARNING "server sent bad compression cntxt\n"); pr_warn_once("server sent bad compression cntxt\n");
return; return;
} }
if (le16_to_cpu(ctxt->CompressionAlgorithmCount) != 1) { if (le16_to_cpu(ctxt->CompressionAlgorithmCount) != 1) {
printk_once(KERN_WARNING "illegal SMB3 compress algorithm count\n"); pr_warn_once("Invalid SMB3 compress algorithm count\n");
return; return;
} }
if (le16_to_cpu(ctxt->CompressionAlgorithms[0]) > 3) { if (le16_to_cpu(ctxt->CompressionAlgorithms[0]) > 3) {
printk_once(KERN_WARNING "unknown compression algorithm\n"); pr_warn_once("unknown compression algorithm\n");
return; return;
} }
server->compress_algorithm = ctxt->CompressionAlgorithms[0]; server->compress_algorithm = ctxt->CompressionAlgorithms[0];
...@@ -683,18 +683,18 @@ static int decode_encrypt_ctx(struct TCP_Server_Info *server, ...@@ -683,18 +683,18 @@ static int decode_encrypt_ctx(struct TCP_Server_Info *server,
cifs_dbg(FYI, "decode SMB3.11 encryption neg context of len %d\n", len); cifs_dbg(FYI, "decode SMB3.11 encryption neg context of len %d\n", len);
if (len < MIN_ENCRYPT_CTXT_DATA_LEN) { if (len < MIN_ENCRYPT_CTXT_DATA_LEN) {
printk_once(KERN_WARNING "server sent bad crypto ctxt len\n"); pr_warn_once("server sent bad crypto ctxt len\n");
return -EINVAL; return -EINVAL;
} }
if (le16_to_cpu(ctxt->CipherCount) != 1) { if (le16_to_cpu(ctxt->CipherCount) != 1) {
printk_once(KERN_WARNING "illegal SMB3.11 cipher count\n"); pr_warn_once("Invalid SMB3.11 cipher count\n");
return -EINVAL; return -EINVAL;
} }
cifs_dbg(FYI, "SMB311 cipher type:%d\n", le16_to_cpu(ctxt->Ciphers[0])); cifs_dbg(FYI, "SMB311 cipher type:%d\n", le16_to_cpu(ctxt->Ciphers[0]));
if ((ctxt->Ciphers[0] != SMB2_ENCRYPTION_AES128_CCM) && if ((ctxt->Ciphers[0] != SMB2_ENCRYPTION_AES128_CCM) &&
(ctxt->Ciphers[0] != SMB2_ENCRYPTION_AES128_GCM)) { (ctxt->Ciphers[0] != SMB2_ENCRYPTION_AES128_GCM)) {
printk_once(KERN_WARNING "invalid SMB3.11 cipher returned\n"); pr_warn_once("Invalid SMB3.11 cipher returned\n");
return -EINVAL; return -EINVAL;
} }
server->cipher_type = ctxt->Ciphers[0]; server->cipher_type = ctxt->Ciphers[0];
...@@ -794,7 +794,7 @@ create_posix_buf(umode_t mode) ...@@ -794,7 +794,7 @@ create_posix_buf(umode_t mode)
buf->Name[14] = 0xCD; buf->Name[14] = 0xCD;
buf->Name[15] = 0x7C; buf->Name[15] = 0x7C;
buf->Mode = cpu_to_le32(mode); buf->Mode = cpu_to_le32(mode);
cifs_dbg(FYI, "mode on posix create 0%o", mode); cifs_dbg(FYI, "mode on posix create 0%o\n", mode);
return buf; return buf;
} }
...@@ -806,7 +806,7 @@ add_posix_context(struct kvec *iov, unsigned int *num_iovec, umode_t mode) ...@@ -806,7 +806,7 @@ add_posix_context(struct kvec *iov, unsigned int *num_iovec, umode_t mode)
iov[num].iov_base = create_posix_buf(mode); iov[num].iov_base = create_posix_buf(mode);
if (mode == ACL_NO_MODE) if (mode == ACL_NO_MODE)
cifs_dbg(FYI, "illegal mode\n"); cifs_dbg(FYI, "Invalid mode\n");
if (iov[num].iov_base == NULL) if (iov[num].iov_base == NULL)
return -ENOMEM; return -ENOMEM;
iov[num].iov_len = sizeof(struct create_posix); iov[num].iov_len = sizeof(struct create_posix);
...@@ -924,9 +924,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) ...@@ -924,9 +924,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
* cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]); * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]);
*/ */
if (rc == -EOPNOTSUPP) { if (rc == -EOPNOTSUPP) {
cifs_server_dbg(VFS, "Dialect not supported by server. Consider " cifs_server_dbg(VFS, "Dialect not supported by server. Consider specifying vers=1.0 or vers=2.0 on mount for accessing older servers\n");
"specifying vers=1.0 or vers=2.0 on mount for accessing"
" older servers\n");
goto neg_exit; goto neg_exit;
} else if (rc != 0) } else if (rc != 0)
goto neg_exit; goto neg_exit;
...@@ -959,8 +957,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) ...@@ -959,8 +957,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
} else if (le16_to_cpu(rsp->DialectRevision) != } else if (le16_to_cpu(rsp->DialectRevision) !=
server->vals->protocol_id) { server->vals->protocol_id) {
/* if requested single dialect ensure returned dialect matched */ /* if requested single dialect ensure returned dialect matched */
cifs_server_dbg(VFS, "Illegal 0x%x dialect returned: not requested\n", cifs_server_dbg(VFS, "Invalid 0x%x dialect returned: not requested\n",
le16_to_cpu(rsp->DialectRevision)); le16_to_cpu(rsp->DialectRevision));
return -EIO; return -EIO;
} }
...@@ -977,8 +975,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) ...@@ -977,8 +975,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
else if (rsp->DialectRevision == cpu_to_le16(SMB311_PROT_ID)) else if (rsp->DialectRevision == cpu_to_le16(SMB311_PROT_ID))
cifs_dbg(FYI, "negotiated smb3.1.1 dialect\n"); cifs_dbg(FYI, "negotiated smb3.1.1 dialect\n");
else { else {
cifs_server_dbg(VFS, "Illegal dialect returned by server 0x%x\n", cifs_server_dbg(VFS, "Invalid dialect returned by server 0x%x\n",
le16_to_cpu(rsp->DialectRevision)); le16_to_cpu(rsp->DialectRevision));
rc = -EIO; rc = -EIO;
goto neg_exit; goto neg_exit;
} }
...@@ -1136,15 +1134,16 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) ...@@ -1136,15 +1134,16 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
rc = 0; rc = 0;
goto out_free_inbuf; goto out_free_inbuf;
} else if (rc != 0) { } else if (rc != 0) {
cifs_tcon_dbg(VFS, "validate protocol negotiate failed: %d\n", rc); cifs_tcon_dbg(VFS, "validate protocol negotiate failed: %d\n",
rc);
rc = -EIO; rc = -EIO;
goto out_free_inbuf; goto out_free_inbuf;
} }
rc = -EIO; rc = -EIO;
if (rsplen != sizeof(*pneg_rsp)) { if (rsplen != sizeof(*pneg_rsp)) {
cifs_tcon_dbg(VFS, "invalid protocol negotiate response size: %d\n", cifs_tcon_dbg(VFS, "Invalid protocol negotiate response size: %d\n",
rsplen); rsplen);
/* relax check since Mac returns max bufsize allowed on ioctl */ /* relax check since Mac returns max bufsize allowed on ioctl */
if (rsplen > CIFSMaxBufSize || rsplen < sizeof(*pneg_rsp)) if (rsplen > CIFSMaxBufSize || rsplen < sizeof(*pneg_rsp))
...@@ -1377,9 +1376,8 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data) ...@@ -1377,9 +1376,8 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data)
* 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) {
cifs_dbg(VFS, cifs_dbg(VFS, "bad cifs.upcall version. Expected %d got %d\n",
"bad cifs.upcall version. Expected %d got %d", CIFS_SPNEGO_UPCALL_VERSION, msg->version);
CIFS_SPNEGO_UPCALL_VERSION, msg->version);
rc = -EKEYREJECTED; rc = -EKEYREJECTED;
goto out_put_spnego_key; goto out_put_spnego_key;
} }
...@@ -1389,8 +1387,7 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data) ...@@ -1389,8 +1387,7 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data)
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) {
cifs_dbg(VFS, cifs_dbg(VFS, "Kerberos can't allocate (%u bytes) memory\n",
"Kerberos can't allocate (%u bytes) memory",
msg->sesskey_len); msg->sesskey_len);
rc = -ENOMEM; rc = -ENOMEM;
goto out_put_spnego_key; goto out_put_spnego_key;
...@@ -1604,8 +1601,7 @@ SMB2_select_sec(struct cifs_ses *ses, struct SMB2_sess_data *sess_data) ...@@ -1604,8 +1601,7 @@ SMB2_select_sec(struct cifs_ses *ses, struct SMB2_sess_data *sess_data)
type = smb2_select_sectype(cifs_ses_server(ses), ses->sectype); type = smb2_select_sectype(cifs_ses_server(ses), ses->sectype);
cifs_dbg(FYI, "sess setup type %d\n", type); cifs_dbg(FYI, "sess setup type %d\n", type);
if (type == Unspecified) { if (type == Unspecified) {
cifs_dbg(VFS, cifs_dbg(VFS, "Unable to select appropriate authentication method!\n");
"Unable to select appropriate authentication method!");
return -EINVAL; return -EINVAL;
} }
...@@ -2832,8 +2828,8 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, ...@@ -2832,8 +2828,8 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
trace_smb3_open_err(xid, tcon->tid, ses->Suid, trace_smb3_open_err(xid, tcon->tid, ses->Suid,
oparms->create_options, oparms->desired_access, rc); oparms->create_options, oparms->desired_access, rc);
if (rc == -EREMCHG) { if (rc == -EREMCHG) {
printk_once(KERN_WARNING "server share %s deleted\n", pr_warn_once("server share %s deleted\n",
tcon->treeName); tcon->treeName);
tcon->need_reconnect = true; tcon->need_reconnect = true;
} }
goto creat_exit; goto creat_exit;
...@@ -3245,7 +3241,7 @@ smb2_validate_iov(unsigned int offset, unsigned int buffer_length, ...@@ -3245,7 +3241,7 @@ smb2_validate_iov(unsigned int offset, unsigned int buffer_length,
} }
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)) {
cifs_dbg(VFS, "illegal server response, bad offset to data\n"); cifs_dbg(VFS, "Invalid server response, bad offset to data\n");
return -EINVAL; return -EINVAL;
} }
...@@ -4128,8 +4124,8 @@ smb2_writev_callback(struct mid_q_entry *mid) ...@@ -4128,8 +4124,8 @@ smb2_writev_callback(struct mid_q_entry *mid)
tcon->tid, tcon->ses->Suid, wdata->offset, tcon->tid, tcon->ses->Suid, wdata->offset,
wdata->bytes, wdata->result); wdata->bytes, wdata->result);
if (wdata->result == -ENOSPC) if (wdata->result == -ENOSPC)
printk_once(KERN_WARNING "Out of space writing to %s\n", pr_warn_once("Out of space writing to %s\n",
tcon->treeName); tcon->treeName);
} else } else
trace_smb3_write_done(0 /* no xid */, trace_smb3_write_done(0 /* no xid */,
wdata->cfile->fid.persistent_fid, wdata->cfile->fid.persistent_fid,
...@@ -4652,7 +4648,7 @@ smb2_parse_query_directory(struct cifs_tcon *tcon, ...@@ -4652,7 +4648,7 @@ smb2_parse_query_directory(struct cifs_tcon *tcon,
else if (resp_buftype == CIFS_SMALL_BUFFER) else if (resp_buftype == CIFS_SMALL_BUFFER)
srch_inf->smallBuf = true; srch_inf->smallBuf = true;
else else
cifs_tcon_dbg(VFS, "illegal search buffer type\n"); cifs_tcon_dbg(VFS, "Invalid search buffer type\n");
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -112,7 +112,7 @@ static void _cifs_mid_q_entry_release(struct kref *refcount) ...@@ -112,7 +112,7 @@ static void _cifs_mid_q_entry_release(struct kref *refcount)
#ifdef CONFIG_CIFS_STATS2 #ifdef CONFIG_CIFS_STATS2
now = jiffies; now = jiffies;
if (now < midEntry->when_alloc) if (now < midEntry->when_alloc)
cifs_server_dbg(VFS, "invalid mid allocation time\n"); cifs_server_dbg(VFS, "Invalid mid allocation time\n");
roundtrip_time = now - midEntry->when_alloc; roundtrip_time = now - midEntry->when_alloc;
if (smb_cmd < NUMBER_OF_SMB2_COMMANDS) { if (smb_cmd < NUMBER_OF_SMB2_COMMANDS) {
...@@ -151,12 +151,12 @@ static void _cifs_mid_q_entry_release(struct kref *refcount) ...@@ -151,12 +151,12 @@ static void _cifs_mid_q_entry_release(struct kref *refcount)
trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid, trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid,
midEntry->when_sent, midEntry->when_received); midEntry->when_sent, midEntry->when_received);
if (cifsFYI & CIFS_TIMER) { if (cifsFYI & CIFS_TIMER) {
pr_debug(" CIFS slow rsp: cmd %d mid %llu", pr_debug("slow rsp: cmd %d mid %llu",
midEntry->command, midEntry->mid); midEntry->command, midEntry->mid);
cifs_info(" A: 0x%lx S: 0x%lx R: 0x%lx\n", cifs_info("A: 0x%lx S: 0x%lx R: 0x%lx\n",
now - midEntry->when_alloc, now - midEntry->when_alloc,
now - midEntry->when_sent, now - midEntry->when_sent,
now - midEntry->when_received); now - midEntry->when_received);
} }
} }
#endif #endif
...@@ -477,8 +477,7 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, ...@@ -477,8 +477,7 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
return -ENOMEM; return -ENOMEM;
if (!server->ops->init_transform_rq) { if (!server->ops->init_transform_rq) {
cifs_server_dbg(VFS, "Encryption requested but transform " cifs_server_dbg(VFS, "Encryption requested but transform callback is missing\n");
"callback is missing\n");
return -EIO; return -EIO;
} }
...@@ -1300,8 +1299,8 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, ...@@ -1300,8 +1299,8 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
use ses->maxReq */ use ses->maxReq */
if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cifs_server_dbg(VFS, "Illegal length, greater than maximum frame, %d\n", cifs_server_dbg(VFS, "Invalid length, greater than maximum frame, %d\n",
len); len);
return -EIO; return -EIO;
} }
...@@ -1441,8 +1440,8 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -1441,8 +1440,8 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
use ses->maxReq */ use ses->maxReq */
if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
cifs_tcon_dbg(VFS, "Illegal length, greater than maximum frame, %d\n", cifs_tcon_dbg(VFS, "Invalid length, greater than maximum frame, %d\n",
len); len);
return -EIO; return -EIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment