From owner-svn-src-head@FreeBSD.ORG Mon Jun 23 06:40:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D925DD55; Mon, 23 Jun 2014 06:40:54 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A6CE236D; Mon, 23 Jun 2014 06:40:54 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5N6eiHi057333; Mon, 23 Jun 2014 09:40:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5N6eiHi057333 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s5N6eix4057332; Mon, 23 Jun 2014 09:40:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 23 Jun 2014 09:40:44 +0300 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r267760 - head/sys/kern Message-ID: <20140623064044.GD93733@kib.kiev.ua> References: <201406230128.s5N1SIYK097224@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jCrbxBqMcLqd4mOl" Content-Disposition: inline In-Reply-To: <201406230128.s5N1SIYK097224@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 06:40:54 -0000 --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--