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 = { ...@@ -1086,7 +1086,7 @@ struct file_system_type cifs_fs_type = {
}; };
MODULE_ALIAS_FS("cifs"); MODULE_ALIAS_FS("cifs");
static struct file_system_type smb3_fs_type = { struct file_system_type smb3_fs_type = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "smb3", .name = "smb3",
.init_fs_context = smb3_init_fs_context, .init_fs_context = smb3_init_fs_context,
......
...@@ -38,7 +38,7 @@ static inline unsigned long cifs_get_time(struct dentry *dentry) ...@@ -38,7 +38,7 @@ static inline unsigned long cifs_get_time(struct dentry *dentry)
return (unsigned long) dentry->d_fsdata; 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;
extern const struct address_space_operations cifs_addr_ops_smallbuf; 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) ...@@ -97,6 +97,10 @@ static int reconn_set_ipaddr_from_hostname(struct TCP_Server_Info *server)
if (!server->hostname) if (!server->hostname)
return -EINVAL; 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; len = strlen(server->hostname) + 3;
unc = kmalloc(len, GFP_KERNEL); unc = kmalloc(len, GFP_KERNEL);
......
...@@ -1211,18 +1211,23 @@ static struct super_block *__cifs_get_super(void (*f)(struct super_block *, void ...@@ -1211,18 +1211,23 @@ static struct super_block *__cifs_get_super(void (*f)(struct super_block *, void
.data = data, .data = data,
.sb = NULL, .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); for (; *fs_type; fs_type++) {
iterate_supers_type(*fs_type, f, &sd);
if (!sd.sb) if (sd.sb) {
return ERR_PTR(-EINVAL); /*
/* * Grab an active reference in order to prevent automounts (DFS links)
* Grab an active reference in order to prevent automounts (DFS links) * of expiring and then freeing up our cifs superblock pointer while
* of expiring and then freeing up our cifs superblock pointer while * we're doing failover.
* we're doing failover. */
*/ cifs_sb_active(sd.sb);
cifs_sb_active(sd.sb); return sd.sb;
return sd.sb; }
}
return ERR_PTR(-EINVAL);
} }
static void __cifs_put_super(struct super_block *sb) 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, ...@@ -301,7 +301,10 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
/* Auth */ /* Auth */
ctx.domainauto = ses->domainAuto; ctx.domainauto = ses->domainAuto;
ctx.domainname = ses->domainName; ctx.domainname = ses->domainName;
ctx.server_hostname = ses->server->hostname;
/* no hostname for extra channels */
ctx.server_hostname = "";
ctx.username = ses->user_name; ctx.username = ses->user_name;
ctx.password = ses->password; ctx.password = ses->password;
ctx.sectype = ses->sectype; ctx.sectype = ses->sectype;
......
...@@ -288,6 +288,9 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon, ...@@ -288,6 +288,9 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
mutex_unlock(&ses->session_mutex); mutex_unlock(&ses->session_mutex);
rc = -EHOSTDOWN; rc = -EHOSTDOWN;
goto failed; goto failed;
} else if (rc) {
mutex_unlock(&ses->session_mutex);
goto out;
} }
} else { } else {
mutex_unlock(&ses->session_mutex); 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