From danny@cs.huji.ac.il  Sun Aug  9 07:22:46 2009
Return-Path: <danny@cs.huji.ac.il>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC8CB10656A4
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Aug 2009 07:22:46 +0000 (UTC)
	(envelope-from danny@cs.huji.ac.il)
Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84])
	by mx1.freebsd.org (Postfix) with ESMTP id 496DB8FC2E
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Aug 2009 07:22:46 +0000 (UTC)
Received: from sunfire.cs.huji.ac.il ([132.65.16.80])
	by kabab.cs.huji.ac.il with esmtp
	id 1Ma2Tx-0000Dl-22
	for FreeBSD-gnats-submit@freebsd.org; Sun, 09 Aug 2009 10:06:17 +0300
Received: from danny by sunfire.cs.huji.ac.il with local (Exim 4.69 (FreeBSD))
	(envelope-from <danny@cs.huji.ac.il>)
	id 1Ma2Tx-0004Wz-1k
	for FreeBSD-gnats-submit@freebsd.org; Sun, 09 Aug 2009 10:06:17 +0300
Message-Id: <E1Ma2Tx-0004Wz-1k@sunfire.cs.huji.ac.il>
Date: Sun, 09 Aug 2009 10:06:17 +0300
From: Danny Braniss <danny@cs.huji.ac.il>
Reply-To: Danny Braniss <danny@cs.huji.ac.il>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: LOR unionfs
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         137588
>Category:       kern
>Synopsis:       [unionfs] [lor] LOR nfs/ufs/nfs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 09 07:30:01 UTC 2009
>Closed-Date:    
>Last-Modified:  Wed Jul 03 00:59:21 UTC 2013
>Originator:     Danny Braniss
>Release:        FreeBSD 8.0-BETA2 amd64
>Organization:
>Environment:
System: FreeBSD pundit-2 8.0-BETA2 FreeBSD 8.0-BETA2 #4: Fri Aug 7 12:54:04 IDT 2009 danny@sunfire:/r+d/obj/sunfire/home/src/head/sys/HUJI amd64


	
>Description:
	host is diskless, and mount /etc via unionfs to a mfs, and onboot:
lock order reversal:
 1st 0xffffff00029577f8 nfs (nfs) @ /home/src/head/sys/modules/unionfs/../../fs/unionfs/union_vnops.c:1821
 2nd 0xffffff0002956ba8 ufs (ufs) @ /home/src/head/sys/modules/unionfs/../../fs/unionfs/union_vnops.c:1843
 3rd 0xffffff0002d79098 nfs (nfs) @ /home/src/head/sys/nfsclient/nfs_node.c:161
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2a
_witness_debugger() at _witness_debugger+0x2e
witness_checkorder() at witness_checkorder+0x81e
__lockmgr_args() at __lockmgr_args+0xcf3
nfs_nget() at nfs_nget+0x1c9
nfs_lookup() at nfs_lookup+0x4fa
VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0x95
unionfs_lookup() at unionfs_lookup+0x586
vfs_cache_lookup() at vfs_cache_lookup+0xf0
VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0x95
lookup() at lookup+0x37d
namei() at namei+0x479
kern_statat_vnhook() at kern_statat_vnhook+0x8f
kern_statat() at kern_statat+0x15
stat() at stat+0x2a
syscall() at syscall+0x1af
Xfast_syscall() at Xfast_syscall+0xe1
--- syscall (188, FreeBSD ELF64, stat), rip = 0x80072f41c, rsp = 0x7fffffffebb8, rbp = 0x8009173c0 ---
lock order reversal:
 1st 0xffffff0002d1fd80 unionfs (unionfs) @ /home/src/head/sys/modules/unionfs/../../fs/unionfs/union_subr.c:356
 2nd 0xffffff0002d79098 nfs (nfs) @ /home/src/head/sys/kern/vfs_subr.c:2188
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2a
_witness_debugger() at _witness_debugger+0x2e
witness_checkorder() at witness_checkorder+0x81e
__lockmgr_args() at __lockmgr_args+0xcf3
vop_stdlock() at vop_stdlock+0x39
VOP_LOCK1_APV() at VOP_LOCK1_APV+0x9b
_vn_lock() at _vn_lock+0x47
vrele() at vrele+0x131
unionfs_noderem() at unionfs_noderem+0x1a4
unionfs_reclaim() at unionfs_reclaim+0x11
vgonel() at vgonel+0x105
vrecycle() at vrecycle+0x4c
unionfs_inactive() at unionfs_inactive+0x20
vinactive() at vinactive+0x72
vput() at vput+0x230
kern_statat_vnhook() at kern_statat_vnhook+0xfa
kern_statat() at kern_statat+0x15
stat() at stat+0x2a
syscall() at syscall+0x1af
Xfast_syscall() at Xfast_syscall+0xe1
--- syscall (188, FreeBSD ELF64, stat), rip = 0x80072f41c, rsp = 0x7fffffffebb8, rbp = 0x8009173c0 ---
lock order reversal:
 1st 0xffffff0002d1fd80 unionfs (unionfs) @ /home/src/head/sys/modules/unionfs/../../fs/unionfs/union_subr.c:356
 2nd 0xffffff0002d1fba8 ufs (ufs) @ /home/src/head/sys/kern/vfs_subr.c:2188
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2a
_witness_debugger() at _witness_debugger+0x2e
witness_checkorder() at witness_checkorder+0x81e
__lockmgr_args() at __lockmgr_args+0xcf3
ffs_lock() at ffs_lock+0x8c
VOP_LOCK1_APV() at VOP_LOCK1_APV+0x9b
_vn_lock() at _vn_lock+0x47
vrele() at vrele+0x131
unionfs_noderem() at unionfs_noderem+0x1c4
unionfs_reclaim() at unionfs_reclaim+0x11
vgonel() at vgonel+0x105
vrecycle() at vrecycle+0x4c
unionfs_inactive() at unionfs_inactive+0x20
vinactive() at vinactive+0x72
vput() at vput+0x230
kern_statat_vnhook() at kern_statat_vnhook+0xfa
kern_statat() at kern_statat+0x15
stat() at stat+0x2a
syscall() at syscall+0x1af
Xfast_syscall() at Xfast_syscall+0xe1
--- syscall (188, FreeBSD ELF64, stat), rip = 0x80072f41c, rsp = 0x7fffffffebb8, rbp = 0x8009173c0 ---

>How-To-Repeat:
	boot diskless host, in /etc/rc.initdiskless add:
	if [ -e /conf/union ]; then
    	   kldload unionfs
    	   mount_md 4096 /.etc
    	   mount_unionfs -o transparent /.etc /etc
	fi
fi

>Fix:

	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->daichi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Aug 9 07:51:20 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137588 
State-Changed-From-To: open->open 
State-Changed-By: linimon 
State-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
State-Changed-Why:  
commit bit has been taken in for safekeeping. 


Responsible-Changed-From-To: daichi->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=137588 
>Unformatted:
