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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
		if (rc == -EREMCHG) {
			tcon->need_reconnect = true;
			pr_warn_once("server share %s deleted\n",
				     tcon->treeName);
				     tcon->tree_name);
		}
		goto oshr_exit;
	}
+2 −2
Original line number Diff line number Diff line
@@ -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);

	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)
		seq_printf(m, "Type: %s ", tcon->nativeFileSystem);
	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)
		list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
			list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
				i++;
				seq_printf(m, "\n%d) %s", i, tcon->treeName);
				seq_printf(m, "\n%d) %s", i, tcon->tree_name);
				if (tcon->need_reconnect)
					seq_puts(m, "\tDISCONNECTED ");
				seq_printf(m, "\nSMBs: %d",
+3 −3
Original line number Diff line number Diff line
@@ -108,8 +108,8 @@ do { \
#define cifs_tcon_dbg_func(ratefunc, type, fmt, ...)			\
do {									\
	const char *tn = "";						\
	if (tcon && tcon->treeName)					\
		tn = tcon->treeName;					\
	if (tcon && tcon->tree_name)					\
		tn = tcon->tree_name;					\
	if ((type) & FYI && cifsFYI & CIFS_INFO) {			\
		pr_debug_ ## ratefunc("%s: %s "	fmt,			\
				      __FILE__, tn, ##__VA_ARGS__);	\
@@ -150,7 +150,7 @@ do { \
#define cifs_tcon_dbg(type, fmt, ...)					\
do {									\
	if (0)								\
		pr_debug("%s " fmt, tcon->treeName, ##__VA_ARGS__);	\
		pr_debug("%s " fmt, tcon->tree_name, ##__VA_ARGS__);	\
} while (0)

#define cifs_info(fmt, ...)						\
+6 −6
Original line number Diff line number Diff line
@@ -256,23 +256,23 @@ static struct cifs_swn_reg *cifs_find_swn_reg(struct cifs_tcon *tcon)
	const char *share_name;
	const char *net_name;

	net_name = extract_hostname(tcon->treeName);
	net_name = extract_hostname(tcon->tree_name);
	if (IS_ERR(net_name)) {
		int ret;

		ret = PTR_ERR(net_name);
		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);
	}

	share_name = extract_sharename(tcon->treeName);
	share_name = extract_sharename(tcon->tree_name);
	if (IS_ERR(share_name)) {
		int ret;

		ret = PTR_ERR(share_name);
		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);
		return ERR_PTR(-EINVAL);
	}
@@ -335,14 +335,14 @@ static struct cifs_swn_reg *cifs_get_swn_reg(struct cifs_tcon *tcon)
		goto fail;
	}

	reg->net_name = extract_hostname(tcon->treeName);
	reg->net_name = extract_hostname(tcon->tree_name);
	if (IS_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);
		goto fail_idr;
	}

	reg->share_name = extract_sharename(tcon->treeName);
	reg->share_name = extract_sharename(tcon->tree_name);
	if (IS_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);
+1 −1
Original line number Diff line number Diff line
@@ -1149,7 +1149,7 @@ struct cifs_tcon {
	struct list_head openFileList;
	spinlock_t open_file_lock; /* protects list above */
	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 *password;		/* for share-level security */
	__u32 tid;		/* The 4 byte tree id */
Loading