Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 033078a9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag '4.20-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs updates from Steve French:
 "Three smb3 fixes for stable, patches for improved debugging and perf
  gathering, and much improved performance for most metadata operations
  (expanded use of compounding)"

* tag '4.20-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: (46 commits)
  cifs: update internal module version number for cifs.ko to 2.14
  smb3: add debug for unexpected mid cancellation
  cifs: allow calling SMB2_xxx_free(NULL)
  smb3 - clean up debug output displaying network interfaces
  smb3: show number of current open files in /proc/fs/cifs/Stats
  cifs: add support for ioctl on directories
  cifs: fallback to older infolevels on findfirst queryinfo retry
  smb3: do not attempt cifs operation in smb3 query info error path
  smb3: send backup intent on compounded query info
  cifs: track writepages in vfs operation counters
  smb2: fix uninitialized variable bug in smb2_ioctl_query_info
  cifs: add IOCTL for QUERY_INFO passthrough to userspace
  cifs: minor clarification in comments
  CIFS: Print message when attempting a mount
  CIFS: Adds information-level logging function
  cifs: OFD locks do not conflict with eachothers
  CIFS: SMBD: Do not call ib_dereg_mr on invalidated memory registration
  CIFS: pass page offsets on SMB1 read/write
  fs/cifs: fix uninitialised variable warnings
  smb3: add tracepoint for sending lease break responses to server
  ...
parents 7abe8493 38f876bb
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
	struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr;
	struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr;

	seq_printf(m, "\t\tSpeed: %zu bps\n", iface->speed);
	seq_printf(m, "\tSpeed: %zu bps\n", iface->speed);
	seq_puts(m, "\t\tCapabilities: ");
	if (iface->rdma_capable)
		seq_puts(m, "rdma ");
