Skip to content

Commit

Permalink
NFSv4.1 provide mount option to toggle trunking discovery
Browse files Browse the repository at this point in the history
Introduce a new mount option -- trunkdiscovery,notrunkdiscovery -- to
toggle whether or not the client will engage in actively discovery
of trunking locations.

v2 make notrunkdiscovery default

Signed-off-by: Olga Kornievskaia <[email protected]>
Cherry-picked-for: https://bugs.archlinux.org/task/74272
  • Loading branch information
olgakorn1 authored and KenHV committed Apr 23, 2022
1 parent d03c94b commit df3bac2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,8 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
}

if (clp->rpc_ops->discover_trunking != NULL &&
(server->caps & NFS_CAP_FS_LOCATIONS)) {
(server->caps & NFS_CAP_FS_LOCATIONS &&
(server->flags & NFS_MOUNT_TRUNK_DISCOVERY))) {
error = clp->rpc_ops->discover_trunking(server, mntfh);
if (error < 0)
return error;
Expand Down
8 changes: 8 additions & 0 deletions fs/nfs/fs_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ enum nfs_param {
Opt_source,
Opt_tcp,
Opt_timeo,
Opt_trunkdiscovery,
Opt_udp,
Opt_v,
Opt_vers,
Expand Down Expand Up @@ -180,6 +181,7 @@ static const struct fs_parameter_spec nfs_fs_parameters[] = {
fsparam_string("source", Opt_source),
fsparam_flag ("tcp", Opt_tcp),
fsparam_u32 ("timeo", Opt_timeo),
fsparam_flag_no("trunkdiscovery", Opt_trunkdiscovery),
fsparam_flag ("udp", Opt_udp),
fsparam_flag ("v2", Opt_v),
fsparam_flag ("v3", Opt_v),
Expand Down Expand Up @@ -529,6 +531,12 @@ static int nfs_fs_context_parse_param(struct fs_context *fc,
else
ctx->flags &= ~NFS_MOUNT_NOCTO;
break;
case Opt_trunkdiscovery:
if (result.negated)
ctx->flags &= ~NFS_MOUNT_TRUNK_DISCOVERY;
else
ctx->flags |= NFS_MOUNT_TRUNK_DISCOVERY;
break;
case Opt_ac:
if (result.negated)
ctx->flags |= NFS_MOUNT_NOAC;
Expand Down
1 change: 1 addition & 0 deletions include/linux/nfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ struct nfs_server {
#define NFS_MOUNT_SOFTREVAL 0x800000
#define NFS_MOUNT_WRITE_EAGER 0x01000000
#define NFS_MOUNT_WRITE_WAIT 0x02000000
#define NFS_MOUNT_TRUNK_DISCOVERY 0x04000000

unsigned int fattr_valid; /* Valid attributes */
unsigned int caps; /* server capabilities */
Expand Down

0 comments on commit df3bac2

Please sign in to comment.