]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfscl: Fix another deadlock related to the NFSv4 clientID lock
authorRick Macklem <rmacklem@FreeBSD.org>
Wed, 13 Oct 2021 00:21:01 +0000 (17:21 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Tue, 19 Oct 2021 03:46:00 +0000 (20:46 -0700)
commit75d71cf8df8c83b2b2bc3a16ef66a540a2ebac70
tree66dcda1223e08f682f9a96260ab450283db13759
parent16f3a89d08b2deffccace6f605a9e9883cfbd4e2
nfscl: Fix another deadlock related to the NFSv4 clientID lock

Without this patch, it is possible to hang the NFSv4 client,
when a rename/remove is being done on a file where the client
holds a delegation, if pNFS is being used.  For a delegation
to be returned, dirty data blocks must be flushed to the NFSv4
server.  When pNFS is in use, a shared lock on the clientID
must be acquired while doing a write to the DS(s).
However, if rename/remove is doing the delegation return
an exclusive lock will be acquired on the clientID, preventing
the write to the DS(s) from acquiring a shared lock on the clientID.

This patch stops rename/remove from doing a delegation return
if pNFS is enabled.  Since doing delegation return in the same
compound as rename/remove is only an optimization, not doing
so should not cause problems.

This problem was detected during a recent NFSv4 interoperability
testing event held by the IETF working group.

(cherry picked from commit b82168e657d378ff86ea18c4f03b98aac9ee9bb3)
sys/fs/nfsclient/nfs_clstate.c