Subject: kern/33179: LFS deadlock and another panic
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <juan@xtrarom.org>
List: netbsd-bugs
Date: 04/02/2006 07:55:00
>Number:         33179
>Category:       kern
>Synopsis:       LFS deadlock and another panic
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 02 07:55:00 +0000 2006
>Originator:     Juan RP
>Release:        NetBSD 3.99.17
>Organization:
>Environment:
System: NetBSD nocturno 3.99.17 NetBSD 3.99.17 (Nocturno) #553: Sun Apr 2 09:00:02 CEST 2006 juan@nocturno:/home/juan/build/obj/sys/arch/i386/compile/Nocturno i386
Architecture: i386
Machine: i386
>Description:
	I've found two problems with LFS in a very recent -current
	system:

	* A deadlock ocurrs doing the following:
		
		$ cvs -d:ext:anoncvs@anoncvs.netbsd.org:/cvsroot co -P pkgsrc
		$ mkdir /usr/pkgsrc
		$ mount_null /home/foo/pkgsrc /usr/pkgsrc
		$ cd /usr/pkgsrc && cvs up -dP

		/home should be lfs and /usr ffs.

		The process will be unkillable and it will wait in lfs_seglock
		state.

	* A panic ocurred after removing and creating multiple files on the
	  same file system (unpacking and removing pkgsrc six or seven times):

	panic: lfs_truncate: negative bytes

Stopped in pid 1178.1 (rm) at   netbsd:cpu_Debugger+0x4:        leave   
db> cpu_Debugger(c043b166,cd233c48,cd233c3c,c0299b9a,c044e8a0) at netbsd:cpu_Deb
ugger+0x4
panic(c0420b8d,4700,180,2000,ffffffff) at netbsd:panic+0x12c
lfs_update_seguse(c196c800,4700,180,400,cd233d68) at netbsd:lfs_update_seguse+0x
159
lfs_truncate(cfec56a8,0,0,204,cd211ec8) at netbsd:lfs_truncate+0xb95
ufs_rmdir(cd233e94,cfec56a8,ffffffff,cd233eec,cd233e74) at netbsd:ufs_rmdir+0x20
8
lfs_rmdir(cd233e94,cfec56a8,cd13ab5c,cd211ec8,c03f8de0) at netbsd:lfs_rmdir+0x63
VOP_RMDIR(cfd18548,cfec56a8,cd233ef8,2,c04d1280) at netbsd:VOP_RMDIR+0x30
sys_rmdir(cd13ab5c,cd233f64,cd233f5c,cd212b70,c01d7180) at netbsd:sys_rmdir+0x15
2
syscall_plain() at netbsd:syscall_plain+0x85
[...]

>How-To-Repeat:
>Fix:
	Dunno, sorry.