Commit 0c947b89 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull cifs updates from Steve French:

 - multichannel patches mostly related to improving reconnect behavior

 - minor cleanup patches

* tag '5.17-rc-part1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: fix FILE_BOTH_DIRECTORY_INFO definition
  cifs: move superblock magic defitions to magic.h
  cifs: Fix smb311_update_preauth_hash() kernel-doc comment
  cifs: avoid race during socket reconnect between send and recv
  cifs: maintain a state machine for tcp/smb/tcon sessions
  cifs: fix hang on cifs_get_next_mid()
  cifs: take cifs_tcp_ses_lock for status checks
  cifs: reconnect only the connection and not smb session where possible
  cifs: add WARN_ON for when chan_count goes below minimum
  cifs: adjust DebugData to use chans_need_reconnect for conn status
  cifs: use the chans_need_reconnect bitmap for reconnect status
  cifs: track individual channel status using chans_need_reconnect
  cifs: remove redundant assignment to pointer p
parents a6097180 9bbf8662
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -416,11 +416,17 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
				   from_kuid(&init_user_ns, ses->cred_uid));

			spin_lock(&ses->chan_lock);
			if (CIFS_CHAN_NEEDS_RECONNECT(ses, 0))
				seq_puts(m, "\tPrimary channel: DISCONNECTED ");

			if (ses->chan_count > 1) {
				seq_printf(m, "\n\n\tExtra Channels: %zu ",
					   ses->chan_count-1);
				for (j = 1; j < ses->chan_count; j++)
				for (j = 1; j < ses->chan_count; j++) {
					cifs_dump_channel(m, j, &ses->chans[j]);
					if (CIFS_CHAN_NEEDS_RECONNECT(ses, j))
						seq_puts(m, "\tDISCONNECTED ");
				}
			}
			spin_unlock(&ses->chan_lock);

+2 −2
Original line number Diff line number Diff line
@@ -84,9 +84,9 @@ struct key_type cifs_spnego_key_type = {

/* get a key struct with a SPNEGO security blob, suitable for session setup */
struct key *
cifs_get_spnego_key(struct cifs_ses *sesInfo)
cifs_get_spnego_key(struct cifs_ses *sesInfo,
		    struct TCP_Server_Info *server)
{
	struct TCP_Server_Info *server = cifs_ses_server(sesInfo);
	struct sockaddr_in *sa = (struct sockaddr_in *) &server->dstaddr;
	struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &server->dstaddr;
	char *description, *dp;
+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ struct cifs_spnego_msg {

#ifdef __KERNEL__
extern struct key_type cifs_spnego_key_type;
extern struct key *cifs_get_spnego_key(struct cifs_ses *sesInfo);
extern struct key *cifs_get_spnego_key(struct cifs_ses *sesInfo,
				       struct TCP_Server_Info *server);
#endif /* KERNEL */

#endif /* _CIFS_SPNEGO_H */
+2 −2
Original line number Diff line number Diff line
@@ -498,10 +498,10 @@ static int cifs_swn_reconnect(struct cifs_tcon *tcon, struct sockaddr_storage *a
		goto unlock;
	}

	spin_lock(&GlobalMid_Lock);
	spin_lock(&cifs_tcp_ses_lock);
	if (tcon->ses->server->tcpStatus != CifsExiting)
		tcon->ses->server->tcpStatus = CifsNeedReconnect;
	spin_unlock(&GlobalMid_Lock);
	spin_unlock(&cifs_tcp_ses_lock);

unlock:
	mutex_unlock(&tcon->ses->server->srv_mutex);
+5 −1
Original line number Diff line number Diff line
@@ -141,9 +141,13 @@ int cifs_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server,
	if ((cifs_pdu == NULL) || (server == NULL))
		return -EINVAL;

	spin_lock(&cifs_tcp_ses_lock);
	if (!(cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) ||
	    server->tcpStatus == CifsNeedNegotiate)
	    server->tcpStatus == CifsNeedNegotiate) {
		spin_unlock(&cifs_tcp_ses_lock);
		return rc;
	}
	spin_unlock(&cifs_tcp_ses_lock);

	if (!server->session_estab) {
		memcpy(cifs_pdu->Signature.SecuritySignature, "BSRSPYL", 8);
Loading