From nobody@FreeBSD.org  Fri Feb 17 15:38:17 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A891E106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 17 Feb 2012 15:38:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 93BEC8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 17 Feb 2012 15:38:17 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HFcHkI073332
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 17 Feb 2012 15:38:17 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q1HFcHEv073331;
	Fri, 17 Feb 2012 15:38:17 GMT
	(envelope-from nobody)
Message-Id: <201202171538.q1HFcHEv073331@red.freebsd.org>
Date: Fri, 17 Feb 2012 15:38:17 GMT
From: Guilherme Rosrio <guilherme.f.rosario@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: BUG 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165240
>Category:       kern
>Synopsis:       [lor] lock order reversal in vfs layer
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 17 15:40:08 UTC 2012
>Closed-Date:    
>Last-Modified:  Mon Feb 27 01:16:45 UTC 2012
>Originator:     Guilherme Rosrio
>Release:        9.0
>Organization:
RAICOM
>Environment:
arquivos# uname -a
FreeBSD arquivos 9.0-STABLE FreeBSD 9.0-STABLE #0: Thu Feb 16 09:30:00 BRST 2012     root@arquivos:/usr/obj/usr/src/sys/RAICOM  i386
arquivos#

>Description:
lock order reversal:
 1st 0xc85f0e28 ufs (ufs) @ /usr/src/sys/kern/vfs_mount.c:845
 2nd 0xc66f7278 newnfs (newnfs) @ /usr/src/sys/kern/vfs_subr.c:2167
KDB: stack backtrace:
db_trace_self_wrapper(c0f17f11,5f736676,72627573,323a632e,a373631,...) at db_tra                                             ce_self_wrapper+0x26
kdb_backtrace(c0a5697b,c0f1b8c9,c4568f90,c4569610,e75e6824,...) at kdb_backtrace                                             +0x2a
_witness_debugger(c0f1b8c9,c66f7278,c0f04697,c4569610,c0f23680,...) at _witness_                                             debugger+0x25
witness_checkorder(c66f7278,9,c0f23680,877,0,...) at witness_checkorder+0x839
__lockmgr_args(c66f7278,80100,c66f7298,0,0,...) at __lockmgr_args+0x824
nfs_lock1(e75e6944,c0a67bdb,c0f2295e,80100,c66f7220,...) at nfs_lock1+0xc2
VOP_LOCK1_APV(c1038fc0,e75e6944,c8a7bc30,c1072ce0,c66f7220,...) at VOP_LOCK1_APV                                             +0xb5
_vn_lock(c66f7220,80100,c0f23680,877,4,...) at _vn_lock+0x5e
vget(c66f7220,80100,c8a7bb80,50,0,...) at vget+0xb9
vfs_hash_get(c4a60798,ab0531c6,80000,c8a7bb80,e75e6a04,...) at vfs_hash_get+0xe6
ncl_nget(c4a60798,c8bb908c,1c,e75e6a30,80000,...) at ncl_nget+0xcf
nfs_root(c4a60798,80000,e75e6c18,356,c45c84d0,...) at nfs_root+0x42
vfs_donmount(c8a7bb80,0,0,c5594700,c5594700,...) at vfs_donmount+0xe9a
sys_nmount(c8a7bb80,e75e6cec,c0f61f16,c0f1ca1a,206,...) at sys_nmount+0x7f
syscall(e75e6d28) at syscall+0x284
Xint0x80_syscall() at Xint0x80_syscall+0x21
--- syscall (378, FreeBSD ELF32, sys_nmount), eip = 0x280e073b, esp = 0xbfbfe40c                                             , ebp = 0xbfbfec08 ---
lock order reversal:
 1st 0xd8ebbbb4 bufwait (bufwait) @ /usr/src/sys/kern/vfs_bio.c:1911
 2nd 0xc57557a0 so_snd_sx (so_snd_sx) @ /usr/src/sys/kern/uipc_sockbuf.c:148
