]> 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>
Wed, 13 Oct 2021 00:21:01 +0000 (17:21 -0700)
commitb82168e657d378ff86ea18c4f03b98aac9ee9bb3
treeb31164b7ec09ce534cd081acb17c0f603094789a
parent19e008e7f79ce55182d227be8513b3fa520471d8
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.

MFC after: 1 week
sys/fs/nfsclient/nfs_clstate.c