Skip to content

Commit

Permalink
NFSv4.1 restrict GETATTR fs_location query to the main transport
Browse files Browse the repository at this point in the history
In the presence of trunking transports, it's helpful to make sure
that during the migration event, the GETATTR for fs_location attribute
happens on the main transport.

Signed-off-by: Olga Kornievskaia <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
olgakorn1 authored and Trond Myklebust committed Mar 13, 2022
1 parent cb8fac6 commit b4be2c5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8008,15 +8008,26 @@ static int _nfs41_proc_get_locations(struct nfs_server *server,
.rpc_resp = &res,
.rpc_cred = cred,
};
struct nfs4_call_sync_data data = {
.seq_server = server,
.seq_args = &args.seq_args,
.seq_res = &res.seq_res,
};
struct rpc_task_setup task_setup_data = {
.rpc_client = clnt,
.rpc_message = &msg,
.callback_ops = server->nfs_client->cl_mvops->call_sync_ops,
.callback_data = &data,
.flags = RPC_TASK_NO_ROUND_ROBIN,
};
int status;

nfs_fattr_init(&locations->fattr);
locations->server = server;
locations->nlocations = 0;

nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 1);
status = nfs4_call_sync_sequence(clnt, server, &msg,
&args.seq_args, &res.seq_res);
status = nfs4_call_sync_custom(&task_setup_data);
if (status == NFS4_OK &&
res.seq_res.sr_status_flags & SEQ4_STATUS_LEASE_MOVED)
status = -NFS4ERR_LEASE_MOVED;
Expand Down

0 comments on commit b4be2c5

Please sign in to comment.