KDB: stack backtrace:
db_trace_self_wrapper(c0f17f11,72656b2f,69752f6e,735f6370,626b636f,...) at db_tr                                             ace_self_wrapper+0x26
kdb_backtrace(c0a5697b,c0f1b8c9,c45653d8,c4569130,e75b03dc,...) at kdb_backtrace                                             +0x2a
_witness_debugger(c0f1b8c9,c57557a0,c0f0c45e,c4569130,c0f1fc7a,...) at _witness_                                             debugger+0x25
witness_checkorder(c57557a0,9,c0f1fc7a,94,0,...) at witness_checkorder+0x839
_sx_xlock(c57557a0,40,c0f1fc7a,94,e75b0474,...) at _sx_xlock+0x85
sblock(c5755768,1,c0f08e46,3,c57618a0,...) at sblock+0x85
sosend_generic(c5755680,0,0,c5616e00,0,...) at sosend_generic+0xc2
sosend(c5755680,0,0,c5616e00,0,...) at sosend+0x3f
clnt_vc_call(c4bc0680,e75b05f8,10,c5157500,e75b0808,...) at clnt_vc_call+0x4af
clnt_reconnect_call(c4bc0640,e75b05f8,10,c5157500,e75b0808,...) at clnt_reconnec                                             t_call+0x670
newnfs_request(e75b0808,c8bb9000,0,c8bb9110,c66f7220,c57618a0,c5780c00,186a3,3,0                                             ,1,0) at newnfs_request+0xc65
nfscl_request(e75b0808,c66f7220,c57618a0,c5780c00,0,...) at nfscl_request+0x82
nfsrpc_readdir(c66f7220,e75b0994,e75b0950,c5780c00,c57618a0,...) at nfsrpc_readd                                             ir+0xce6
ncl_readdirrpc(c66f7220,e75b0994,c5780c00,c57618a0,c0f12487,...) at ncl_readdirr                                             pc+0xec
ncl_doio(c66f7220,d8ebbb54,c5780c00,c57618a0,0,...) at ncl_doio+0x2c0
ncl_bioread(c66f7220,e75b0bec,0,c5780c00,0,...) at ncl_bioread+0xc3d
nfs_readdir(e75b0c0c,0,c66f7220,0,e75b0c44,...) at nfs_readdir+0x192
VOP_READDIR_APV(c1038fc0,e75b0c0c,c0f24968,105c,e75b0c34,...) at VOP_READDIR_APV                                             +0xa5
kern_getdirentries(c57618a0,5,28420000,1000,e75b0c60,...) at kern_getdirentries+                                             0x234
sys_getdirentries(c57618a0,e75b0cec,c,c,246,...) at sys_getdirentries+0x31
syscall(e75b0d28) at syscall+0x284
Xint0x80_syscall() at Xint0x80_syscall+0x21
--- syscall (196, FreeBSD ELF32, sys_getdirentries), eip = 0x2814a0ff, esp = 0xb                                             fbfe4cc, ebp = 0xbfbfe4f8 ---
arquivos# dmesg
lock order reversal:
 1st 0xc85f0e28 ufs (ufs) @ /usr/src/sys/kern/vfs_mount.c:845
 2nd 0xc66f7278 newnfs (newnfs) @ /usr/src/sys/kern/vfs_subr.c:2167
KDB: stack backtrace:
db_trace_self_wrapper(c0f17f11,5f736676,72627573,323a632e,a373631,...) at db_trace_self_wrapper+0x26
kdb_backtrace(c0a5697b,c0f1b8c9,c4568f90,c4569610,e75e6824,...) at kdb_backtrace+0x2a
_witness_debugger(c0f1b8c9,c66f7278,c0f04697,c4569610,c0f23680,...) at _witness_debugger+0x25
witness_checkorder(c66f7278,9,c0f23680,877,0,...) at witness_checkorder+0x839
__lockmgr_args(c66f7278,80100,c66f7298,0,0,...) at __lockmgr_args+0x824
nfs_lock1(e75e6944,c0a67bdb,c0f2295e,80100,c66f7220,...) at nfs_lock1+0xc2
VOP_LOCK1_APV(c1038fc0,e75e6944,c8a7bc30,c1072ce0,c66f7220,...) at VOP_LOCK1_APV+0xb5
_vn_lock(c66f7220,80100,c0f23680,877,4,...) at _vn_lock+0x5e
vget(c66f7220,80100,c8a7bb80,50,0,...) at vget+0xb9
vfs_hash_get(c4a60798,ab0531c6,80000,c8a7bb80,e75e6a04,...) at vfs_hash_get+0xe6
ncl_nget(c4a60798,c8bb908c,1c,e75e6a30,80000,...) at ncl_nget+0xcf
nfs_root(c4a60798,80000,e75e6c18,356,c45c84d0,...) at nfs_root+0x42
vfs_donmount(c8a7bb80,0,0,c5594700,c5594700,...) at vfs_donmount+0xe9a
sys_nmount(c8a7bb80,e75e6cec,c0f61f16,c0f1ca1a,206,...) at sys_nmount+0x7f
syscall(e75e6d28) at syscall+0x284
Xint0x80_syscall() at Xint0x80_syscall+0x21
--- syscall (378, FreeBSD ELF32, sys_nmount), eip = 0x280e073b, esp = 0xbfbfe40c, ebp = 0xbfbfec08 ---
lock order reversal:
 1st 0xd8ebbbb4 bufwait (bufwait) @ /usr/src/sys/kern/vfs_bio.c:1911
 2nd 0xc57557a0 so_snd_sx (so_snd_sx) @ /usr/src/sys/kern/uipc_sockbuf.c:148
