Commit 38e04b3e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull cifs client fixes from Steve French:
 "Seven cifs/smb3 client fixes, all also for stable:

   - four DFS fixes

   - multichannel reconnect fix

   - fix smb1 stats for cancel command

   - fix for set file size error path"

* tag '6.3-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: use DFS root session instead of tcon ses
  cifs: return DFS root session id in DebugData
  cifs: fix use-after-free bug in refresh_cache_worker()
  cifs: set DFS root session in cifs_get_smb_ses()
  cifs: generate signkey for the channel that's reconnecting
  cifs: Fix smb2_set_path_size()
  cifs: Move the in_send statistic to __smb_send_rqst()
parents 0ddc84d2 6284e46b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -420,6 +420,11 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
				   from_kuid(&init_user_ns, ses->linux_uid),
				   from_kuid(&init_user_ns, ses->cred_uid));

			if (ses->dfs_root_ses) {
				seq_printf(m, "\n\tDFS root session id: 0x%llx",
					   ses->dfs_root_ses->Suid);
			}

			spin_lock(&ses->chan_lock);
			if (CIFS_CHAN_NEEDS_RECONNECT(ses, 0))
				seq_puts(m, "\tPrimary channel: DISCONNECTED ");
+1 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct path *path)
	tmp.source = full_path;
	tmp.leaf_fullpath = NULL;
	tmp.UNC = tmp.prepath = NULL;
	tmp.dfs_root_ses = NULL;

	rc = smb3_fs_context_dup(ctx, &tmp);
	if (rc) {
+0 −2
Original line number Diff line number Diff line
@@ -61,8 +61,6 @@ struct cifs_sb_info {
	/* only used when CIFS_MOUNT_USE_PREFIX_PATH is set */
	char *prepath;

	/* randomly generated 128-bit number for indexing dfs mount groups in referral cache */
	uuid_t dfs_mount_id;
	/*
	 * Indicate whether serverino option was turned off later
	 * (cifs_autodisable_serverino) in order to match new mounts.
+2 −2
Original line number Diff line number Diff line
@@ -1233,6 +1233,7 @@ struct cifs_tcon {
	/* BB add field for back pointer to sb struct(s)? */
#ifdef CONFIG_CIFS_DFS_UPCALL
	struct list_head ulist; /* cache update list */
	struct list_head dfs_ses_list;
#endif
	struct delayed_work	query_interfaces; /* query interfaces workqueue job */
};
@@ -1749,9 +1750,8 @@ struct cifs_mount_ctx {
	struct TCP_Server_Info *server;
	struct cifs_ses *ses;
	struct cifs_tcon *tcon;
	struct cifs_ses *root_ses;
	uuid_t mount_id;
	char *origin_fullpath, *leaf_fullpath;
	struct list_head dfs_ses_list;
};

static inline void free_dfs_info_param(struct dfs_info3_param *param)
+4 −6
Original line number Diff line number Diff line
@@ -2229,6 +2229,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
	 * need to lock before changing something in the session.
	 */
	spin_lock(&cifs_tcp_ses_lock);
	ses->dfs_root_ses = ctx->dfs_root_ses;
	list_add(&ses->smb_ses_list, &server->smb_ses_list);
	spin_unlock(&cifs_tcp_ses_lock);

@@ -3407,7 +3408,8 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
	bool isdfs;
	int rc;

	uuid_gen(&mnt_ctx.mount_id);
	INIT_LIST_HEAD(&mnt_ctx.dfs_ses_list);

	rc = dfs_mount_share(&mnt_ctx, &isdfs);
	if (rc)
		goto error;
@@ -3427,7 +3429,6 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
	kfree(cifs_sb->prepath);
	cifs_sb->prepath = ctx->prepath;
	ctx->prepath = NULL;
	uuid_copy(&cifs_sb->dfs_mount_id, &mnt_ctx.mount_id);

out:
	cifs_try_adding_channels(cifs_sb, mnt_ctx.ses);
@@ -3439,7 +3440,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
	return rc;

error:
	dfs_cache_put_refsrv_sessions(&mnt_ctx.mount_id);
	dfs_put_root_smb_sessions(&mnt_ctx.dfs_ses_list);
	kfree(mnt_ctx.origin_fullpath);
	kfree(mnt_ctx.leaf_fullpath);
	cifs_mount_put_conns(&mnt_ctx);
@@ -3637,9 +3638,6 @@ cifs_umount(struct cifs_sb_info *cifs_sb)
	spin_unlock(&cifs_sb->tlink_tree_lock);

	kfree(cifs_sb->prepath);
#ifdef CONFIG_CIFS_DFS_UPCALL
	dfs_cache_put_refsrv_sessions(&cifs_sb->dfs_mount_id);
#endif
	call_rcu(&cifs_sb->rcu, delayed_free);
}

Loading