NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52056: mount -u / causes a kernel assertion



The following reply was made to PR kern/52056; it has been noted by GNATS.

From: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/52056: mount -u / causes a kernel assertion
Date: Fri, 10 Mar 2017 10:31:52 +0100

 > On 9 Mar 2017, at 23:35, Jarom=C3=ADr Dole=C4=8Dek =
 <jaromir.dolecek%gmail.com@localhost> wrote:
 >=20
 > The following reply was made to PR kern/52056; it has been noted by =
 GNATS.
 >=20
 > From: =3D?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=3D?=3D =
 <jaromir.dolecek%gmail.com@localhost>
 > To: gnats-bugs%netbsd.org@localhost
 > Cc:=20
 > Subject: Re: kern/52056: mount -u / causes a kernel assertion
 > Date: Thu, 9 Mar 2017 23:30:52 +0100
 >=20
 > I've looked on the code, and basically this assertion means that there
 > was a bdwrite() done with same buf before MNT_LOG was enabled, and no
 > bwrite() happened between that bdwrite() and the bdwrite() triggering
 > the assertion.
 >=20
 > wapbl_add_buf() is invoked in bdwrite(), before the BO_DELWRI flag is
 > set. It adds the buffer to internal WAPBL list, then sets the B_LOCKED
 > flag.
 >=20
 > The assertion fires only when buf still doesn't have B_LOCKED set, but
 > already has BO_DELWRI set. This flow should be impossible.
 
 This is more than possible.  Martin does:
 
 -> mount -u /		"Change root from read-only,no-log to no-log"
 -> edit file		"This will bdwrite() and leave buffers B_DELWRI"
 -> exit singleuser
 -> /etc/rc.d/root	"Change root from no-log to log"
 
 We now have buffers marked BO_DELWRI without B_LOCKED.
 
 This has nothing to do with my recent changes.
 
 We have to either:
 
 - Remove the assertion and have wapbl_add_buf() pick up these buffers.
 
 - Deny no-log to log transitions while read-write.
 
 --
 J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)
 


Home | Main Index | Thread Index | Old Index