From owner-freebsd-bugs@FreeBSD.ORG Sun Apr 1 20:00:18 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34BD916A409 for ; Sun, 1 Apr 2007 20:00:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id D50A613C487 for ; Sun, 1 Apr 2007 20:00:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l31K0H7T074775 for ; Sun, 1 Apr 2007 20:00:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l31K0H30074770; Sun, 1 Apr 2007 20:00:17 GMT (envelope-from gnats) Date: Sun, 1 Apr 2007 20:00:17 GMT Message-Id: <200704012000.l31K0H30074770@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Kris Kennaway Cc: Subject: Re: bin/111101: /usr/bin/lockf: when lockf blocks due to another lockf and no -k is specified and the other lockf ends, the file is away X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Kris Kennaway List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Apr 2007 20:00:18 -0000 The following reply was made to PR bin/111101; it has been noted by GNATS. From: Kris Kennaway To: Arne Woerner Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/111101: /usr/bin/lockf: when lockf blocks due to another lockf and no -k is specified and the other lockf ends, the file is away Date: Sun, 1 Apr 2007 15:53:08 -0400 On Sun, Apr 01, 2007 at 06:41:43PM +0000, Arne Woerner wrote: > >Description: > I use lockf in order to coordinate the access to my TV frame grabbers (/dev/cxm?). > > When another recording starts (process B) it can happen that a previous recording (process A) still needs some seconds, I end up with an unlink-ed lock file. > > I would expect the following order: > > 1. process A: holds file LCK > 2. process B: blocks on file LCK > 3. process A: unlinks file LCK > 4. process A: releases lock on file LCK > 5. process B: locks the already opened but unlinked file LCK > 6. process B: checks, if file LCK still exists > 7. process B: creates file LCK > 8. process B: locks file LCK > > As a workaround I use lockf with option "-k", which should solve that problem... > > Furthermore I would like to recommend, to make the "-k" behaviour the default behaviour, so that we will not remove data files, that were co-used as lock files... We cannot do that, not using -k is required in some situations, so those scripts will break. It appears that lockf is working as designed, and also as explicitly documented. It looks like no action can be taken here. Kris