mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
vfs: disallow NOCACHE with LOOKUP
This means there is no expectation lookup will purge the terminal entry, which simplifies lockless lookup. Tested by: pho Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
fc9fcee01a
commit
7f70080150
2 changed files with 4 additions and 1 deletions
|
|
@ -484,6 +484,9 @@ namei(struct nameidata *ndp)
|
|||
("namei: nameiop contaminated with flags"));
|
||||
KASSERT((cnp->cn_flags & OPMASK) == 0,
|
||||
("namei: flags contaminated with nameiops"));
|
||||
if (cnp->cn_flags & NOCACHE)
|
||||
KASSERT(cnp->cn_nameiop != LOOKUP,
|
||||
("%s: NOCACHE passed with LOOKUP", __func__));
|
||||
MPASS(ndp->ni_startdir == NULL || ndp->ni_startdir->v_type == VDIR ||
|
||||
ndp->ni_startdir->v_type == VBAD);
|
||||
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS)
|
|||
|
||||
buf[req->newlen] = '\0';
|
||||
|
||||
ndflags = LOCKLEAF | NOFOLLOW | AUDITVNODE1 | NOCACHE | SAVENAME;
|
||||
ndflags = LOCKLEAF | NOFOLLOW | AUDITVNODE1 | SAVENAME;
|
||||
NDINIT(&nd, LOOKUP, ndflags, UIO_SYSSPACE, buf, curthread);
|
||||
if ((error = namei(&nd)) != 0)
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in a new issue