KDB: stack backtrace:
db_trace_self_wrapper(c0f17f11,72656b2f,69752f6e,735f6370,626b636f,...) at db_trace_self_wrapper+0x26
kdb_backtrace(c0a5697b,c0f1b8c9,c45653d8,c4569130,e75b03dc,...) at kdb_backtrace+0x2a
_witness_debugger(c0f1b8c9,c57557a0,c0f0c45e,c4569130,c0f1fc7a,...) at _witness_debugger+0x25
witness_checkorder(c57557a0,9,c0f1fc7a,94,0,...) at witness_checkorder+0x839
_sx_xlock(c57557a0,40,c0f1fc7a,94,e75b0474,...) at _sx_xlock+0x85
sblock(c5755768,1,c0f08e46,3,c57618a0,...) at sblock+0x85
sosend_generic(c5755680,0,0,c5616e00,0,...) at sosend_generic+0xc2
sosend(c5755680,0,0,c5616e00,0,...) at sosend+0x3f
clnt_vc_call(c4bc0680,e75b05f8,10,c5157500,e75b0808,...) at clnt_vc_call+0x4af
clnt_reconnect_call(c4bc0640,e75b05f8,10,c5157500,e75b0808,...) at clnt_reconnect_call+0x670
newnfs_request(e75b0808,c8bb9000,0,c8bb9110,c66f7220,c57618a0,c5780c00,186a3,3,0,1,0) at newnfs_request+0xc65
nfscl_request(e75b0808,c66f7220,c57618a0,c5780c00,0,...) at nfscl_request+0x82
nfsrpc_readdir(c66f7220,e75b0994,e75b0950,c5780c00,c57618a0,...) at nfsrpc_readdir+0xce6
ncl_readdirrpc(c66f7220,e75b0994,c5780c00,c57618a0,c0f12487,...) at ncl_readdirrpc+0xec
ncl_doio(c66f7220,d8ebbb54,c5780c00,c57618a0,0,...) at ncl_doio+0x2c0
ncl_bioread(c66f7220,e75b0bec,0,c5780c00,0,...) at ncl_bioread+0xc3d
nfs_readdir(e75b0c0c,0,c66f7220,0,e75b0c44,...) at nfs_readdir+0x192
VOP_READDIR_APV(c1038fc0,e75b0c0c,c0f24968,105c,e75b0c34,...) at VOP_READDIR_APV+0xa5
kern_getdirentries(c57618a0,5,28420000,1000,e75b0c60,...) at kern_getdirentries+0x234
sys_getdirentries(c57618a0,e75b0cec,c,c,246,...) at sys_getdirentries+0x31
syscall(e75b0d28) at syscall+0x284
Xint0x80_syscall() at Xint0x80_syscall+0x21
--- syscall (196, FreeBSD ELF32, sys_getdirentries), eip = 0x2814a0ff, esp = 0xbfbfe4cc, ebp = 0xbfbfe4f8 ---
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Remko Lodder <remko@elvandar.org>
To: =?iso-8859-1?Q?Guilherme_Ros=E1rio?= <guilherme.f.rosario@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: i386/165240: BUG 
Date: Fri, 17 Feb 2012 18:07:41 +0100

 --Apple-Mail=_0CFE938D-82F7-4243-AB5E-AE39276C8755
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=iso-8859-1
 
 
 On Feb 17, 2012, at 4:38 PM, Guilherme Ros=E1rio wrote:
 
 >=20
 
 Right, so the main question is: what is the bug and what are you trying =
 to tell?
 if this is a LOR this might be already documented and surely NOT the =
 right place to mention (i386)
 my guess is that if this is a new LOR this needs to be on -fs instead.
 
 
 --=20
 /"\   With kind regards,			| remko@elvandar.org
 \ /   Remko Lodder			| remko@FreeBSD.org
 X    FreeBSD					| =
 http://www.evilcoder.org
 / \   The Power to Serve		| Quis custodiet ipsos custodes
 
 --Apple-Mail=_0CFE938D-82F7-4243-AB5E-AE39276C8755--
Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Feb 27 01:15:59 UTC 2012 
Responsible-Changed-Why:  
reclassify. 

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