From 4c04226222e499a47dd89988bcbd6df1362c6f4f Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 1 Nov 2021 09:14:01 +0200 Subject: [PATCH] getblk(): do not require devvp vnodes to be locked (cherry picked from commit a7b4a54d2c02822d36bb51b1e4450e1bc14ba73a) --- sys/kern/vfs_bio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 6ce445cbf2ee..1e58339446a9 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3902,7 +3902,8 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, int slpflag, CTR3(KTR_BUF, "getblk(%p, %ld, %d)", vp, (long)blkno, size); KASSERT((flags & (GB_UNMAPPED | GB_KVAALLOC)) != GB_KVAALLOC, ("GB_KVAALLOC only makes sense with GB_UNMAPPED")); - ASSERT_VOP_LOCKED(vp, "getblk"); + if (vp->v_type != VCHR) + ASSERT_VOP_LOCKED(vp, "getblk"); if (size > maxbcachebuf) panic("getblk: size(%d) > maxbcachebuf(%d)\n", size, maxbcachebuf);