NetBSD-Bugs archive

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

Re: kern/60621 (panic: ufs_inactive: dirty filesystem?)



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

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: "J. Hannken-Illjes" <hannken%NetBSD.org@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, netbsd-bugs%NetBSD.org@localhost
Subject: Re: kern/60621 (panic: ufs_inactive: dirty filesystem?)
Date: Tue, 17 Nov 2026 21:18:02 +0000

 > Date: Tue, 17 Nov 2026 20:58:53 +0000
 > From: "J. Hannken-Illjes" <hannken%netbsd.org@localhost>
 > 
 > On Tue, Nov 17, 2026 at 07:13:19PM +0000, Taylor R Campbell wrote:
 > > This suggests a (purely speculative, unconfirmed) hypothesis about the
 > > `ufs_inactive: dirty filesystem?' panic, that the fast path of writing
 > > to unlinked internal snapshots doesn't work with wapbl because it
 > > allocates blocks and updates i_blocks without grouping them into a
 > > single atomic transaction.
 > 
 > I suppose it is ffs_snapblkfree() claiming the freed block.  The
 > block moves to the snapshot and its i_blocks increases.  Don't know
 > how to group the snapshot inode update into this transaction yet.
 
 Perhaps, if that's not convenient to do, a cheap alternative would be
 relax the panic so it doesn't apply to snapshots?
 
 -	if (ip->i_mode == 0 && (DIP(ip, size) != 0 || DIP(ip, blocks) != 0)) {
 +	if (ip->i_mode == 0 &&
 +	    (DIP(ip, size) != 0 ||
 +		(DIP(ip, blocks) != 0 &&
 +		    (ip->i_flags & (SF_SNAPSHOT|SF_SNAPINVAL)) != 0))) {
 
 This should avoid the troublesome symptom (machine crashes
 persistently on reboot, requires manual intervention of running fsck
 from single-user mode to repair), without losing data (snapshot is
 unlinked anyway so it's garbage to be tossed).
 
 I say `cheap' both because:
 
 (a) this is a small change, but also
 
 (b) this doesn't address the underlying ickiness of
     - i_blocks going negative, or
     - (if my hypothesis is correct) non-atomic updates of the inode,
       violating ffs invariants in spite of having wapbl atomic
       transactions available.
 



Home | Main Index | Thread Index | Old Index