From owner-freebsd-current Tue Sep 10 3:46:19 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83EED37B400; Tue, 10 Sep 2002 03:46:17 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12E9C43E6A; Tue, 10 Sep 2002 03:46:17 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.5/8.12.5) with ESMTP id g8AAk7wr094789; Tue, 10 Sep 2002 03:46:11 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200209101046.g8AAk7wr094789@gw.catspoiler.org> Date: Tue, 10 Sep 2002 03:46:07 -0700 (PDT) From: Don Lewis Subject: Re: vnode lock assertion problem in nfs_link() To: bde@zeta.org.au Cc: rwatson@FreeBSD.ORG, current@FreeBSD.ORG, jeff@FreeBSD.ORG In-Reply-To: <20020910194838.M876-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 10 Sep, Bruce Evans wrote: > On Tue, 10 Sep 2002, Don Lewis wrote: > >> On 10 Sep, Bruce Evans wrote: >> > The changes are obviously just cleanups for leaf file systems, but I >> > wonder why everything wasn't always locked at the top. Could it have >> > been because locking all the way down is harmful? >> >> Judging by how the leaf filesystems were careful to only do the lock if >> tdvp != vp, I suspect there was the potential for a deadlock if both >> vnodes were automatically locked at the top. ... or panic "locking against myself" ... > I think this is because some places are still worrying about using > link(2) on directories. I think there aren't any significant problems > when vp is not a directory. Hard linking of directories was permitted > (and perhaps even supported) until relatively recently: I suspect that you are right about this. If so, it should be able to let namei() lock the first vnode since we check its type and bail out if it is a directory before the second namei() call. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message