]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the NFSv4 client to safely find processes.
authorrmacklem <rmacklem@FreeBSD.org>
Mon, 15 Apr 2019 01:27:15 +0000 (01:27 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Mon, 15 Apr 2019 01:27:15 +0000 (01:27 +0000)
commiteddbdfff07dfd1770818318fb7a475b7b6cab20d
treeb81fff8120c79322fded7cfeaf5e624ca566e5aa
parentb652ed5f59bd723663f5cdaffe5dbbf7910cee59
Fix the NFSv4 client to safely find processes.

r340744 broke the NFSv4 client, because it replaced pfind_locked() with a
call to pfind(), since pfind() acquires the sx lock for the pid hash and
the NFSv4 already holds a mutex when it does the call.
The patch fixes the problem by recreating a pfind_any_locked() and adding the
functions pidhash_slockall() and pidhash_sunlockall to acquire/release
all of the pid hash locks.
These functions are then used by the NFSv4 client instead of acquiring
the allproc_lock and calling pfind().

Reviewed by: kib, mjg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19887
sys/fs/nfs/nfsport.h
sys/fs/nfsclient/nfs_clport.c
sys/fs/nfsclient/nfs_clstate.c
sys/kern/kern_proc.c
sys/sys/proc.h