Date: Mon, 23 Jun 2014 09:40:44 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Mateusz Guzik <mjg@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r267760 - head/sys/kern Message-ID: <20140623064044.GD93733@kib.kiev.ua> In-Reply-To: <201406230128.s5N1SIYK097224@svn.freebsd.org> References: <201406230128.s5N1SIYK097224@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--jCrbxBqMcLqd4mOl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --jCrbxBqMcLqd4mOl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTp8vsAAoJEJDCuSvBvK1B6FoP/jSelVk3Pa1UD1KQClW2/E5w 96CuK3lI3e3/IynWobqiB/dAiirNFbra4HaXHmvXV0d2Grt00uzUXsN75BEa912d lbCdMq61B5hkdoknSE1oAxSZ6EEquDO01EZAQ3iuWP9uSai4mNDOskGgN1SXJy7f ndKfc+ff9vxSo6o+eIg/j2xvSXGt7PJbDGDumMraIUtufsEEsKHOFolIUXf93o6F mfajZw42krB7Sk9Hq/TkoaGUWP24BBUxXIpmYtJ7DfWa2sM5Yl91nkP7hPoqSokO wAI+fRh7A4WVOM7A/y0FH/JEZ6EOpBoDDj+GT9Yk2U0I/UaFGvrjRWHjv1HIbpFR l+tgbntRmjvhdQjYKaybETvtZVsOXsTAmbzgjC16JfxGa0TUcVe5QcWpEOGWN26l l3o6P2PgkflJQv+V8rvaul8gp8oEEoBNGt7+LOWW/ZWYU3GdgOgsB4O+t6khg9tw kXDJl2zT5qimrsOBvm6RjUTgiDWR7tWHmXUkrUEoKAYZyHaqigF2Liy8yNBJOJ6A DYXLiAkD3UX/xTIZIXpRN4v40TObLuC79uqCzaLaa8AHf2BSs05bx/nchgUkZLW3 LU8UxVrhsNFRCtcluXdqUCNyd37FQbEOS7E4R8cDRYlH3ywtmm/j3fVwXnZnvgPG 6uGZgSZ9vC1odsw3qMLH =Byur -----END PGP SIGNATURE----- --jCrbxBqMcLqd4mOl--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140623064044.GD93733>