cifs.ko defines two file system types: cifs & smb3, and __cifs_get_super() was not including smb3 file system type when looking up superblocks, therefore failing to reconnect tcons in cifs_tree_connect(). Fix this by calling iterate_supers_type() on both file system types.
Unified · Split
| @@ -1086,7 +1086,7 @@ struct file_system_type cifs_fs_type = { · 1085 unmodified lines | |||
| 1086 | }; | 1086 | }; |
| 1087 | MODULE_ALIAS_FS("cifs"); | 1087 | MODULE_ALIAS_FS("cifs"); |
| 1088 | 1088 | ||
| 1089 | static struct file_system_type smb3_fs_type = { | 1089 | struct file_system_type smb3_fs_type = { |
| 1090 | .owner = THIS_MODULE, | 1090 | .owner = THIS_MODULE, |
| 1091 | .name = "smb3", | 1091 | .name = "smb3", |
| 1092 | .init_fs_context = smb3_init_fs_context, | 1092 | .init_fs_context = smb3_init_fs_context, |
| @@ -38,7 +38,7 @@ static inline unsigned long cifs_get_time(struct dentry *dentry) · 37 unmodified lines | |||
| 38 | return (unsigned long) dentry->d_fsdata; | 38 | return (unsigned long) dentry->d_fsdata; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | extern struct file_system_type cifs_fs_type; | 41 | extern struct file_system_type cifs_fs_type, smb3_fs_type; |
| 42 | extern const struct address_space_operations cifs_addr_ops; | 42 | extern const struct address_space_operations cifs_addr_ops; |
| 43 | extern const struct address_space_operations cifs_addr_ops_smallbuf; | 43 | extern const struct address_space_operations cifs_addr_ops_smallbuf; |
| 44 | 44 | ||
| @@ -1211,18 +1211,23 @@ static struct super_block *__cifs_get_super(void (*f)(struct super_block *, void · 1210 unmodified lines | |||
| 1211 | .data = data, | 1211 | .data = data, |
| 1212 | .sb = NULL, | 1212 | .sb = NULL, |
| 1213 | }; | 1213 | }; |
| 1214 | struct file_system_type **fs_type = (struct file_system_type *[]) { | ||
| 1215 | &cifs_fs_type, &smb3_fs_type, NULL, | ||
| 1216 | }; | ||
| 1214 | 1217 | ||
| 1215 | iterate_supers_type(&cifs_fs_type, f, &sd); | 1218 | for (; *fs_type; fs_type++) { |
| 1216 | 1219 | iterate_supers_type(*fs_type, f, &sd); | |
| 1217 | if (!sd.sb) | 1220 | if (sd.sb) { |
| 1218 | return ERR_PTR(-EINVAL); | 1221 | /* |
| 1219 | /* | 1222 | * Grab an active reference in order to prevent automounts (DFS links) |
| 1220 | * Grab an active reference in order to prevent automounts (DFS links) | 1223 | * of expiring and then freeing up our cifs superblock pointer while |
| 1221 | * of expiring and then freeing up our cifs superblock pointer while | 1224 | * we're doing failover. |
| 1222 | * we're doing failover. | 1225 | */ |
| 1223 | */ | 1226 | cifs_sb_active(sd.sb); |
| 1224 | cifs_sb_active(sd.sb); | 1227 | return sd.sb; |
| 1225 | return sd.sb; | 1228 | } |
| 1229 | } | ||
| 1230 | return ERR_PTR(-EINVAL); | ||
| 1226 | } | 1231 | } |
| 1227 | 1232 | ||
| 1228 | static void __cifs_put_super(struct super_block *sb) | 1233 | static void __cifs_put_super(struct super_block *sb) |