Commit 68e14569 authored by Steve French's avatar Steve French

smb3: add dynamic trace points for tree disconnect

Needed this for debugging a failing xfstest.
Also change camel case for "treeName" to "tree_name" in tcon struct.

Example trace output (from "trace-cmd record -e smb3_tdis*"):
          umount-9718    [006] .....  5909.780244: smb3_tdis_enter: xid=206 sid=0xcf38894e tid=0x3d0b8cf8 path=\\localhost\test
          umount-9718    [007] .....  5909.780878: smb3_tdis_done: xid=206 sid=0xcf38894e tid=0x3d0b8cf8
Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 0350d7a3
...@@ -160,7 +160,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, ...@@ -160,7 +160,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
if (rc == -EREMCHG) { if (rc == -EREMCHG) {
tcon->need_reconnect = true; tcon->need_reconnect = true;
pr_warn_once("server share %s deleted\n", pr_warn_once("server share %s deleted\n",
tcon->treeName); tcon->tree_name);
} }
goto oshr_exit; goto oshr_exit;
} }
......
...@@ -87,7 +87,7 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon) ...@@ -87,7 +87,7 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
{ {
__u32 dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType); __u32 dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
seq_printf(m, "%s Mounts: %d ", tcon->treeName, tcon->tc_count); seq_printf(m, "%s Mounts: %d ", tcon->tree_name, tcon->tc_count);
if (tcon->nativeFileSystem) if (tcon->nativeFileSystem)
seq_printf(m, "Type: %s ", tcon->nativeFileSystem); seq_printf(m, "Type: %s ", tcon->nativeFileSystem);
seq_printf(m, "DevInfo: 0x%x Attributes: 0x%x\n\tPathComponentMax: %d Status: %d", seq_printf(m, "DevInfo: 0x%x Attributes: 0x%x\n\tPathComponentMax: %d Status: %d",
...@@ -601,7 +601,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) ...@@ -601,7 +601,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
i++; i++;
seq_printf(m, "\n%d) %s", i, tcon->treeName); seq_printf(m, "\n%d) %s", i, tcon->tree_name);
if (tcon->need_reconnect) if (tcon->need_reconnect)
seq_puts(m, "\tDISCONNECTED "); seq_puts(m, "\tDISCONNECTED ");
seq_printf(m, "\nSMBs: %d", seq_printf(m, "\nSMBs: %d",
......
...@@ -108,8 +108,8 @@ do { \ ...@@ -108,8 +108,8 @@ do { \
#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->tree_name) \
tn = tcon->treeName; \ tn = tcon->tree_name; \
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__); \
...@@ -150,7 +150,7 @@ do { \ ...@@ -150,7 +150,7 @@ do { \
#define cifs_tcon_dbg(type, fmt, ...) \ #define cifs_tcon_dbg(type, fmt, ...) \
do { \ do { \
if (0) \ if (0) \
pr_debug("%s " fmt, tcon->treeName, ##__VA_ARGS__); \ pr_debug("%s " fmt, tcon->tree_name, ##__VA_ARGS__); \
} while (0) } while (0)
#define cifs_info(fmt, ...) \ #define cifs_info(fmt, ...) \
......
...@@ -256,23 +256,23 @@ static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon) ...@@ -256,23 +256,23 @@ static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon)
const char *share_name; const char *share_name;
const char *net_name; const char *net_name;
net_name = extract_hostname(tcon->treeName); net_name = extract_hostname(tcon->tree_name);
if (IS_ERR(net_name)) { if (IS_ERR(net_name)) {
int ret; int ret;
ret = PTR_ERR(net_name); ret = PTR_ERR(net_name);
cifs_dbg(VFS, "%s: failed to extract host name from target '%s': %d\n", cifs_dbg(VFS, "%s: failed to extract host name from target '%s': %d\n",
__func__, tcon->treeName, ret); __func__, tcon->tree_name, ret);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
share_name = extract_sharename(tcon->treeName); share_name = extract_sharename(tcon->tree_name);
if (IS_ERR(share_name)) { if (IS_ERR(share_name)) {
int ret; int ret;
ret = PTR_ERR(share_name); ret = PTR_ERR(share_name);
cifs_dbg(VFS, "%s: failed to extract share name from target '%s': %d\n", cifs_dbg(VFS, "%s: failed to extract share name from target '%s': %d\n",
__func__, tcon->treeName, ret); __func__, tcon->tree_name, ret);
kfree(net_name); kfree(net_name);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
...@@ -335,14 +335,14 @@ static struct cifs_swn_reg *cifs_get_swn_reg(struct cifs_tcon *tcon) ...@@ -335,14 +335,14 @@ static struct cifs_swn_reg *cifs_get_swn_reg(struct cifs_tcon *tcon)
goto fail; goto fail;
} }
reg->net_name = extract_hostname(tcon->treeName); reg->net_name = extract_hostname(tcon->tree_name);
if (IS_ERR(reg->net_name)) { if (IS_ERR(reg->net_name)) {
ret = PTR_ERR(reg->net_name); ret = PTR_ERR(reg->net_name);
cifs_dbg(VFS, "%s: failed to extract host name from target: %d\n", __func__, ret); cifs_dbg(VFS, "%s: failed to extract host name from target: %d\n", __func__, ret);
goto fail_idr; goto fail_idr;
} }
reg->share_name = extract_sharename(tcon->treeName); reg->share_name = extract_sharename(tcon->tree_name);
if (IS_ERR(reg->share_name)) { if (IS_ERR(reg->share_name)) {
ret = PTR_ERR(reg->share_name); ret = PTR_ERR(reg->share_name);
cifs_dbg(VFS, "%s: failed to extract share name from target: %d\n", __func__, ret); cifs_dbg(VFS, "%s: failed to extract share name from target: %d\n", __func__, ret);
......
...@@ -1149,7 +1149,7 @@ struct cifs_tcon { ...@@ -1149,7 +1149,7 @@ struct cifs_tcon {
struct list_head openFileList; struct list_head openFileList;
spinlock_t open_file_lock; /* protects list above */ spinlock_t open_file_lock; /* protects list above */
struct cifs_ses *ses; /* pointer to session associated with */ struct cifs_ses *ses; /* pointer to session associated with */
char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */ char tree_name[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */
char *nativeFileSystem; char *nativeFileSystem;
char *password; /* for share-level security */ char *password; /* for share-level security */
__u32 tid; /* The 4 byte tree id */ __u32 tid; /* The 4 byte tree id */
......
...@@ -1940,7 +1940,8 @@ void cifs_put_smb_ses(struct cifs_ses *ses) ...@@ -1940,7 +1940,8 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
spin_unlock(&ses->ses_lock); spin_unlock(&ses->ses_lock);
cifs_dbg(FYI, "%s: ses_count=%d\n", __func__, ses->ses_count); cifs_dbg(FYI, "%s: ses_count=%d\n", __func__, ses->ses_count);
cifs_dbg(FYI, "%s: ses ipc: %s\n", __func__, ses->tcon_ipc ? ses->tcon_ipc->treeName : "NONE"); cifs_dbg(FYI,
"%s: ses ipc: %s\n", __func__, ses->tcon_ipc ? ses->tcon_ipc->tree_name : "NONE");
spin_lock(&cifs_tcp_ses_lock); spin_lock(&cifs_tcp_ses_lock);
if (--ses->ses_count > 0) { if (--ses->ses_count > 0) {
...@@ -2293,7 +2294,7 @@ static int match_tcon(struct cifs_tcon *tcon, struct smb3_fs_context *ctx) ...@@ -2293,7 +2294,7 @@ static int match_tcon(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
{ {
if (tcon->status == TID_EXITING) if (tcon->status == TID_EXITING)
return 0; return 0;
if (strncmp(tcon->treeName, ctx->UNC, MAX_TREE_SIZE)) if (strncmp(tcon->tree_name, ctx->UNC, MAX_TREE_SIZE))
return 0; return 0;
if (tcon->seal != ctx->seal) if (tcon->seal != ctx->seal)
return 0; return 0;
...@@ -3989,7 +3990,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses, ...@@ -3989,7 +3990,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
} }
bcc_ptr += length + 1; bcc_ptr += length + 1;
bytes_left -= (length + 1); bytes_left -= (length + 1);
strscpy(tcon->treeName, tree, sizeof(tcon->treeName)); strscpy(tcon->tree_name, tree, sizeof(tcon->tree_name));
/* mostly informational -- no need to fail on error here */ /* mostly informational -- no need to fail on error here */
kfree(tcon->nativeFileSystem); kfree(tcon->nativeFileSystem);
...@@ -4197,7 +4198,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) ...@@ -4197,7 +4198,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
ctx->local_nls = cifs_sb->local_nls; ctx->local_nls = cifs_sb->local_nls;
ctx->linux_uid = fsuid; ctx->linux_uid = fsuid;
ctx->cred_uid = fsuid; ctx->cred_uid = fsuid;
ctx->UNC = master_tcon->treeName; ctx->UNC = master_tcon->tree_name;
ctx->retry = master_tcon->retry; ctx->retry = master_tcon->retry;
ctx->nocase = master_tcon->nocase; ctx->nocase = master_tcon->nocase;
ctx->nohandlecache = master_tcon->nohandlecache; ctx->nohandlecache = master_tcon->nohandlecache;
...@@ -4663,7 +4664,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru ...@@ -4663,7 +4664,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
/* If it is not dfs or there was no cached dfs referral, then reconnect to same share */ /* If it is not dfs or there was no cached dfs referral, then reconnect to same share */
if (!server->current_fullpath || if (!server->current_fullpath ||
dfs_cache_noreq_find(server->current_fullpath + 1, &ref, &tl)) { dfs_cache_noreq_find(server->current_fullpath + 1, &ref, &tl)) {
rc = ops->tree_connect(xid, tcon->ses, tcon->treeName, tcon, cifs_sb->local_nls); rc = ops->tree_connect(xid, tcon->ses, tcon->tree_name, tcon, cifs_sb->local_nls);
goto out; goto out;
} }
...@@ -4707,7 +4708,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru ...@@ -4707,7 +4708,7 @@ int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const stru
tcon->status = TID_IN_TCON; tcon->status = TID_IN_TCON;
spin_unlock(&tcon->tc_lock); spin_unlock(&tcon->tc_lock);
rc = ops->tree_connect(xid, tcon->ses, tcon->treeName, tcon, nlsc); rc = ops->tree_connect(xid, tcon->ses, tcon->tree_name, tcon, nlsc);
if (rc) { if (rc) {
spin_lock(&tcon->tc_lock); spin_lock(&tcon->tc_lock);
if (tcon->status == TID_IN_TCON) if (tcon->status == TID_IN_TCON)
......
...@@ -98,7 +98,7 @@ static struct cifs_ses *find_ipc_from_server_path(struct cifs_ses **ses, const c ...@@ -98,7 +98,7 @@ static struct cifs_ses *find_ipc_from_server_path(struct cifs_ses **ses, const c
get_ipc_unc(path, unc, sizeof(unc)); get_ipc_unc(path, unc, sizeof(unc));
for (; *ses; ses++) { for (; *ses; ses++) {
if (!strcasecmp(unc, (*ses)->tcon_ipc->treeName)) if (!strcasecmp(unc, (*ses)->tcon_ipc->tree_name))
return *ses; return *ses;
} }
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
......
...@@ -50,7 +50,7 @@ cifs_build_path_to_root(struct smb3_fs_context *ctx, struct cifs_sb_info *cifs_s ...@@ -50,7 +50,7 @@ cifs_build_path_to_root(struct smb3_fs_context *ctx, struct cifs_sb_info *cifs_s
} }
if (add_treename) if (add_treename)
dfsplen = strnlen(tcon->treeName, MAX_TREE_SIZE + 1); dfsplen = strnlen(tcon->tree_name, MAX_TREE_SIZE + 1);
else else
dfsplen = 0; dfsplen = 0;
...@@ -59,7 +59,7 @@ cifs_build_path_to_root(struct smb3_fs_context *ctx, struct cifs_sb_info *cifs_s ...@@ -59,7 +59,7 @@ cifs_build_path_to_root(struct smb3_fs_context *ctx, struct cifs_sb_info *cifs_s
return full_path; return full_path;
if (dfsplen) if (dfsplen)
memcpy(full_path, tcon->treeName, dfsplen); memcpy(full_path, tcon->tree_name, dfsplen);
full_path[dfsplen] = CIFS_DIR_SEP(cifs_sb); full_path[dfsplen] = CIFS_DIR_SEP(cifs_sb);
memcpy(full_path + dfsplen + 1, ctx->prepath, pplen); memcpy(full_path + dfsplen + 1, ctx->prepath, pplen);
convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb)); convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb));
...@@ -93,7 +93,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, void *page, ...@@ -93,7 +93,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, void *page,
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
if (prefix) if (prefix)
dfsplen = strnlen(tcon->treeName, MAX_TREE_SIZE + 1); dfsplen = strnlen(tcon->tree_name, MAX_TREE_SIZE + 1);
else else
dfsplen = 0; dfsplen = 0;
...@@ -123,7 +123,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, void *page, ...@@ -123,7 +123,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, void *page,
} }
if (dfsplen) { if (dfsplen) {
s -= dfsplen; s -= dfsplen;
memcpy(s, tcon->treeName, dfsplen); memcpy(s, tcon->tree_name, dfsplen);
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) { if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) {
int i; int i;
for (i = 0; i < dfsplen; i++) { for (i = 0; i < dfsplen; i++) {
......
...@@ -45,7 +45,7 @@ int cifs_fscache_get_super_cookie(struct cifs_tcon *tcon) ...@@ -45,7 +45,7 @@ int cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
memset(&key, 0, sizeof(key)); memset(&key, 0, sizeof(key));
sharename = extract_sharename(tcon->treeName); sharename = extract_sharename(tcon->tree_name);
if (IS_ERR(sharename)) { if (IS_ERR(sharename)) {
cifs_dbg(FYI, "%s: couldn't extract sharename\n", __func__); cifs_dbg(FYI, "%s: couldn't extract sharename\n", __func__);
return -EINVAL; return -EINVAL;
......
...@@ -913,7 +913,7 @@ cifs_set_fattr_ino(int xid, ...@@ -913,7 +913,7 @@ cifs_set_fattr_ino(int xid,
} else { } else {
/* make an ino by hashing the UNC */ /* make an ino by hashing the UNC */
fattr->cf_flags |= CIFS_FATTR_FAKE_ROOT_INO; fattr->cf_flags |= CIFS_FATTR_FAKE_ROOT_INO;
fattr->cf_uniqueid = simple_hashstr(tcon->treeName); fattr->cf_uniqueid = simple_hashstr(tcon->tree_name);
} }
} }
} }
......
...@@ -525,7 +525,7 @@ cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb) ...@@ -525,7 +525,7 @@ 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->tree_name : "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");
...@@ -1328,7 +1328,7 @@ int cifs_dfs_query_info_nonascii_quirk(const unsigned int xid, ...@@ -1328,7 +1328,7 @@ int cifs_dfs_query_info_nonascii_quirk(const unsigned int xid,
char *treename, *dfspath, sep; char *treename, *dfspath, sep;
int treenamelen, linkpathlen, rc; int treenamelen, linkpathlen, rc;
treename = tcon->treeName; treename = tcon->tree_name;
/* MS-DFSC: All paths in REQ_GET_DFS_REFERRAL and RESP_GET_DFS_REFERRAL /* MS-DFSC: All paths in REQ_GET_DFS_REFERRAL and RESP_GET_DFS_REFERRAL
* messages MUST be encoded with exactly one leading backslash, not two * messages MUST be encoded with exactly one leading backslash, not two
* leading backslashes. * leading backslashes.
......
...@@ -379,7 +379,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -379,7 +379,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) {
pr_warn_once("server share %s deleted\n", tcon->treeName); pr_warn_once("server share %s deleted\n", tcon->tree_name);
tcon->need_reconnect = true; tcon->need_reconnect = true;
} }
......
...@@ -1327,7 +1327,7 @@ SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -1327,7 +1327,7 @@ SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon,
CIFSMaxBufSize, (char **)&res_key, &ret_data_len); CIFSMaxBufSize, (char **)&res_key, &ret_data_len);
if (rc == -EOPNOTSUPP) { if (rc == -EOPNOTSUPP) {
pr_warn_once("Server share %s does not support copy range\n", tcon->treeName); pr_warn_once("Server share %s does not support copy range\n", tcon->tree_name);
goto req_res_key_exit; goto req_res_key_exit;
} else if (rc) { } else if (rc) {
cifs_tcon_dbg(VFS, "refcpy ioctl error %d getting resume key\n", rc); cifs_tcon_dbg(VFS, "refcpy ioctl error %d getting resume key\n", rc);
...@@ -2289,7 +2289,7 @@ smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server) ...@@ -2289,7 +2289,7 @@ smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server)
spin_unlock(&tcon->tc_lock); spin_unlock(&tcon->tc_lock);
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
pr_warn_once("Server share %s deleted.\n", pr_warn_once("Server share %s deleted.\n",
tcon->treeName); tcon->tree_name);
return; return;
} }
} }
...@@ -2498,7 +2498,7 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -2498,7 +2498,7 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon,
if (rc == -EREMCHG) { if (rc == -EREMCHG) {
tcon->need_reconnect = true; tcon->need_reconnect = true;
pr_warn_once("server share %s deleted\n", pr_warn_once("server share %s deleted\n",
tcon->treeName); tcon->tree_name);
} }
goto qic_exit; goto qic_exit;
} }
......
...@@ -1930,7 +1930,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, ...@@ -1930,7 +1930,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
tcon->capabilities = rsp->Capabilities; /* we keep caps little endian */ tcon->capabilities = rsp->Capabilities; /* we keep caps little endian */
tcon->maximal_access = le32_to_cpu(rsp->MaximalAccess); tcon->maximal_access = le32_to_cpu(rsp->MaximalAccess);
tcon->tid = le32_to_cpu(rsp->hdr.Id.SyncId.TreeId); tcon->tid = le32_to_cpu(rsp->hdr.Id.SyncId.TreeId);
strscpy(tcon->treeName, tree, sizeof(tcon->treeName)); strscpy(tcon->tree_name, tree, sizeof(tcon->tree_name));
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))
...@@ -1973,6 +1973,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) ...@@ -1973,6 +1973,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
if (!ses || !(ses->server)) if (!ses || !(ses->server))
return -EIO; return -EIO;
trace_smb3_tdis_enter(xid, tcon->tid, ses->Suid, tcon->tree_name);
spin_lock(&ses->chan_lock); spin_lock(&ses->chan_lock);
if ((tcon->need_reconnect) || if ((tcon->need_reconnect) ||
(CIFS_ALL_CHANS_NEED_RECONNECT(tcon->ses))) { (CIFS_ALL_CHANS_NEED_RECONNECT(tcon->ses))) {
...@@ -2004,8 +2005,11 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) ...@@ -2004,8 +2005,11 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
rc = cifs_send_recv(xid, ses, ses->server, rc = cifs_send_recv(xid, ses, ses->server,
&rqst, &resp_buf_type, flags, &rsp_iov); &rqst, &resp_buf_type, flags, &rsp_iov);
cifs_small_buf_release(req); cifs_small_buf_release(req);
if (rc) if (rc) {
cifs_stats_fail_inc(tcon, SMB2_TREE_DISCONNECT_HE); cifs_stats_fail_inc(tcon, SMB2_TREE_DISCONNECT_HE);
trace_smb3_tdis_err(xid, tcon->tid, ses->Suid, rc);
}
trace_smb3_tdis_done(xid, tcon->tid, ses->Suid);
return rc; return rc;
} }
...@@ -2674,7 +2678,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode, ...@@ -2674,7 +2678,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
req->hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS; req->hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS;
rc = alloc_path_with_tree_prefix(&copy_path, &copy_size, rc = alloc_path_with_tree_prefix(&copy_path, &copy_size,
&name_len, &name_len,
tcon->treeName, utf16_path); tcon->tree_name, utf16_path);
if (rc) if (rc)
goto err_free_req; goto err_free_req;
...@@ -2816,7 +2820,7 @@ SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, ...@@ -2816,7 +2820,7 @@ SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
req->hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS; req->hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS;
rc = alloc_path_with_tree_prefix(&copy_path, &copy_size, rc = alloc_path_with_tree_prefix(&copy_path, &copy_size,
&name_len, &name_len,
tcon->treeName, path); tcon->tree_name, path);
if (rc) if (rc)
return rc; return rc;
req->NameLength = cpu_to_le16(name_len * 2); req->NameLength = cpu_to_le16(name_len * 2);
...@@ -3011,7 +3015,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, ...@@ -3011,7 +3015,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
oparms->create_options, oparms->desired_access, rc); oparms->create_options, oparms->desired_access, rc);
if (rc == -EREMCHG) { if (rc == -EREMCHG) {
pr_warn_once("server share %s deleted\n", pr_warn_once("server share %s deleted\n",
tcon->treeName); tcon->tree_name);
tcon->need_reconnect = true; tcon->need_reconnect = true;
} }
goto creat_exit; goto creat_exit;
...@@ -4429,7 +4433,7 @@ smb2_writev_callback(struct mid_q_entry *mid) ...@@ -4429,7 +4433,7 @@ smb2_writev_callback(struct mid_q_entry *mid)
wdata->bytes, wdata->result); wdata->bytes, wdata->result);
if (wdata->result == -ENOSPC) if (wdata->result == -ENOSPC)
pr_warn_once("Out of space writing to %s\n", pr_warn_once("Out of space writing to %s\n",
tcon->treeName); tcon->tree_name);
} 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,
......
...@@ -372,6 +372,7 @@ DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_eof_enter); ...@@ -372,6 +372,7 @@ DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_eof_enter);
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_info_compound_enter); DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(set_info_compound_enter);
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(delete_enter); DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(delete_enter);
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mkdir_enter); DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mkdir_enter);
DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(tdis_enter);
DECLARE_EVENT_CLASS(smb3_inf_compound_done_class, DECLARE_EVENT_CLASS(smb3_inf_compound_done_class,
...@@ -409,6 +410,7 @@ DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_eof_done); ...@@ -409,6 +410,7 @@ DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_eof_done);
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_info_compound_done); DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(set_info_compound_done);
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(delete_done); DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(delete_done);
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mkdir_done); DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mkdir_done);
DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(tdis_done);
DECLARE_EVENT_CLASS(smb3_inf_compound_err_class, DECLARE_EVENT_CLASS(smb3_inf_compound_err_class,
...@@ -451,6 +453,7 @@ DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_eof_err); ...@@ -451,6 +453,7 @@ DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_eof_err);
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_info_compound_err); DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(set_info_compound_err);
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mkdir_err); DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mkdir_err);
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(delete_err); DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(delete_err);
DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(tdis_err);
/* /*
* For logging SMB3 Status code and Command for responses which return errors * For logging SMB3 Status code and Command for responses which return errors
......
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