From owner-freebsd-bugs Mon Oct 7 13:40:11 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54A6137B401 for ; Mon, 7 Oct 2002 13:40:09 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B56443E65 for ; Mon, 7 Oct 2002 13:40:09 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g97Ke8Co050481 for ; Mon, 7 Oct 2002 13:40:08 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g97Ke8d9050480; Mon, 7 Oct 2002 13:40:08 -0700 (PDT) Date: Mon, 7 Oct 2002 13:40:08 -0700 (PDT) Message-Id: <200210072040.g97Ke8d9050480@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ian Dowse Subject: Re: kern/43739: cannot open file without obvious reason Reply-To: Ian Dowse Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/43739; it has been noted by GNATS. From: Ian Dowse To: Arne Woerner Cc: bug-followup@FreeBSD.org, roam@ringlet.net, fanf@FreeBSD.org Subject: Re: kern/43739: cannot open file without obvious reason Date: Mon, 07 Oct 2002 21:32:02 +0100 In message <200210071810.g97IA825093533@freefall.freebsd.org>, Arne Woerner wri tes: > IT IS THE "LOCKF"! > While the lockf blocks the session will not terminate. And a new > session can only be started as soon as the old session terminates. > See: > ( repeat 1000000000 ssh cyclops ./ICanDo.sh ) < /dev/null & > > I wonder why you both are reading my emails if you do not want to > understand them. I do not spend my time writing bug reports just for > your amusement or to allow you to insult me. Hi Arne, Nobody is trying to insult you, but we do need to ask a few questions to verify the problem, as we get many bogus problem reports that turn out to be misunderstandings or user errors. That is not the case here, but a few pieces of extra information such as the output of fstat and the value of kern.*files would have quickly confirmed to us that there is in fact a real bug. It looks like a fdrop() call in open() (now kern_open) was lost in revision 1.218 of vfs_syscalls.c. It probably wasn't noticed because it is in an error case that would rarely occur in practice. Doing lockf /dev/null ls is a reliable way of repeating the bug, as can be confirmed by monitoring kern.openfiles. The following patch appears to fix it. Ian Index: vfs_syscalls.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.289 diff -u -r1.289 vfs_syscalls.c --- vfs_syscalls.c 2 Oct 2002 09:05:30 -0000 1.289 +++ vfs_syscalls.c 7 Oct 2002 20:13:05 -0000 @@ -773,6 +773,7 @@ fdrop(fp, td); } else FILEDESC_UNLOCK(fdp); + fdrop(fp, td); return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message