NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO
authorOlga Kornievskaia <kolga@netapp.com>
Fri, 13 Oct 2023 15:04:10 +0000 (11:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:19:49 +0000 (17:19 +0000)
commitdfdd2663247e330210e58c32dd2fced421cc8bcf
tree53348c1c7116d1c3ef93e9ef1336c069420c92a5
parent4069da49f8ae9837ca0f47aff4b6a0d89f4d22e1
NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO

[ Upstream commit 5cc7688bae7f0757c39c1d3dfdd827b724061067 ]

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: fb91fb0ee7b2 ("NFS: Move call to nfs4_state_protect_write() to nfs4_write_setup()")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4proc.c