svn commit: r267760 - head/sys/kern

Konstantin Belousov kostikbel at gmail.com
Mon Jun 23 06:40:54 UTC 2014


On Mon, Jun 23, 2014 at 01:28:18AM +0000, Mateusz Guzik wrote:
> +	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
>  	FILEDESC_XLOCK(fdp);
This  is at least weird.  Not incorrect, but the code now looks strange.
The fd_refcnt == 1 assert just states the circumstances of the code which
currently calls the functions.  Would the functions become incorrect or
destructive if there are other references to the filedescriptor table ?

In case you argument is that refcnt == 1 must hold to prevent the parallel
modifications of the descriptor table, which would invalidate the checks
and actions of the functions, then XLOCK is not needed (similar to your
earlier commit).

Note that kern_execve() is executed with the process single-threaded,
which, together with statement fd_refcnt == 1 must prevent the parallel
modifications.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20140623/0945f734/attachment.sig>


More information about the svn-src-all mailing list