From owner-freebsd-fs@FreeBSD.ORG Thu Jun 7 12:37:52 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3B67106566B; Thu, 7 Jun 2012 12:37:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 872468FC1A; Thu, 7 Jun 2012 12:37:52 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E4A6CB96F; Thu, 7 Jun 2012 08:37:51 -0400 (EDT) From: John Baldwin To: freebsd-fs@freebsd.org Date: Thu, 7 Jun 2012 08:17:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201203071318.08241.jhb@freebsd.org> <20120606183949.GR85127@deviant.kiev.zoral.com.ua> <20120607062703.P955@besplex.bde.org> In-Reply-To: <20120607062703.P955@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206070817.26342.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 07 Jun 2012 08:37:52 -0400 (EDT) Cc: pho@freebsd.org Subject: Re: close() of an flock'd file is not atomic X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2012 12:37:52 -0000 On Wednesday, June 06, 2012 4:34:23 pm Bruce Evans wrote: > On Wed, 6 Jun 2012, Konstantin Belousov wrote: > > > On Wed, Jun 06, 2012 at 08:17:54AM -0400, John Baldwin wrote: > >>... > >> The vn_open_vnode() patch is at > >> http://www.freebsd.org/~jhb/patches/vn_open_vnode.patch > >> > >> I tested it by doing a buildworld -j 32 in a loop while NFS exporting the > >> /usr/obj tree to another machine that did a continual find | xargs md5 loop > >> over the /usr/obj tree. This survived overnight. > > > > There is #if 0 left in fhopen() which translates ERESTART into EINTR. Is > > it needed ? > > > > Otherwise it looks fine (but still quite hard to read). > > This translation in the old code causes the following bogus behaviour: > - some device drivers try to restart open() after revoke(). They return > ERESTART for this. But open never restarts, due to this translation. > Never restarting may be correct, but EINTR is a bogus errno unless the > open was actually interrupted by a signal, in which case the driver > should have returned EINTR. ENXIO is closest to describing "killed > by revoke". > > What case is the translation supposed to fix? I have no idea. :( I will take it out of fhopen() however since presumably fhopen() will not be used on devices (devfs doesn't have VOPs for filehandles and is not exportable). -- John Baldwin