inconsistency in using vn_fullpath1()
Divacky Roman
xdivac02 at stud.fit.vutbr.cz
Sun Mar 4 09:39:42 UTC 2007
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
More information about the freebsd-hackers
mailing list