Skip to content

Commit 5cc7688

Browse files
olgakorn1Trond Myklebust
authored andcommitted
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
If the client is doing pnfs IO and Kerberos is configured and EXCHANGEID successfully negotiated SP4_MACH_CRED and WRITE/COMMIT are on the list of state protected operations, then we need to make sure to choose the DS's rpc_client structure instead of the MDS's one. Fixes: fb91fb0 ("NFS: Move call to nfs4_state_protect_write() to nfs4_write_setup()") Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 4f3ed83 commit 5cc7688

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/nfs/nfs4proc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5647,7 +5647,7 @@ static void nfs4_proc_write_setup(struct nfs_pgio_header *hdr,
56475647

56485648
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE];
56495649
nfs4_init_sequence(&hdr->args.seq_args, &hdr->res.seq_res, 0, 0);
5650-
nfs4_state_protect_write(server->nfs_client, clnt, msg, hdr);
5650+
nfs4_state_protect_write(hdr->ds_clp ? hdr->ds_clp : server->nfs_client, clnt, msg, hdr);
56515651
}
56525652

56535653
static void nfs4_proc_commit_rpc_prepare(struct rpc_task *task, struct nfs_commit_data *data)
@@ -5688,7 +5688,8 @@ static void nfs4_proc_commit_setup(struct nfs_commit_data *data, struct rpc_mess
56885688
data->res.server = server;
56895689
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
56905690
nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1, 0);
5691-
nfs4_state_protect(server->nfs_client, NFS_SP4_MACH_CRED_COMMIT, clnt, msg);
5691+
nfs4_state_protect(data->ds_clp ? data->ds_clp : server->nfs_client,
5692+
NFS_SP4_MACH_CRED_COMMIT, clnt, msg);
56925693
}
56935694

56945695
static int _nfs4_proc_commit(struct file *dst, struct nfs_commitargs *args,

0 commit comments

Comments
 (0)