1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Add annotations to mtx_lock(&Giant) in kern_select() and poll() that

we always grab Giant, even if we're actually only polling objects that
don't require giant.  Once socket locking is merged, there will be
strong motivation to fix this.
This commit is contained in:
Robert Watson 2004-03-13 05:58:57 +00:00
parent 4a1be2f9f9
commit 5d8dd01da2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126909

View File

@ -746,6 +746,10 @@ kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou,
if (nd < 0)
return (EINVAL);
fdp = td->td_proc->p_fd;
/*
* XXX: kern_select() currently requires that we acquire Giant
* even if none of the file descriptors we poll requires Giant.
*/
mtx_lock(&Giant);
FILEDESC_LOCK(fdp);
@ -954,6 +958,10 @@ poll(td, uap)
nfds = uap->nfds;
/*
* XXX: poll() currently requires that we acquire Giant even if
* none of the file descriptors we poll requires Giant.
*/
mtx_lock(&Giant);
/*
* This is kinda bogus. We have fd limits, but that is not