From b65ca345ef0ebc482002cc363060b48fd6bc1b41 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Wed, 10 Apr 2019 10:21:14 +0000 Subject: [PATCH] Improve vnode lock assertions. MFC after: 2 weeks Sponsored by: DARPA, AFRL --- sys/kern/imgact_elf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index f882f324b21a..ef70aa05ba90 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -658,6 +658,8 @@ __elfN(load_sections)(struct image_params *imgp, const Elf_Ehdr *hdr, bool first; int error, i; + ASSERT_VOP_LOCKED(imgp->vp, __func__); + base_addr = 0; first = true; @@ -924,8 +926,7 @@ __elfN(get_interp)(struct image_params *imgp, const Elf_Phdr *phdr, KASSERT(phdr->p_type == PT_INTERP, ("%s: p_type %u != PT_INTERP", __func__, phdr->p_type)); - KASSERT(VOP_ISLOCKED(imgp->vp), - ("%s: vp %p is not locked", __func__, imgp->vp)); + ASSERT_VOP_LOCKED(imgp->vp, __func__); td = curthread;