Date: Sun, 4 Mar 2007 10:39:40 +0100 From: Divacky Roman <xdivac02@stud.fit.vutbr.cz> To: hackers@freebsd.org Subject: inconsistency in using vn_fullpath1() Message-ID: <20070304093940.GA82483@stud.fit.vutbr.cz>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070304093940.GA82483>