From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 4 09:39:42 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F21F16A405 for ; Sun, 4 Mar 2007 09:39:42 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.176.14]) by mx1.freebsd.org (Postfix) with ESMTP id AAA0D13C49D for ; Sun, 4 Mar 2007 09:39:41 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.8/8.13.7) with ESMTP id l249deTe083275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 4 Mar 2007 10:39:40 +0100 (CET) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.8/8.13.3/Submit) id l249devb083274; Sun, 4 Mar 2007 10:39:40 +0100 (CET) Date: Sun, 4 Mar 2007 10:39:40 +0100 From: Divacky Roman To: hackers@freebsd.org Message-ID: <20070304093940.GA82483@stud.fit.vutbr.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Scanned-By: MIMEDefang 2.57 on 147.229.176.14 Cc: Subject: inconsistency in using vn_fullpath1() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2007 09:39:42 -0000 hi I noticed that kern___getcwd() calls vn_fullpath1() with Giant held like this: mtx_lock(&Giant); FILEDESC_LOCK(fdp); error = vn_fullpath1(td, fdp->fd_cdir, fdp->fd_rdir, tmpbuf, &bp, buflen); FILEDESC_UNLOCK(fdp); mtx_unlock(&Giant); on the other hand vn_fullpath() calls it without Giant held like this: FILEDESC_LOCK(fdp); error = vn_fullpath1(td, vn, fdp->fd_rdir, buf, retbuf, MAXPATHLEN); FILEDESC_UNLOCK(fdp); I dont see much difference in the callings so I wonder if holding Giant is necessary when calling vn_fullpath1(). Because we either - do one unecessary locking operation or unsufficiently lock it. thnx for explaining to me and possibly fixing it. roman