浏览代码

NFS: Ensure that the nfs_client 'net' field is always set

Currently, the nfs_parsed_mount_data->net field is initialised in
the nfs_parse_mount_options() function, which means that it only
gets set if we're using text based mounts. The legacy binary
mount interface is therefore broken.

Fix is to initialise the ->net field in nfs_alloc_parsed_mount_data.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
Trond Myklebust 13 年之前
父节点
当前提交
9937347a1e
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      fs/nfs/super.c

+ 1 - 2
fs/nfs/super.c

@@ -911,6 +911,7 @@ static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(unsigned int ve
 		data->auth_flavor_len	= 1;
 		data->auth_flavor_len	= 1;
 		data->version		= version;
 		data->version		= version;
 		data->minorversion	= 0;
 		data->minorversion	= 0;
+		data->net		= current->nsproxy->net_ns;
 		security_init_mnt_opts(&data->lsm_opts);
 		security_init_mnt_opts(&data->lsm_opts);
 	}
 	}
 	return data;
 	return data;
@@ -1110,8 +1111,6 @@ static int nfs_parse_mount_options(char *raw,
 
 
 	free_secdata(secdata);
 	free_secdata(secdata);
 
 
-	mnt->net = current->nsproxy->net_ns;
-
 	while ((p = strsep(&raw, ",")) != NULL) {
 	while ((p = strsep(&raw, ",")) != NULL) {
 		substring_t args[MAX_OPT_ARGS];
 		substring_t args[MAX_OPT_ARGS];
 		unsigned long option;
 		unsigned long option;