diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 4e983961346e..340ede8f608f 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -72,6 +72,7 @@ struct nfs_mount_request { u32 version; unsigned short protocol; struct nfs_fh *fh; + int noresvport; }; extern int nfs_mount(struct nfs_mount_request *info); diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index 7e37113d37e3..ca905a5bb1ba 100644 --- a/fs/nfs/mount_clnt.c +++ b/fs/nfs/mount_clnt.c @@ -50,7 +50,6 @@ int nfs_mount(struct nfs_mount_request *info) .program = &mnt_program, .version = info->version, .authflavor = RPC_AUTH_UNIX, - .flags = 0, }; struct rpc_clnt *mnt_clnt; int status; @@ -59,6 +58,9 @@ int nfs_mount(struct nfs_mount_request *info) (info->hostname ? info->hostname : "server"), info->dirpath); + if (info->noresvport) + args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; + mnt_clnt = rpc_create(&args); if (IS_ERR(mnt_clnt)) goto out_clnt_err; diff --git a/fs/nfs/super.c b/fs/nfs/super.c index e05a77be3068..d8e062fe76b1 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1345,6 +1345,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, .dirpath = args->nfs_server.export_path, .protocol = args->mount_server.protocol, .fh = root_fh, + .noresvport = args->flags & NFS_MOUNT_NORESVPORT, }; int status;