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 18:11:53 +0000

 > Date: Sun, 15 Nov 2026 14:32:10 +0000
 > From: "J. Hannken-Illjes" <hannken%netbsd.org@localhost>
 >=20
 > With this simple recipe I always get the panic "transaction too big...":
 >=20
 >   dd if=3D/dev/zero of=3Dfile0 bs=3D1m count=3D45k
 >   /usr/sbin/fssconfig -c -v fss0 / /
 >   rm file0
 
 Thanks!  Tried simulating this with /usr/tests/fs/ffs/t_snapshot_log
 by cranking down the log size after newfs with tunefs so that we can
 reproduce it by rm'ing a smaller file (say 1 MiB instead of 45 GiB).
 But it didn't go so well.  With `tunefs -l 69632' (68*1024), the test
 still passes, but with `tunefs -l 69631' (67*1024 + 1023), it crashes
 with:
 
 panic: kernel diagnostic assertion "delta !=3D size || newoff =3D=3D oldoff=
 " failed: file "/home/riastradh/netbsd/current/src/sys/rump/librump/rumpvfs=
 /../../../kern/vfs_wapbl.c", line 1460 size=3D64512, delta=3D64512 off=3D10=
 24 newoff=3D65536 oldoff=3D0
 
 Which is this assertion (converted locally into KASSERTMSG):
 
 	KASSERTMSG(delta !=3D size || newoff =3D=3D oldoff,
 	    "size=3D%zu, delta=3D%zu off=3D%zu newoff=3D%zu oldoff=3D%lld",
 	    size, delta, off, newoff, (long long)oldoff);
 
 https://nxr.netbsd.org/xref/src/sys/kern/vfs_wapbl.c?r=3D1.117#1450
 
 > Using a persistent snapshot or no snapshot the "rm" succeeds.
 
 I assume you mean `Using a *non*-persistent snapshot or no snapshot'?
 
 > Unfortunately on next reboot "wapbl_replay" always succeeds and the
 > "ufs_inactive" panic doesn't happen.  I remember seeing this panic
 > some times with crashes while an unlinked snapshot was open.
 
 Well, a reproducer for the `transaction too big' panic is still worth
 having!
 
 Does it help to use dump instead of fssconfig, and rm the file while
 the dump is still running?
 
 > I'm quite sure this inode 61 is such an unlinked snapshot.  It was
 > registered with "wapbl_register_inode" when its link count became zero
 > while it was still open.  On reboot "wapbl_replay" finds it, truncates
 > it to size zero and "ufs_inactive" panics.  As this inode now has
 > size zero and block count 0xfffffffffffffec0 =3D=3D -320 it looks like the
 > the field i_blocks was too low, missing 320 disk blocks.
 >=20
 > Have to look deeper into wapbl if there should be a guarantee the number
 > of allocated blocks and the inode field i_blocks are in sync when a
 > transaction gets flushed.
 
 Presumably any
 
 (a) changes to i_blocks, and
 (b) block allocations
 
 happen together in a single wapbl transaction delimited by
 UFS_WAPBL_BEGIN/END, no?  Perhaps we need to sprinkle some more
 UFS_WAPBL_JLOCK_ASSERT around access to these?
 
 
 I continue to think that we should invent a new type of logical log
 entry for deallocating blocks and truncating an inode (or two types)
 so that truncate operations require only bounded size at any given
 time in the log -- and we can roll back an incomplete write on crash
 if the written data haven't hit the disk (PR kern/58553: ffs: garbage
 data appended after crash).
 



Home | Main Index | Thread Index | Old Index