Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'nfs-for-5.6-3' of git://git.linux-nfs.org/projects/anna/linux-nfs

Pull NFS client bugfixes from Anna Schumaker:
"These are mostly fscontext fixes, but there is also one that fixes
collisions seen in fscache:

- Ensure the fs_context has the correct fs_type when mounting and
submounting

- Fix leaking of ctx->nfs_server.hostname

- Add minor version to fscache key to prevent collisions"

* tag 'nfs-for-5.6-3' of git://git.linux-nfs.org/projects/anna/linux-nfs:
nfs: add minor version to nfs_server_key for fscache
NFS: Fix leak of ctx->nfs_server.hostname
NFS: Don't hard-code the fs_type when submounting
NFS: Ensure the fs_context has the correct fs_type before mounting

+13 -2
+1
fs/nfs/client.c
··· 153 153 if ((clp = kzalloc(sizeof(*clp), GFP_KERNEL)) == NULL) 154 154 goto error_0; 155 155 156 + clp->cl_minorversion = cl_init->minorversion; 156 157 clp->cl_nfs_mod = cl_init->nfs_mod; 157 158 if (!try_module_get(clp->cl_nfs_mod->owner)) 158 159 goto error_dealloc;
+9
fs/nfs/fs_context.c
··· 832 832 if (len > maxnamlen) 833 833 goto out_hostname; 834 834 835 + kfree(ctx->nfs_server.hostname); 836 + 835 837 /* N.B. caller will free nfs_server.hostname in all cases */ 836 838 ctx->nfs_server.hostname = kmemdup_nul(dev_name, len, GFP_KERNEL); 837 839 if (!ctx->nfs_server.hostname) ··· 1241 1239 goto out_version_unavailable; 1242 1240 } 1243 1241 ctx->nfs_mod = nfs_mod; 1242 + } 1243 + 1244 + /* Ensure the filesystem context has the correct fs_type */ 1245 + if (fc->fs_type != ctx->nfs_mod->nfs_fs) { 1246 + module_put(fc->fs_type->owner); 1247 + __module_get(ctx->nfs_mod->nfs_fs->owner); 1248 + fc->fs_type = ctx->nfs_mod->nfs_fs; 1244 1249 } 1245 1250 return 0; 1246 1251
+2
fs/nfs/fscache.c
··· 31 31 struct nfs_server_key { 32 32 struct { 33 33 uint16_t nfsversion; /* NFS protocol version */ 34 + uint32_t minorversion; /* NFSv4 minor version */ 34 35 uint16_t family; /* address family */ 35 36 __be16 port; /* IP port */ 36 37 } hdr; ··· 56 55 57 56 memset(&key, 0, sizeof(key)); 58 57 key.hdr.nfsversion = clp->rpc_ops->version; 58 + key.hdr.minorversion = clp->cl_minorversion; 59 59 key.hdr.family = clp->cl_addr.ss_family; 60 60 61 61 switch (clp->cl_addr.ss_family) {
+1 -1
fs/nfs/namespace.c
··· 153 153 /* Open a new filesystem context, transferring parameters from the 154 154 * parent superblock, including the network namespace. 155 155 */ 156 - fc = fs_context_for_submount(&nfs_fs_type, path->dentry); 156 + fc = fs_context_for_submount(path->mnt->mnt_sb->s_type, path->dentry); 157 157 if (IS_ERR(fc)) 158 158 return ERR_CAST(fc); 159 159
-1
fs/nfs/nfs4client.c
··· 216 216 INIT_LIST_HEAD(&clp->cl_ds_clients); 217 217 rpc_init_wait_queue(&clp->cl_rpcwaitq, "NFS client"); 218 218 clp->cl_state = 1 << NFS4CLNT_LEASE_EXPIRED; 219 - clp->cl_minorversion = cl_init->minorversion; 220 219 clp->cl_mvops = nfs_v4_minor_ops[cl_init->minorversion]; 221 220 clp->cl_mig_gen = 1; 222 221 #if IS_ENABLED(CONFIG_NFS_V4_1)