From nobody Tue Dec 30 03:51:23 2025 X-Original-To: dev-commits-src-all@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 4dgJzt34H4z6Mm29; Tue, 30 Dec 2025 03:51:38 +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 4dgJzs5bCrz3ZLx; Tue, 30 Dec 2025 03:51:37 +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 5BU3pN7S028084; Tue, 30 Dec 2025 05:51:26 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 5BU3pN7S028084 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 5BU3pNmD028083; Tue, 30 Dec 2025 05:51:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 30 Dec 2025 05:51:23 +0200 From: Konstantin Belousov To: Kristof Provost Cc: Ka Ho Ng , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 112c453ba910 - stable/15 - geom(9): struct bio KBI fix Message-ID: References: <69489316.252e6.179063dd@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dgJzs5bCrz3ZLx On Mon, Dec 29, 2025 at 10:22:50AM +0100, Kristof Provost wrote: > On 22 Dec 2025, at 1:38, Ka Ho Ng wrote: > > The branch stable/15 has been updated by khng: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=112c453ba91012f19ed140c56a3ac8fc929ddabb > > > > commit 112c453ba91012f19ed140c56a3ac8fc929ddabb > > Author: Ka Ho Ng > > AuthorDate: 2025-12-21 22:45:03 +0000 > > Commit: Ka Ho Ng > > CommitDate: 2025-12-22 00:37:40 +0000 > > > > geom(9): struct bio KBI fix > > > > The struct bio was changed after cb85c2e2e995 on the branch. To fix > > this, move BIO_ERROR flag to another value, and now BIO_ERROR_COMPAT > > occupies 0x1 instead. Also, introduce b_error_compat field at the > > place > > where the old bio_error was. > > > > This allows non-CAM(9) disk drivers and software volume manager > > modules > > compiled against 15.0-RELEASE kernel to work on 15-STABLE kernel > > again. > > > > Reviewed by: kib > > Differential Revision: https://reviews.freebsd.org/D54327 > > > > Approved by: re (cperciva) > > I’m seeing panics on boot now: > > vtnet0: Ethernet address: 58:9c:fc:0c:60:85 > vtnet0: netmap queues/slots: TX 1/1024, RX 1panic: Memory modified after > free 0xfffff800038b51a8 (424, g_bio) + 0 = deadc0dedeacc0de > > cpuid = 6 > time = 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe008d5679a0 > vpanic() at vpanic+0x136/frame 0xfffffe008d567ad0 > panic() at panic+0x43/frame 0xfffffe008d567b30 > trash_ctor() at trash_ctor+0x74/frame 0xfffffe008d567b40 > item_ctor() at item_ctor+0x59/frame 0xfffffe008d567b90 > g_clone_bio() at g_clone_bio+0x1d/frame 0xfffffe008d567bb0 > g_part_start() at g_part_start+0x96/frame 0xfffffe008d567c40 > g_io_request() at g_io_request+0x2ca/frame 0xfffffe008d567c70 > g_read_data() at g_read_data+0x95/frame 0xfffffe008d567cb0 > g_raid_md_taste_intel() at g_raid_md_taste_intel+0x1d8/frame > 0xfffffe008d567e50 > g_raid_taste() at g_raid_taste+0x18e/frame 0xfffffe008d567ea0 > g_new_provider_event() at g_new_provider_event+0xaa/frame > 0xfffffe008d567ec0 > g_run_events() at g_run_events+0x104/frame 0xfffffe008d567ef0 > fork_exit() at fork_exit+0x82/frame 0xfffffe008d567f30 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe008d567f30 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > KDB: enter: panic > [ thread pid 13 tid 100069 ] > Stopped at kdb_enter+0x33: movq $0,0x121aa92(%rip) > db> > > With this commit (and the follow-up “geom(9): unset the BIO_ERROR_COMPAT > flag correctly”) reverted the VM boots again. Does the following help? diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index dc90bd3add22..2368f863a248 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -4523,8 +4523,6 @@ biodone(struct bio *bp) bp->bio_flags |= BIO_ERROR_COMPAT; } done(bp); - bp->bio_error_compat = 0; - bp->bio_flags &= ~BIO_ERROR_COMPAT; } }