From nobody Sat May 16 19:14:37 2026 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gHtzt5KrDz6ct6c for ; Sat, 16 May 2026 19:14:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gHtzs5xn0z3NZk; Sat, 16 May 2026 19:14:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 64GJEcCW051789; Sat, 16 May 2026 22:14:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 64GJEcCW051789 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 64GJEbPq051788; Sat, 16 May 2026 22:14:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 16 May 2026 22:14:37 +0300 From: Konstantin Belousov To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: current@freebsd.org Subject: Re: rms_rlock with non-sleepable locks held Message-ID: References: <86lddjelen.fsf@ltc.des.dev> <865x4nea98.fsf@ltc.des.dev> <861pfbe93h.fsf@ltc.des.dev> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <861pfbe93h.fsf@ltc.des.dev> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4gHtzs5xn0z3NZk X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sat, May 16, 2026 at 04:13:06PM +0200, Dag-Erling Smørgrav wrote: > Dag-Erling Smørgrav writes: > > Konstantin Belousov writes: > > > --- a/sys/kern/vfs_subr.c > > > +++ b/sys/kern/vfs_subr.c > > > @@ -6509,7 +6509,7 @@ vop_read_post(void *ap, int rc) > > > struct vop_read_args *a = ap; > > > > > > if (!rc) { > > > - VFS_KNOTE_LOCKED(a->a_vp, NOTE_READ); > > > + VN_KNOTE_LOCKED(a->a_vp, NOTE_READ); > > Did you mean to use VN_KNOTE_UNLOCKED() here... > > Probably not, as that resulted in a panic... Try this instead commit 4ef4999153389a423954fbf4c3d2e679fb96e110 Author: Konstantin Belousov Date: Sat May 16 22:11:43 2026 +0300 sys/mount.h: restore KNF_NOKQLOCK in VFS_KNOTE_{,UN}LOCKED ZFS needs to take internal sleepable lock in its implementation of VOP_GETATTR(). Due to this, kq must be unlocked around calls to the vfs filter methods. Fixes: 1d5e4020e36e1cc9e906200c9c3c784ef43d977e diff --git a/sys/sys/mount.h b/sys/sys/mount.h index d6696bba0a4f..2e880bac9068 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -968,8 +968,8 @@ static inline void VFS_KNOTE_LOCKED(struct vnode *vp, int hint) { if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) { - KNOTE_LOCKED(&vp->v_pollinfo->vpi_selinfo.si_note, - hint); + KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note, + hint, KNF_LISTLOCKED | KNF_NOKQLOCK); } } @@ -977,8 +977,8 @@ static inline void VFS_KNOTE_UNLOCKED(struct vnode *vp, int hint) { if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) { - KNOTE_UNLOCKED(&vp->v_pollinfo->vpi_selinfo.si_note, - hint); + KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note, + hint, KNF_NOKQLOCK); } }