From owner-cvs-src@FreeBSD.ORG Tue Mar 10 03:37:29 2009 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C887106566B; Tue, 10 Mar 2009 03:37:29 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 234A08FC12; Tue, 10 Mar 2009 03:37:28 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n2A3LM9P028488; Mon, 9 Mar 2009 23:21:22 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.0 (mail.netplex.net [204.213.176.10]); Mon, 09 Mar 2009 23:21:22 -0400 (EDT) Date: Mon, 9 Mar 2009 23:21:22 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Doug Rabson In-Reply-To: <200803261523.m2QFND30047541@repoman.freebsd.org> Message-ID: References: <200803261523.m2QFND30047541@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libc/gen lockf.c src/lib/libc/sys Symbol.map fcntl.2 src/sys/compat/freebsd32 syscalls.master src/sys/compat/linux linux_file.c src/sys/compat/svr4 svr4_fcntl.c src/sys/conf NOTES files options ... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2009 03:37:29 -0000 On Wed, 26 Mar 2008, Doug Rabson wrote: > dfr 2008-03-26 15:23:13 UTC > > FreeBSD src repository > > Modified files: > lib/libc/sys Symbol.map fcntl.2 [ ... ] > sys/sys fcntl.h lockf.h [ ... ] > Log: > Add the new kernel-mode NFS Lock Manager. To use it instead of the > user-mode lock manager, build a kernel with the NFSLOCKD option and > add '-k' to 'rpc_lockd_flags' in rc.conf. Sorry to notice this 1 year too late, but doesn't this break ABI? You have changed the size (increased) of struct flock and haven't really provided a compat version of fcntl() that will work with binaries built before the change. Is there any way that the new field can be accidentally used by the kernel from a binary built against the older struct flock? Now that we have symbol versioning, the way this normally should be handled is by adding a compat fcntl() for FBSD_1.0 in libc, and placing the new fcntl() in FBSD_1.1. And since libthr wraps fcntl() for cancellation points, I believe it would also need the same compat functions. -- DE From owner-cvs-src@FreeBSD.ORG Tue Mar 10 09:18:38 2009 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA4D1106567B; Tue, 10 Mar 2009 09:18:38 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from itchy.rabson.org (unknown [IPv6:2002:50b1:e8f2:1::143]) by mx1.freebsd.org (Postfix) with ESMTP id 5BA0E8FC1F; Tue, 10 Mar 2009 09:18:38 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc] (unknown [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc]) by itchy.rabson.org (Postfix) with ESMTP id 5FCC63F9C; Tue, 10 Mar 2009 09:17:17 +0000 (GMT) Message-Id: <2E168868-9711-4BF7-A398-FF4195390B7C@rabson.org> From: Doug Rabson To: Daniel Eischen In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Tue, 10 Mar 2009 09:18:35 +0000 References: <200803261523.m2QFND30047541@repoman.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: cvs-src@freebsd.org, Doug Rabson , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libc/gen lockf.c src/lib/libc/sys Symbol.map fcntl.2 src/sys/compat/freebsd32 syscalls.master src/sys/compat/linux linux_file.c src/sys/compat/svr4 svr4_fcntl.c src/sys/conf NOTES files options ... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2009 09:18:42 -0000 On 10 Mar 2009, at 03:21, Daniel Eischen wrote: > On Wed, 26 Mar 2008, Doug Rabson wrote: > >> dfr 2008-03-26 15:23:13 UTC >> >> FreeBSD src repository >> >> Modified files: >> lib/libc/sys Symbol.map fcntl.2 > [ ... ] >> sys/sys fcntl.h lockf.h > [ ... ] >> Log: >> Add the new kernel-mode NFS Lock Manager. To use it instead of the >> user-mode lock manager, build a kernel with the NFSLOCKD option and >> add '-k' to 'rpc_lockd_flags' in rc.conf. > > Sorry to notice this 1 year too late, but doesn't this > break ABI? You have changed the size (increased) of > struct flock and haven't really provided a compat version > of fcntl() that will work with binaries built before > the change. I added new fcntl commands for the new structures. The old commands were renamed to F_OGETLK, F_OSETLK and F_OSETLKW and continue to use the old structures. A new kernel translates old fcntl commands to the equivalent new commands. A new libc will detect when its running on an old kernel and will translate the new fcntl commands to the equivalent old ones. > > Is there any way that the new field can be accidentally > used by the kernel from a binary built against the older > struct flock? No. > > Now that we have symbol versioning, the way this normally > should be handled is by adding a compat fcntl() for > FBSD_1.0 in libc, and placing the new fcntl() in FBSD_1.1. > And since libthr wraps fcntl() for cancellation points, > I believe it would also need the same compat functions. I thought about this but in the end it was simpler to add new fcntl commands. The libthr compat issue is dealt with by calling __fcntl_compat() for commands other than F_DUPFD, F_SETFD, F_SETFL, F_GETFD or F_GETFL.