git: 0e89914326ec - stable/13 - vfs: hoist cn_thread assert in namei
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Oct 2021 09:15:55 UTC
The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0e89914326ec11d4c1685e8ecb14f6349ea8f591 commit 0e89914326ec11d4c1685e8ecb14f6349ea8f591 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-10-01 21:13:38 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-10-11 09:13:35 +0000 vfs: hoist cn_thread assert in namei Making it condtional on whether ktrace happens to be enabled makes no sense. (cherry picked from commit c9536389d732feecf61afa4632397d67b04b2ab4) --- sys/kern/vfs_lookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index a827c87538b8..454a10175e1b 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -556,6 +556,8 @@ namei(struct nameidata *ndp) cnp = &ndp->ni_cnd; td = cnp->cn_thread; #ifdef INVARIANTS + KASSERT(cnp->cn_thread == curthread, + ("namei not using curthread")); KASSERT((ndp->ni_debugflags & NAMEI_DBG_CALLED) == 0, ("%s: repeated call to namei without NDREINIT", __func__)); KASSERT(ndp->ni_debugflags == NAMEI_DBG_INITED, @@ -610,8 +612,6 @@ namei(struct nameidata *ndp) #ifdef KTRACE if (KTRPOINT(td, KTR_NAMEI)) { - KASSERT(cnp->cn_thread == curthread, - ("namei not using curthread")); ktrnamei(cnp->cn_pnbuf); } #endif