Skip to content

Commit 51d674a

Browse files
olgakorn1amschuma-ntap
authored andcommitted
NFSv4.1: use EXCHGID4_FLAG_USE_PNFS_DS for DS server
After receiving the location(s) of the DS server(s) in the GETDEVINCEINFO, create the request for the clientid to such server and indicate that the client is connecting to a DS. Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 537935f commit 51d674a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

fs/nfs/nfs4client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)
232232
__set_bit(NFS_CS_DISCRTRY, &clp->cl_flags);
233233
__set_bit(NFS_CS_NO_RETRANS_TIMEOUT, &clp->cl_flags);
234234

235+
if (test_bit(NFS_CS_DS, &cl_init->init_flags))
236+
__set_bit(NFS_CS_DS, &clp->cl_flags);
235237
/*
236238
* Set up the connection to the server before we add add to the
237239
* global list.
@@ -1007,6 +1009,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
10071009
if (mds_srv->flags & NFS_MOUNT_NORESVPORT)
10081010
__set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
10091011

1012+
__set_bit(NFS_CS_DS, &cl_init.init_flags);
10101013
/*
10111014
* Set an authflavor equual to the MDS value. Use the MDS nfs_client
10121015
* cl_ipaddr so as to use the same EXCHANGE_ID co_ownerid as the MDS

fs/nfs/nfs4proc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8787,6 +8787,8 @@ nfs4_run_exchange_id(struct nfs_client *clp, const struct cred *cred,
87878787
#ifdef CONFIG_NFS_V4_1_MIGRATION
87888788
calldata->args.flags |= EXCHGID4_FLAG_SUPP_MOVED_MIGR;
87898789
#endif
8790+
if (test_bit(NFS_CS_DS, &clp->cl_flags))
8791+
calldata->args.flags |= EXCHGID4_FLAG_USE_PNFS_DS;
87908792
msg.rpc_argp = &calldata->args;
87918793
msg.rpc_resp = &calldata->res;
87928794
task_setup_data.callback_data = calldata;
@@ -8864,6 +8866,8 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, const struct cred *cre
88648866
/* Save the EXCHANGE_ID verifier session trunk tests */
88658867
memcpy(clp->cl_confirm.data, argp->verifier.data,
88668868
sizeof(clp->cl_confirm.data));
8869+
if (resp->flags & EXCHGID4_FLAG_USE_PNFS_DS)
8870+
set_bit(NFS_CS_DS, &clp->cl_flags);
88678871
out:
88688872
trace_nfs4_exchange_id(clp, status);
88698873
rpc_put_task(task);

0 commit comments

Comments
 (0)