Axe Giant from vn_fullpath(9). The vnode -> pathname lookup should be
filesystem agnostic. We are not touching any file system specific functions in this code path. Since we have a cache lock, there is really no need to keep Giant around here. This eliminates Giant acquisitions for any syscall which is auditing pathnames. Discussed with: jeff
This commit is contained in:
parent
28a3ae7f88
commit
4f0840f348
@ -771,11 +771,9 @@ vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf)
|
||||
|
||||
buf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
|
||||
fdp = td->td_proc->p_fd;
|
||||
mtx_lock(&Giant);
|
||||
FILEDESC_LOCK(fdp);
|
||||
error = vn_fullpath1(td, vn, fdp->fd_rdir, buf, retbuf, MAXPATHLEN);
|
||||
FILEDESC_UNLOCK(fdp);
|
||||
mtx_unlock(&Giant);
|
||||
|
||||
if (!error)
|
||||
*freebuf = buf;
|
||||
@ -795,8 +793,6 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
|
||||
int error, i, slash_prefixed;
|
||||
struct namecache *ncp;
|
||||
|
||||
mtx_assert(&Giant, MA_OWNED);
|
||||
|
||||
bp = buf + buflen - 1;
|
||||
*bp = '\0';
|
||||
error = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user