Commit e13300bd authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag '5.11-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs updates from Steve French:
 "The largest part are for support of the newer mount API which has been
  needed for cifs/smb3 mounts for a long time due to the new API's
  better handling of remount, and better error reporting. There are
  three additional small cleanup patches for this being tested, that are
  not included yet.

  This series also includes addition of support for the SMB3 witness
  protocol which can provide important notifications from the server to
  client on server address or export or network changes. This can be
  useful for example in order to be notified before the failure - when a
  server's IP address changes (in the future it will allow us to support
  server notifications of when a share is moved).

  It also includes three patches for stable e.g. some that better handle
  some confusing error messages during session establishment"

* tag '5.11-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6: (55 commits)
  cifs: update internal module version number
  cifs: Fix support for remount when not changing rsize/wsize
  cifs: handle "guest" mount parameter
  cifs: correct four aliased mount parms to allow use of previous names
  cifs: Tracepoints and logs for tracing credit changes.
  cifs: fix use after free in cifs_smb3_do_mount()
  cifs: fix rsize/wsize to be negotiated values
  cifs: Fix some error pointers handling detected by static checker
  smb3: remind users that witness protocol is experimental
  cifs: update super_operations to show_devname
  cifs: fix uninitialized variable in smb3_fs_context_parse_param
  cifs: update mnt_cifs_flags during reconfigure
  cifs: move update of flags into a separate function
  cifs: remove ctx argument from cifs_setup_cifs_sb
  cifs: do not allow changing posix_paths during remount
  cifs: uncomplicate printing the iocharset parameter
  cifs: don't create a temp nls in cifs_setup_ipc
  cifs: simplify handling of cifs_sb/ctx->local_nls
  cifs: we do not allow changing username/password/unc/... during remount
  cifs: add initial reconfigure support
  ...
parents d64c6f96 afee4410
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -60,9 +60,9 @@ config CIFS_STATS2
	  Enabling this option will allow more detailed statistics on SMB
	  request timing to be displayed in /proc/fs/cifs/DebugData and also
	  allow optional logging of slow responses to dmesg (depending on the
	  value of /proc/fs/cifs/cifsFYI, see fs/cifs/README for more details).
	  These additional statistics may have a minor effect on performance
	  and memory utilization.
	  value of /proc/fs/cifs/cifsFYI). See Documentation/admin-guide/cifs/usage.rst
	  for more details. These additional statistics may have a minor effect
	  on performance and memory utilization.

	  Unless you are a developer or are doing network performance analysis
	  or tuning, say N.
@@ -102,10 +102,10 @@ config CIFS_WEAK_PW_HASH
	  is enabled in the kernel build, LANMAN authentication will not be
	  used automatically. At runtime LANMAN mounts are disabled but
	  can be set to required (or optional) either in
	  /proc/fs/cifs (see fs/cifs/README for more detail) or via an
	  option on the mount command. This support is disabled by
	  default in order to reduce the possibility of a downgrade
	  attack.
	  /proc/fs/cifs (see Documentation/admin-guide/cifs/usage.rst for
	  more detail) or via an option on the mount command. This support
	  is disabled by default in order to reduce the possibility of a
	  downgrade attack.

	  If unsure, say N.

@@ -190,6 +190,17 @@ config CIFS_DFS_UPCALL
	  servers if their addresses change or for implicit mounts of
	  DFS junction points. If unsure, say Y.

config CIFS_SWN_UPCALL
	bool "SWN feature support"
	depends on CIFS
	help
	  The Service Witness Protocol (SWN) is used to get notifications
	  from a highly available server of resource state changes. This
	  feature enables an upcall mechanism for CIFS which contacts a
	  userspace daemon to establish the DCE/RPC connection to retrieve
	  the cluster available interfaces and resource change notifications.
	  If unsure, say Y.

config CIFS_NFSD_EXPORT
	bool "Allow nfsd to export CIFS file system"
	depends on CIFS && BROKEN
+3 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ obj-$(CONFIG_CIFS) += cifs.o
cifs-y := trace.o cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o \
	  inode.o link.o misc.o netmisc.o smbencrypt.o transport.o asn1.o \
	  cifs_unicode.o nterr.o cifsencrypt.o \
	  readdir.o ioctl.o sess.o export.o smb1ops.o winucase.o \
	  readdir.o ioctl.o sess.o export.o smb1ops.o unc.o winucase.o \
	  smb2ops.o smb2maperror.o smb2transport.o \
	  smb2misc.o smb2pdu.o smb2inode.o smb2file.o cifsacl.o fs_context.o

@@ -18,6 +18,8 @@ cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o

cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o dfs_cache.o

cifs-$(CONFIG_CIFS_SWN_UPCALL) += netlink.o cifs_swn.o

cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o

