Re: svn commit: r267760 - head/sys/kern

看板FB_svn作者時間11年前 (2014/06/23 15:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/14 (看更多)
--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--
文章代碼(AID): #1Jfz2kiJ (FB_svn)
討論串 (同標題文章)
文章代碼(AID): #1Jfz2kiJ (FB_svn)