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

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to