cifs-$(CONFIG_CIFS_SMB_DIRECT) += smbdirect.o
+0 −24
Original line number Diff line number Diff line
@@ -53,30 +53,6 @@ const struct fscache_cookie_def cifs_fscache_server_index_def = {
	.type = FSCACHE_COOKIE_TYPE_INDEX,
};

char *extract_sharename(const char *treename)
{
	const char *src;
	char *delim, *dst;
	int len;

	/* skip double chars at the beginning */
	src = treename + 2;

	/* share name is always preceded by '\\' now */
	delim = strchr(src, '\\');
	if (!delim)
		return ERR_PTR(-EINVAL);
	delim++;
	len = strlen(delim);

	/* caller has to free the memory */
	dst = kstrndup(delim, len, GFP_KERNEL);
	if (!dst)
		return ERR_PTR(-ENOMEM);

	return dst;
}

static enum
fscache_checkaux cifs_fscache_super_check_aux(void *cookie_netfs_data,
					      const void *data,
+13 −0
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@
#ifdef CONFIG_CIFS_SMB_DIRECT
#include "smbdirect.h"
#endif
#ifdef CONFIG_CIFS_SWN_UPCALL
#include "cifs_swn.h"
#endif

void
cifs_dump_mem(char *label, void *data, int length)
@@ -115,6 +118,10 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
		seq_printf(m, " POSIX Extensions");
	if (tcon->ses->server->ops->dump_share_caps)
		tcon->ses->server->ops->dump_share_caps(m, tcon);
#ifdef CONFIG_CIFS_SWN_UPCALL
	if (tcon->use_witness)
		seq_puts(m, " Witness");
#endif

	if (tcon->need_reconnect)
		seq_puts(m, "\tDISCONNECTED ");
@@ -262,6 +269,9 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
	seq_printf(m, ",XATTR");
#endif
	seq_printf(m, ",ACL");
#ifdef CONFIG_CIFS_SWN_UPCALL
	seq_puts(m, ",WITNESS");
#endif
	seq_putc(m, '\n');
	seq_printf(m, "CIFSMaxBufSize: %d\n", CIFSMaxBufSize);
	seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid);
@@ -462,6 +472,9 @@ skip_rdma:
	spin_unlock(&cifs_tcp_ses_lock);
	seq_putc(m, '\n');

#ifdef CONFIG_CIFS_SWN_UPCALL
	cifs_swn_dump(m);
#endif
	/* BB add code to dump additional info such as TCP session info now */
	return 0;
}
+10 −9
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "cifs_debug.h"
#include "cifs_unicode.h"
#include "dfs_cache.h"
#include "fs_context.h"

static LIST_HEAD(cifs_dfs_automount_list);

@@ -124,7 +125,6 @@ cifs_build_devname(char *nodename, const char *prepath)
 * @sb_mountdata:	parent/root DFS mount options (template)
 * @fullpath:		full path in UNC format
 * @ref:		optional server's referral
 * @devname:		optional pointer for saving device name
 *
 * creates mount options for submount based on template options sb_mountdata
 * and replacing unc,ip,prefixpath options with ones we've got form ref_unc.
@@ -134,8 +134,7 @@ cifs_build_devname(char *nodename, const char *prepath)
 */
char *cifs_compose_mount_options(const char *sb_mountdata,
				   const char *fullpath,
				   const struct dfs_info3_param *ref,
				   char **devname)
				   const struct dfs_info3_param *ref)
{
	int rc;
	char *name;
@@ -232,9 +231,6 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
	strcat(mountdata, "ip=");
	strcat(mountdata, srvIP);

	if (devname)
		*devname = name;
	else
	kfree(name);

	/*cifs_dbg(FYI, "%s: parent mountdata: %s\n", __func__, sb_mountdata);*/
@@ -258,6 +254,7 @@ compose_mount_options_err:
 * to perform failover in case we failed to connect to the first target in the
 * referral.
 *
 * @mntpt:		directory entry for the path we are trying to automount
 * @cifs_sb:		parent/root superblock
 * @fullpath:		full path in UNC format
 */
@@ -275,9 +272,13 @@ static struct vfsmount *cifs_dfs_do_mount(struct dentry *mntpt,

	convert_delimiter(devname, '/');

	/* TODO: change to call fs_context_for_mount(), fill in context directly, call fc_mount */

	/* See afs_mntpt_do_automount in fs/afs/mntpt.c for an example */

	/* strip first '\' from fullpath */
	mountdata = cifs_compose_mount_options(cifs_sb->mountdata,
					       fullpath + 1, NULL, NULL);
	mountdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options,
					       fullpath + 1, NULL);
	if (IS_ERR(mountdata)) {
		kfree(devname);
		return (struct vfsmount *)mountdata;
Loading