NetBSD Problem Report #60477

From www@netbsd.org  Wed Jul 22 17:18:10 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR2" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6FB691A923B
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 22 Jul 2026 17:18:10 +0000 (UTC)
Message-Id: <20260722171809.6CFE91A923C@mollari.NetBSD.org>
Date: Wed, 22 Jul 2026 17:18:09 +0000 (UTC)
From: emmankoko519@gmail.com
Reply-To: emmankoko519@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Wrong assertion in raid(4) reconstruction on hot spare
X-Send-Pr-Version: www-1.0
X-From4GNATS: "emmankoko519@gmail.com via gnats" <gnats-admin@NetBSD.org>

>Number:         60477
>Category:       kern
>Synopsis:       Wrong assertion in raid(4) reconstruction on hot spare
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    joe
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 22 17:20:00 +0000 2026
>Closed-Date:    Mon Aug 03 13:00:31 +0000 2026
>Last-Modified:  Mon Aug 03 13:00:31 +0000 2026
>Originator:     Emmmanuel Nyarko
>Release:        netbsd current
>Organization:
NetBSD
>Environment:
amd64
>Description:
A wrong assertion is used when swapping components after a successful reconstruction of a failed disk unto a spare disk. This assertion triggers only when your kernel is compiled with RAID_DIAGNOSTIC. otherwise, you end up in a possible race condition because it doesn't get caught.  Needs pull-up to 11 and 10
>How-To-Repeat:
set up any raid level with a hot spare and fail one disk to be reconstructed unto the spare disk.
>Fix:
Yes, please!

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->joe
Responsible-Changed-By: joe@NetBSD.org
Responsible-Changed-When: Wed, 22 Jul 2026 17:22:53 +0000
Responsible-Changed-Why:
submitting a fix


State-Changed-From-To: open->needs-pullups
State-Changed-By: joe@NetBSD.org
State-Changed-When: Wed, 22 Jul 2026 17:46:43 +0000
State-Changed-Why:
pullup-11 and 10



From: "Emmanuel" <joe@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60477 CVS commit: src/sys/dev/raidframe
Date: Wed, 22 Jul 2026 17:44:22 +0000

 Module Name:	src
 Committed By:	joe
 Date:		Wed Jul 22 17:44:22 UTC 2026

 Modified Files:
 	src/sys/dev/raidframe: rf_disks.c

 Log Message:
 PR kern/60477

 Use the right assertions to ensure that all IOs are suspended.
 zero indicates that IOs resume.


 To generate a diff of this commit:
 cvs rdiff -u -r1.95 -r1.96 src/sys/dev/raidframe/rf_disks.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/60477 CVS commit: src/sys/dev/raidframe
Date: Wed, 22 Jul 2026 18:16:13 -0000 (UTC)

 joe@netbsd.org ("Emmanuel") writes:

 > Use the right assertions to ensure that all IOs are suspended.
 > zero indicates that IOs resume.

 Sure that only the counter value == 1 needs to be asserted? The
 opposite of == 0 is > 0.

From: Taylor R Campbell <riastradh@NetBSD.org>
To: emmankoko519@gmail.com
Cc: joe@NetBSD.org, netbsd-bugs@NetBSD.org, gnats-bugs@NetBSD.org
Subject: Re: kern/60477: Wrong assertion in raid(4) reconstruction on hot spare
Date: Wed, 22 Jul 2026 18:35:44 +0000

 Thanks, can you include the text of the assertion and stack trace you
 get when the system panics so there's a record of it in the PR?

 Makes it much easier for the next person who trips over the issue to
 search it if the full text of the panic and stack trace are available
 in gnats.

From: Emmanuel Nyarko <emmankoko519@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/60477 CVS commit: src/sys/dev/raidframe
Date: Wed, 22 Jul 2026 14:40:42 -0600

 > On Jul 22, 2026, at 12:20=E2=80=AFPM, Michael van Elst via gnats =
 <gnats-admin@NetBSD.org> wrote:
 >=20
 > The following reply was made to PR kern/60477; it has been noted by =
 GNATS.
 >=20
 > From: mlelstv@serpens.de (Michael van Elst)
 > To: gnats-bugs@netbsd.org
 > Cc:=20
 > Subject: Re: PR/60477 CVS commit: src/sys/dev/raidframe
 > Date: Wed, 22 Jul 2026 18:16:13 -0000 (UTC)
 >=20
 > joe@netbsd.org ("Emmanuel") writes:
 >=20
 >> Use the right assertions to ensure that all IOs are suspended.
 >> zero indicates that IOs resume.
 >=20
 > Sure that only the counter value =3D=3D 1 needs to be asserted? The
 > opposite of =3D=3D 0 is > 0.
 >=20
 Hi,=20

 Thanks for the alert!  best to do it greater than zero.

 Emmanuel





From: "Emmanuel" <joe@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60477 CVS commit: src/sys/dev/raidframe
Date: Wed, 22 Jul 2026 20:46:54 +0000

 Module Name:	src
 Committed By:	joe
 Date:		Wed Jul 22 20:46:54 UTC 2026

 Modified Files:
 	src/sys/dev/raidframe: rf_disks.c

 Log Message:
 PR kern/60477

 Use greater than zero instead of strictly one


 To generate a diff of this commit:
 cvs rdiff -u -r1.96 -r1.97 src/sys/dev/raidframe/rf_disks.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Stephen Borrill" <sborrill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60477 CVS commit: [netbsd-10] src/sys/dev/raidframe
Date: Wed, 29 Jul 2026 10:16:44 +0000

 Module Name:	src
 Committed By:	sborrill
 Date:		Wed Jul 29 10:16:44 UTC 2026

 Modified Files:
 	src/sys/dev/raidframe [netbsd-10]: rf_disks.c

 Log Message:
 Pull up the following revisions(s) (requested by joe in ticket #1315):
 	sys/dev/raidframe/rf_disks.c:	revision 1.96-1.97

 Use the right assertions to ensure that all IOs are suspended.
 zero indicates that IOs resume.
 PR kern/60477


 To generate a diff of this commit:
 cvs rdiff -u -r1.93.4.2 -r1.93.4.3 src/sys/dev/raidframe/rf_disks.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/60477 CVS commit: [netbsd-11] src/sys/dev/raidframe
Date: Sun, 2 Aug 2026 13:16:36 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Aug  2 13:16:36 UTC 2026

 Modified Files:
 	src/sys/dev/raidframe [netbsd-11]: rf_disks.c

 Log Message:
 Pull up following revision(s) (requested by joe in ticket #394):

 	sys/dev/raidframe/rf_disks.c: revision 1.96
 	sys/dev/raidframe/rf_disks.c: revision 1.97

 PR kern/60477

 Use the right assertions to ensure that all IOs are suspended.
 zero indicates that IOs resume.

 PR kern/60477

 Use greater than zero instead of strictly one


 To generate a diff of this commit:
 cvs rdiff -u -r1.95 -r1.95.8.1 src/sys/dev/raidframe/rf_disks.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: needs-pullups->closed
State-Changed-By: joe@NetBSD.org
State-Changed-When: Mon, 03 Aug 2026 13:00:31 +0000
State-Changed-Why:
fixed in current, pulled up in 11 and 10


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.