Commit 2275c6ba authored by Linus Torvalds's avatar Linus Torvalds

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

Pull cifs client fixes from Steve French:
 "Three reconnect fixes, all for stable as well.

  One of these three reconnect fixes does address a problem with
  multichannel reconnect, but this does not include the additional
  fix (still being tested) for dynamically detecting multichannel
  adapter changes which will improve those reconnect scenarios even
  more"

* tag '5.19-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: populate empty hostnames for extra channels
  cifs: return errors during session setup during reconnects
  cifs: fix reconnect on smb3 mount types
parents 3cae0d84 4c14d704
......@@ -1086,7 +1086,7 @@ struct file_system_type cifs_fs_type = {
};
MODULE_ALIAS_FS("cifs");
static struct file_system_type smb3_fs_type = {
struct file_system_type smb3_fs_type = {
.owner = THIS_MODULE,
.name = "smb3",
.init_fs_context = smb3_init_fs_context,
......
......@@ -38,7 +38,7 @@ static inline unsigned long cifs_get_time(struct dentry *dentry)
return (unsigned long) dentry->d_fsdata;
}
extern struct file_system_type cifs_fs_type;
extern struct file_system_type cifs_fs_type, smb3_fs_type;
extern const struct address_space_operations cifs_addr_ops;
extern const struct address_space_operations cifs_addr_ops_smallbuf;
......
......@@ -97,6 +97,10 @@ static int reconn_set_ipaddr_from_hostname(struct TCP_Server_Info *server)
if (!server->hostname)
return -EINVAL;
/* if server hostname isn't populated, there's nothing to do here */
if (server->hostname[0] == '\0')
return 0;
len = strlen(server->hostname) + 3;
unc = kmalloc(len, GFP_KERNEL);
......
......@@ -1211,11 +1211,13 @@ static struct super_block *__cifs_get_super(void (*f)(struct super_block *, void
.data = data,
.sb = NULL,
};
struct file_system_type **fs_type = (struct file_system_type *[]) {
&cifs_fs_type, &smb3_fs_type, NULL,
};
iterate_supers_type(&cifs_fs_type, f, &sd);
if (!sd.sb)
return ERR_PTR(-EINVAL);
for (; *fs_type; fs_type++) {
iterate_supers_type(*fs_type, f, &sd);
if (sd.sb) {
/*
* Grab an active reference in order to prevent automounts (DFS links)
* of expiring and then freeing up our cifs superblock pointer while
......@@ -1223,6 +1225,9 @@ static struct super_block *__cifs_get_super(void (*f)(struct super_block *, void
*/
cifs_sb_active(sd.sb);
return sd.sb;
}
}
return ERR_PTR(-EINVAL);
}
static void __cifs_put_super(struct super_block *sb)
......
......@@ -301,7 +301,10 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
/* Auth */
ctx.domainauto = ses->domainAuto;
ctx.domainname = ses->domainName;
ctx.server_hostname = ses->server->hostname;
/* no hostname for extra channels */
ctx.server_hostname = "";
ctx.username = ses->user_name;
ctx.password = ses->password;
ctx.sectype = ses->sectype;
......
......@@ -288,6 +288,9 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
mutex_unlock(&ses->session_mutex);
rc = -EHOSTDOWN;
goto failed;
} else if (rc) {
mutex_unlock(&ses->session_mutex);
goto out;
}
} else {
mutex_unlock(&ses->session_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment