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

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

Pull cifs fixes from Steve French:
 "Six cifs/smb3 fixes, three of them for stable, including some
  important mulitchannel crediting fixes, and a fix for statfs error
  handling"

* tag '5.12-rc2-smb3' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: do not send close in compound create+close requests
  cifs: return proper error code in statfs(2)
  cifs: change noisy error message to FYI
  cifs: print MIDs in decimal notation
  cifs: ask for more credit on async read/write code paths
  cifs: fix credit accounting for extra channel
parents 05a59d79 04ad69c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
						from_kuid(&init_user_ns, cfile->uid),
						cfile->dentry);
#ifdef CONFIG_CIFS_DEBUG2
					seq_printf(m, " 0x%llx\n", cfile->fid.mid);
					seq_printf(m, " %llu\n", cfile->fid.mid);
#else
					seq_printf(m, "\n");
#endif /* CIFS_DEBUG2 */
+1 −1
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
		rc = server->ops->queryfs(xid, tcon, cifs_sb, buf);

	free_xid(xid);
	return 0;
	return rc;
}

static long cifs_fallocate(struct file *file, int mode, loff_t off, loff_t len)
+10 −9
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ struct smb_version_operations {
	/* verify the message */
	int (*check_message)(char *, unsigned int, struct TCP_Server_Info *);
	bool (*is_oplock_break)(char *, struct TCP_Server_Info *);
	int (*handle_cancelled_mid)(char *, struct TCP_Server_Info *);
	int (*handle_cancelled_mid)(struct mid_q_entry *, struct TCP_Server_Info *);
	void (*downgrade_oplock)(struct TCP_Server_Info *server,
				 struct cifsInodeInfo *cinode, __u32 oplock,
				 unsigned int epoch, bool *purge_cache);
@@ -1708,9 +1708,10 @@ static inline bool is_retryable_error(int error)
#define   CIFS_ECHO_OP            0x080  /* echo request */
#define   CIFS_OBREAK_OP          0x0100 /* oplock break request */
#define   CIFS_NEG_OP             0x0200 /* negotiate request */
#define   CIFS_CP_CREATE_CLOSE_OP 0x0400 /* compound create+close request */
/* Lower bitmask values are reserved by others below. */
#define   CIFS_SESS_OP            0x2000 /* session setup request */
#define   CIFS_OP_MASK     0x2380    /* mask request type */
#define   CIFS_OP_MASK            0x2780 /* mask request type */

#define   CIFS_HAS_CREDITS        0x0400 /* already has credits */
#define   CIFS_TRANSFORM_REQ      0x0800 /* transform request before sending */
+7 −7
Original line number Diff line number Diff line
@@ -741,7 +741,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
		spin_lock(&GlobalMid_Lock);
		list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
			mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
			cifs_dbg(FYI, "Clearing mid 0x%llx\n", mid_entry->mid);
			cifs_dbg(FYI, "Clearing mid %llu\n", mid_entry->mid);
			kref_get(&mid_entry->refcount);
			mid_entry->mid_state = MID_SHUTDOWN;
			list_move(&mid_entry->qhead, &dispose_list);
@@ -752,7 +752,7 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
		/* now walk dispose list and issue callbacks */
		list_for_each_safe(tmp, tmp2, &dispose_list) {
			mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
			cifs_dbg(FYI, "Callback mid 0x%llx\n", mid_entry->mid);
			cifs_dbg(FYI, "Callback mid %llu\n", mid_entry->mid);
			list_del_init(&mid_entry->qhead);
			mid_entry->callback(mid_entry);
			cifs_mid_q_entry_release(mid_entry);
@@ -1429,6 +1429,11 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx)
	tcp_ses->min_offload = ctx->min_offload;
	tcp_ses->tcpStatus = CifsNeedNegotiate;

	if ((ctx->max_credits < 20) || (ctx->max_credits > 60000))
		tcp_ses->max_credits = SMB2_MAX_CREDITS_AVAILABLE;
	else
		tcp_ses->max_credits = ctx->max_credits;

	tcp_ses->nr_targets = 1;
	tcp_ses->ignore_signature = ctx->ignore_signature;
	/* thread spawned, put it on the list */
@@ -2832,11 +2837,6 @@ static int mount_get_conns(struct smb3_fs_context *ctx, struct cifs_sb_info *cif

	*nserver = server;

	if ((ctx->max_credits < 20) || (ctx->max_credits > 60000))
		server->max_credits = SMB2_MAX_CREDITS_AVAILABLE;
	else
		server->max_credits = ctx->max_credits;

	/* get a reference to a SMB session */
	ses = cifs_get_smb_ses(server, ctx);
	if (IS_ERR(ses)) {
+1 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
	ctx.noautotune = ses->server->noautotune;
	ctx.sockopt_tcp_nodelay = ses->server->tcp_nodelay;
	ctx.echo_interval = ses->server->echo_interval / HZ;
	ctx.max_credits = ses->server->max_credits;

	/*
	 * This will be used for encoding/decoding user/domain/pw
Loading