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

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

Merge branch 'for-next-3.17' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs/smb3 fixes from Steve French:
 "This includes various cifs and smb3 bug fixes including those for bugs
  found with the recently updated xfstests.

  Also I am working fixes for two additional cifs problems found by
  xfstests which I plan to send later (when reviewed and run additional
  tests)"

* 'for-next-3.17' of git://git.samba.org/sfrench/cifs-2.6:
  Clarify Kconfig help text for CIFS and SMB2/SMB3
  CIFS: Fix wrong filename length for SMB2
  CIFS: Fix wrong restart readdir for SMB1
  CIFS: Fix directory rename error
  cifs: No need to send SIGKILL to demux_thread during umount
  cifs: Allow directIO read/write during cache=strict
  cifs: remove unneeded check of null checking in if condition
  cifs: fix a possible use of uninit variable in SMB2_sess_setup
  cifs: fix memory leak when password is supplied multiple times
  cifs: fix a possible null pointer deref in decode_ascii_ssetup
  Trivial whitespace fix
parents 619df5d2 ca5d13fc
Loading
Loading
Loading
Loading
+23 −12
Original line number Diff line number Diff line
@@ -22,6 +22,11 @@ config CIFS
	  support for OS/2 and Windows ME and similar servers is provided as
	  well.

	  The module also provides optional support for the followon
	  protocols for CIFS including SMB3, which enables
	  useful performance and security features (see the description
	  of CONFIG_CIFS_SMB2).

	  The cifs module provides an advanced network file system
	  client for mounting to CIFS compliant servers.  It includes
	  support for DFS (hierarchical name space), secure per-user
@@ -121,7 +126,8 @@ config CIFS_ACL
	  depends on CIFS_XATTR && KEYS
	  help
	    Allows fetching CIFS/NTFS ACL from the server.  The DACL blob
	    is handed over to the application/caller.
	    is handed over to the application/caller.  See the man
	    page for getcifsacl for more information.

config CIFS_DEBUG
	bool "Enable CIFS debugging routines"
@@ -162,7 +168,7 @@ config CIFS_NFSD_EXPORT
	   Allows NFS server to export a CIFS mounted share (nfsd over cifs)

config CIFS_SMB2
	bool "SMB2 network file system support"
	bool "SMB2 and SMB3 network file system support"
	depends on CIFS && INET
	select NLS
	select KEYS
@@ -170,16 +176,21 @@ config CIFS_SMB2
	select DNS_RESOLVER

	help
	  This enables experimental support for the SMB2 (Server Message Block
	  version 2) protocol. The SMB2 protocol is the successor to the
	  popular CIFS and SMB network file sharing protocols. SMB2 is the
	  native file sharing mechanism for recent versions of Windows
	  operating systems (since Vista).  SMB2 enablement will eventually
	  allow users better performance, security and features, than would be
	  possible with cifs. Note that smb2 mount options also are simpler
	  (compared to cifs) due to protocol improvements.

	  Unless you are a developer or tester, say N.
	  This enables support for the Server Message Block version 2
	  family of protocols, including SMB3.  SMB3 support is
	  enabled on mount by specifying "vers=3.0" in the mount
	  options. These protocols are the successors to the popular
	  CIFS and SMB network file sharing protocols. SMB3 is the
	  native file sharing mechanism for the more recent
	  versions of Windows (Windows 8 and Windows 2012 and
	  later) and Samba server and many others support SMB3 well.
	  In general SMB3 enables better performance, security
	  and features, than would be possible with CIFS (Note that
	  when mounting to Samba, due to the CIFS POSIX extensions,
	  CIFS mounts can provide slightly better POSIX compatibility
	  than SMB3 mounts do though). Note that SMB2/SMB3 mount
	  options are also slightly simpler (compared to CIFS) due
	  to protocol improvements.

config CIFS_FSCACHE
	  bool "Provide CIFS client caching support"
+0 −5
Original line number Diff line number Diff line
@@ -70,11 +70,6 @@
#define SERVER_NAME_LENGTH 40
#define SERVER_NAME_LEN_WITH_NULL     (SERVER_NAME_LENGTH + 1)

/* used to define string lengths for reversing unicode strings */
/*         (256+1)*2 = 514                                     */
/*           (max path length + 1 for null) * 2 for unicode    */
#define MAX_NAME 514

/* SMB echo "timeout" -- FIXME: tunable? */
#define SMB_ECHO_INTERVAL (60 * HZ)

+2 −19
Original line number Diff line number Diff line
@@ -837,7 +837,6 @@ cifs_demultiplex_thread(void *p)
	struct TCP_Server_Info *server = p;
	unsigned int pdu_length;
	char *buf = NULL;
	struct task_struct *task_to_wake = NULL;
	struct mid_q_entry *mid_entry;

	current->flags |= PF_MEMALLOC;
@@ -928,19 +927,7 @@ cifs_demultiplex_thread(void *p)
	if (server->smallbuf) /* no sense logging a debug message if NULL */
		cifs_small_buf_release(server->smallbuf);

	task_to_wake = xchg(&server->tsk, NULL);
	clean_demultiplex_info(server);

	/* if server->tsk was NULL then wait for a signal before exiting */
	if (!task_to_wake) {
		set_current_state(TASK_INTERRUPTIBLE);
		while (!signal_pending(current)) {
			schedule();
			set_current_state(TASK_INTERRUPTIBLE);
		}
		set_current_state(TASK_RUNNING);
	}

	module_put_and_exit(0);
}

@@ -1600,6 +1587,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
			tmp_end++;
			if (!(tmp_end < end && tmp_end[1] == delim)) {
				/* No it is not. Set the password to NULL */
				kfree(vol->password);
				vol->password = NULL;
				break;
			}
@@ -1637,6 +1625,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
					options = end;
			}

			kfree(vol->password);
			/* Now build new password string */
			temp_len = strlen(value);
			vol->password = kzalloc(temp_len+1, GFP_KERNEL);
@@ -2061,8 +2050,6 @@ cifs_find_tcp_session(struct smb_vol *vol)
static void
cifs_put_tcp_session(struct TCP_Server_Info *server)
{
	struct task_struct *task;

	spin_lock(&cifs_tcp_ses_lock);
	if (--server->srv_count > 0) {
		spin_unlock(&cifs_tcp_ses_lock);
@@ -2086,10 +2073,6 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)
	kfree(server->session_key.response);
	server->session_key.response = NULL;
	server->session_key.len = 0;

	task = xchg(&server->tsk, NULL);
	if (task)
		force_sig(SIGKILL, task);
}

static struct TCP_Server_Info *
+8 −0
Original line number Diff line number Diff line
@@ -497,6 +497,14 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
		goto out;
	}

	if (file->f_flags & O_DIRECT &&
	    CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) {
		if (CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
			file->f_op = &cifs_file_direct_nobrl_ops;
		else
			file->f_op = &cifs_file_direct_ops;
		}

	file_info = cifs_new_fileinfo(&fid, file, tlink, oplock);
	if (file_info == NULL) {
		if (server->ops->close)
+8 −0
Original line number Diff line number Diff line
@@ -467,6 +467,14 @@ int cifs_open(struct inode *inode, struct file *file)
	cifs_dbg(FYI, "inode = 0x%p file flags are 0x%x for %s\n",
		 inode, file->f_flags, full_path);

	if (file->f_flags & O_DIRECT &&
	    cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) {
		if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
			file->f_op = &cifs_file_direct_nobrl_ops;
		else
			file->f_op = &cifs_file_direct_ops;
	}

	if (server->oplocks)
		oplock = REQ_OPLOCK;
	else
Loading