@@ -285,7 +285,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
			if ((ses->serverDomain == NULL) ||
				(ses->serverOS == NULL) ||
				(ses->serverNOS == NULL)) {
				seq_printf(m, "\n%d) Name: %s Uses: %d Capability: 0x%x\tSession Status: %d\t",
				seq_printf(m, "\n%d) Name: %s Uses: %d Capability: 0x%x\tSession Status: %d ",
					i, ses->serverName, ses->ses_count,
					ses->capabilities, ses->status);
				if (ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST)
@@ -296,16 +296,18 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
				seq_printf(m,
				    "\n%d) Name: %s  Domain: %s Uses: %d OS:"
				    " %s\n\tNOS: %s\tCapability: 0x%x\n\tSMB"
				    " session status: %d\t",
				    " session status: %d ",
				i, ses->serverName, ses->serverDomain,
				ses->ses_count, ses->serverOS, ses->serverNOS,
				ses->capabilities, ses->status);
			}
			if (server->rdma)
				seq_printf(m, "RDMA\n\t");
			seq_printf(m, "TCP status: %d\n\tLocal Users To "
			seq_printf(m, "TCP status: %d Instance: %d\n\tLocal Users To "
				   "Server: %d SecMode: 0x%x Req On Wire: %d",
				   server->tcpStatus, server->srv_count,
				   server->tcpStatus,
				   server->reconnect_instance,
				   server->srv_count,
				   server->sec_mode, in_flight(server));

#ifdef CONFIG_CIFS_STATS2
@@ -352,7 +354,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
				seq_printf(m, "\n\tServer interfaces: %zu\n",
					   ses->iface_count);
			for (j = 0; j < ses->iface_count; j++) {
				seq_printf(m, "\t%d)\n", j);
				seq_printf(m, "\t%d)", j);
				cifs_dump_iface(m, &ses->iface_list[j]);
			}
			spin_unlock(&ses->iface_lock);
@@ -383,6 +385,9 @@ static ssize_t cifs_stats_proc_write(struct file *file,
		atomic_set(&totBufAllocCount, 0);
		atomic_set(&totSmBufAllocCount, 0);
#endif /* CONFIG_CIFS_STATS2 */
		atomic_set(&tcpSesReconnectCount, 0);
		atomic_set(&tconInfoReconnectCount, 0);

		spin_lock(&GlobalMid_Lock);
		GlobalMaxActiveXid = 0;
		GlobalCurrentXid = 0;
+28 −0
Original line number Diff line number Diff line
@@ -47,6 +47,29 @@ extern int cifsFYI;
 */
#ifdef CONFIG_CIFS_DEBUG


/*
 * When adding tracepoints and debug messages we have various choices.
 * Some considerations:
 *
 * Use cifs_dbg(VFS, ...) for things we always want logged, and the user to see
 *     cifs_info(...) slightly less important, admin can filter via loglevel > 6
 *     cifs_dbg(FYI, ...) minor debugging messages, off by default
 *     trace_smb3_*  ftrace functions are preferred for complex debug messages
 *                 intended for developers or experienced admins, off by default
 */

/* Information level messages, minor events */
#define cifs_info_func(ratefunc, fmt, ...)			\
do {								\
	pr_info_ ## ratefunc("CIFS: " fmt, ##__VA_ARGS__); 	\
} while (0)

#define cifs_info(fmt, ...)					\
do { 								\
	cifs_info_func(ratelimited, fmt, ##__VA_ARGS__); 	\
} while (0)

/* information message: e.g., configuration, major event */
#define cifs_dbg_func(ratefunc, type, fmt, ...)			\
do {								\
@@ -81,6 +104,11 @@ do { \
	if (0)								\
		pr_debug(fmt, ##__VA_ARGS__);				\
} while (0)

#define cifs_info(fmt, ...)						\
do {									\
	pr_info("CIFS: "fmt, ##__VA_ARGS__);				\
} while (0)
#endif

#endif				/* _H_CIFS_DEBUG */
+6 −1
Original line number Diff line number Diff line
@@ -304,12 +304,17 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
	 */
	mnt = ERR_PTR(-ENOMEM);

	cifs_sb = CIFS_SB(mntpt->d_sb);
	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS) {
		mnt = ERR_PTR(-EREMOTE);
		goto cdda_exit;
	}

	/* always use tree name prefix */
	full_path = build_path_from_dentry_optional_prefix(mntpt, true);
	if (full_path == NULL)
		goto cdda_exit;

	cifs_sb = CIFS_SB(mntpt->d_sb);
	tlink = cifs_sb_tlink(cifs_sb);
	if (IS_ERR(tlink)) {
		mnt = ERR_CAST(tlink);
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@
					      */
#define CIFS_MOUNT_UID_FROM_ACL 0x2000000 /* try to get UID via special SID */
#define CIFS_MOUNT_NO_HANDLE_CACHE 0x4000000 /* disable caching dir handles */
#define CIFS_MOUNT_NO_DFS 0x8000000 /* disable DFS resolving */

struct cifs_sb_info {
	struct rb_root tlink_tree;
+11 −0
Original line number Diff line number Diff line
@@ -43,8 +43,19 @@ struct smb_snapshot_array {
	/*	snapshots[]; */
} __packed;

struct smb_query_info {
	__u32   info_type;
	__u32   file_info_class;
	__u32   additional_information;
	__u32   flags;
	__u32	input_buffer_length;
	__u32	output_buffer_length;
	/* char buffer[]; */
} __packed;

#define CIFS_IOCTL_MAGIC	0xCF
#define CIFS_IOC_COPYCHUNK_FILE	_IOW(CIFS_IOCTL_MAGIC, 3, int)
#define CIFS_IOC_SET_INTEGRITY  _IO(CIFS_IOCTL_MAGIC, 4)
#define CIFS_IOC_GET_MNT_INFO _IOR(CIFS_IOCTL_MAGIC, 5, struct smb_mnt_fs_info)
#define CIFS_ENUMERATE_SNAPSHOTS _IOR(CIFS_IOCTL_MAGIC, 6, struct smb_snapshot_array)
#define CIFS_QUERY_INFO _IOWR(CIFS_IOCTL_MAGIC, 7, struct smb_query_info)
Loading