Commit 75f99f8c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull smb client fixes from Steve French:

 - Multichannel channel allocation fix for Kerberos mounts

 - Two reconnect fixes

 - Fix netfs_writepages crash with smbdirect/RDMA

 - Directory caching fix

 - Three minor cleanup fixes

 - Log error when close cached dirs fails

* tag 'v6.16-rc2-smb3-client-fixes-v2' of git://git.samba.org/sfrench/cifs-2.6:
  smb: minor fix to use SMB2_NTLMV2_SESSKEY_SIZE for auth_key size
  smb: minor fix to use sizeof to initialize flags_string buffer
  smb: Use loff_t for directory position in cached_dirents
  smb: Log an error when close_all_cached_dirs fails
  cifs: Fix prepare_write to negotiate wsize if needed
  smb: client: fix max_sge overflow in smb_extract_folioq_to_rdma()
  smb: client: fix first command failure during re-negotiation
  cifs: Remove duplicate fattr->cf_dtype assignment from wsl_to_fattr() function
  smb: fix secondary channel creation issue with kerberos by populating hostname when adding channels
parents 739a6c93 27e9d5d0
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -509,8 +509,17 @@ void close_all_cached_dirs(struct cifs_sb_info *cifs_sb)
		spin_lock(&cfids->cfid_list_lock);
		list_for_each_entry(cfid, &cfids->entries, entry) {
			tmp_list = kmalloc(sizeof(*tmp_list), GFP_ATOMIC);
			if (tmp_list == NULL)
				break;
			if (tmp_list == NULL) {
				/*
				 * If the malloc() fails, we won't drop all
				 * dentries, and unmounting is likely to trigger
				 * a 'Dentry still in use' error.
				 */
				cifs_tcon_dbg(VFS, "Out of memory while dropping dentries\n");
				spin_unlock(&cfids->cfid_list_lock);
				spin_unlock(&cifs_sb->tlink_tree_lock);
				goto done;
			}
			spin_lock(&cfid->fid_lock);
			tmp_list->dentry = cfid->dentry;
			cfid->dentry = NULL;
@@ -522,6 +531,7 @@ void close_all_cached_dirs(struct cifs_sb_info *cifs_sb)
	}
	spin_unlock(&cifs_sb->tlink_tree_lock);

done:
	list_for_each_entry_safe(tmp_list, q, &entry, entry) {
		list_del(&tmp_list->entry);
		dput(tmp_list->dentry);
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ struct cached_dirents {
			    * open file instance.
			    */
	struct mutex de_mutex;
	int pos;		 /* Expected ctx->pos */
	loff_t pos;		 /* Expected ctx->pos */
	struct list_head entries;
};

+1 −1
Original line number Diff line number Diff line
@@ -1105,7 +1105,7 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
	if ((count < 1) || (count > 11))
		return -EINVAL;

	memset(flags_string, 0, 12);
	memset(flags_string, 0, sizeof(flags_string));

	if (copy_from_user(flags_string, buffer, count))
		return -EFAULT;
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ struct smb_query_info {
struct smb3_key_debug_info {
	__u64	Suid;
	__u16	cipher_type;
	__u8	auth_key[16]; /* SMB2_NTLMV2_SESSKEY_SIZE */
	__u8	auth_key[SMB2_NTLMV2_SESSKEY_SIZE];
	__u8	smb3encryptionkey[SMB3_SIGN_KEY_SIZE];
	__u8	smb3decryptionkey[SMB3_SIGN_KEY_SIZE];
} __packed;
+1 −0
Original line number Diff line number Diff line
@@ -4199,6 +4199,7 @@ cifs_negotiate_protocol(const unsigned int xid, struct cifs_ses *ses,
		return 0;
	}

	server->lstrp = jiffies;
	server->tcpStatus = CifsInNegotiate;
	spin_unlock(&server->srv_lock);

Loading