diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2024-10-31 16:40:03 +0300 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-11-19 04:23:09 +0300 |
commit | 62a8642ba00aa8ceb0a02ade942f5ec52e877c95 (patch) | |
tree | 5b6818b91faa3cb685d3337cd2fec6c3827a29a7 /rust/helpers/helpers.c | |
parent | a4452e661bc8ee56b2a893df6f523607c63f6de8 (diff) | |
download | linux-62a8642ba00aa8ceb0a02ade942f5ec52e877c95.tar.xz |
NFSD: Fix nfsd4_shutdown_copy()
nfsd4_shutdown_copy() is just this:
while ((copy = nfsd4_get_copy(clp)) != NULL)
nfsd4_stop_copy(copy);
nfsd4_get_copy() bumps @copy's reference count, preventing
nfsd4_stop_copy() from releasing @copy.
A while loop like this usually works by removing the first element
of the list, but neither nfsd4_get_copy() nor nfsd4_stop_copy()
alters the async_copies list.
Best I can tell, then, is that nfsd4_shutdown_copy() continues to
loop until other threads manage to remove all the items from this
list. The spinning loop blocks shutdown until these items are gone.
Possibly the reason we haven't seen this issue in the field is
because client_has_state() prevents __destroy_client() from calling
nfsd4_shutdown_copy() if there are any items on this list. In a
subsequent patch I plan to remove that restriction.
Fixes: e0639dc5805a ("NFSD introduce async copy feature")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions