From owner-freebsd-fs@FreeBSD.ORG Mon Dec 6 20:56:29 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC3F316A4CE for ; Mon, 6 Dec 2004 20:56:29 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 934C043D54; Mon, 6 Dec 2004 20:56:29 +0000 (GMT) (envelope-from kan@FreeBSD.org) Received: from freefall.freebsd.org (kan@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iB6KuTVK003680; Mon, 6 Dec 2004 20:56:29 GMT (envelope-from kan@freefall.freebsd.org) Received: (from kan@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iB6KuS20003679; Mon, 6 Dec 2004 20:56:28 GMT (envelope-from kan) Date: Mon, 6 Dec 2004 20:56:28 +0000 From: Alexander Kabaev To: Thomas Nystrom Message-ID: <20041206205628.GA3309@freefall.freebsd.org> References: <41B0C899.C005AE1E@saeab.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41B0C899.C005AE1E@saeab.se> User-Agent: Mutt/1.4.2.1i cc: freebsd-fs@freebsd.org Subject: Re: Dead vnode locking against itself X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2004 20:56:29 -0000 On Fri, Dec 03, 2004 at 09:12:09PM +0100, Thomas Nystrom wrote: > > If I look at the source I can see that in sys/kern/vfs_subr.c:2696 > (in vgonel) the vnode is locked by VI_XLOCK. Later on (via vclean) > dead_lock is called and founds that the vnode is locked. It then > waits for it to be unlocked and the results is a hanged process. > > What have I missed or have I found a bug? > > /thn > I wonder why vclean was called on a vnode with dead_vnodeops in the first place. Could you please post an output of 'print *vp' for the vnode being cleaned? -- Alexander Kabaev From owner-freebsd-fs@FreeBSD.ORG Mon Dec 6 22:07:00 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D79916A4CE; Mon, 6 Dec 2004 22:07:00 +0000 (GMT) Received: from mailfe10.swip.net (mailfe10.swip.net [212.247.155.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72A1043D48; Mon, 6 Dec 2004 22:06:58 +0000 (GMT) (envelope-from thn@saeab.se) X-T2-Posting-ID: v8Qc5gTTFq+hMtTEBMvVyQ== Received: from [213.100.91.82] (HELO scatcat.thn.saeab.se) by mailfe10.swip.net (CommuniGate Pro SMTP 4.2.6) with ESMTP id 32434528; Mon, 06 Dec 2004 23:06:25 +0100 Received: from saeab.se (home [10.1.0.1])iB6M6ouA020940; Mon, 6 Dec 2004 23:06:50 +0100 (CET) (envelope-from thn@saeab.se) Message-ID: <41B4D832.2D886E86@saeab.se> Date: Mon, 06 Dec 2004 23:07:46 +0100 From: Thomas Nystrom Organization: Sv. Aktuell Elektronik AB X-Mailer: Mozilla 4.78 [en] (Win98; U) X-Accept-Language: sv,en MIME-Version: 1.0 To: Alexander Kabaev References: <41B0C899.C005AE1E@saeab.se> <20041206205628.GA3309@freefall.freebsd.org> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit cc: freebsd-fs@FreeBSD.org Subject: Re: Dead vnode locking against itself X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2004 22:07:00 -0000 Alexander Kabaev wrote: > > On Fri, Dec 03, 2004 at 09:12:09PM +0100, Thomas Nystrom wrote: > > > > If I look at the source I can see that in sys/kern/vfs_subr.c:2696 > > (in vgonel) the vnode is locked by VI_XLOCK. Later on (via vclean) > > dead_lock is called and founds that the vnode is locked. It then > > waits for it to be unlocked and the results is a hanged process. > > > > What have I missed or have I found a bug? > > > > /thn > > > I wonder why vclean was called on a vnode with dead_vnodeops in the > first place. I think that is because the vnode is returned to the free list by arla vith a call to vgonel(). That would run vclean() on the vnode and setting it to deadfs. When the vnode then is tried to be recycled vgonel() is called once more on the same vnode. Vgonel() sets the VI_XLOCK on the node, calls vclean(), which calls dead_lock() and finally chkvnlock() which finds VI_XLOCK set and tries to wait for it to be released. Since my first posting I have changed the loop in chkvnlock() to: while ((vp->v_iflag & VI_XLOCK) && (vp->v_vxthread != curthread)) { vp->v_iflag |= VI_XWANT; (void) msleep((caddr_t)vp, VI_MTX(vp), PINOD, "ckvnlk", 0); locked = 1; } That seems to fix the lockup problem. There are still problems in arla but that is another problem. > Could you please post an output of 'print *vp' for > the vnode being cleaned? (kgdb) print *vp $1 = {v_interlock = {mtx_object = {lo_class = 0xc066f25c, lo_name = 0xc06471bc "vnode interlock", lo_type = 0xc06471bc "vnode interlock", lo_flags = 196608, lo_list = { tqe_next = 0xc239d318, tqe_prev = 0xc2399328}, lo_witness = 0x0}, mtx_lock = 3250837056, mtx_recurse = 0}, v_iflag = 129, v_usecount = 0, v_numoutput = 0, v_vxthread = 0xc1c3d640, v_holdcnt = 0, v_cleanblkhd = { tqh_first = 0x0, tqh_last = 0xc239d458}, v_cleanblkroot = 0x0, v_cleanbufcnt = 0, v_dirtyblkhd = {tqh_first = 0x0, tqh_last = 0xc239d468}, v_dirtyblkroot = 0x0, v_dirtybufcnt = 0, v_vflag = 0, v_writecount = 0, v_object = 0x0, v_lastw = 0, v_cstart = 0, v_lasta = 0, v_clen = 0, v_un = { vu_mountedhere = 0x0, vu_socket = 0x0, vu_spec = {vu_cdev = 0x0, vu_specnext = { sle_next = 0x0}}, vu_fifoinfo = 0x0}, v_freelist = {tqe_next = 0x0, tqe_prev = 0xc1e063a0}, v_nmntvnodes = {tqe_next = 0xc241da50, tqe_prev = 0xc21c9cf0}, v_synclist = {le_next = 0x0, le_prev = 0x0}, v_type = VDIR, v_tag = 0xc063729d "none", v_data = 0x0, v_lock = { lk_interlock = 0xc0697808, lk_flags = 16777216, lk_sharecount = 0, lk_waitcount = 0, lk_exclusivecount = 0, lk_prio = 80, lk_wmesg = 0xc1d892b5 "afs", lk_timo = 6, lk_lockholder = 0xffffffff, lk_newlock = 0x0}, v_vnlock = 0xc239d4cc, v_op = 0xc1928800, v_mount = 0x0, v_cache_src = {lh_first = 0x0}, v_cache_dst = {tqh_first = 0x0, tqh_last = 0xc239d500}, v_id = 88207, v_dd = 0xc2488b58, v_ddid = 87557, v_pollinfo = 0x0, v_label = 0x0, v_cachedfs = 4294967295, v_cachedid = 389548441, v_bsize = 512} -- --------------------------------------------------------------- Svensk Aktuell Elektronik AB Thomas Nyström Box 10 Phone: +46 8 35 92 85 S-191 21 Sollentuna Fax: +46 8 35 92 86 Sweden Email: thn@saeab.se --------------------------------------------------------------- From owner-freebsd-fs@FreeBSD.ORG Mon Dec 6 23:13:48 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 542A916A4CE for ; Mon, 6 Dec 2004 23:13:48 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FE2D43D1F; Mon, 6 Dec 2004 23:13:48 +0000 (GMT) (envelope-from kan@FreeBSD.org) Received: from freefall.freebsd.org (kan@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iB6NDmOu023213; Mon, 6 Dec 2004 23:13:48 GMT (envelope-from kan@freefall.freebsd.org) Received: (from kan@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iB6NDlAs023212; Mon, 6 Dec 2004 23:13:47 GMT (envelope-from kan) Date: Mon, 6 Dec 2004 23:13:47 +0000 From: Alexander Kabaev To: Thomas Nystrom Message-ID: <20041206231347.GA18156@freefall.freebsd.org> References: <41B0C899.C005AE1E@saeab.se> <20041206205628.GA3309@freefall.freebsd.org> <41B4D832.2D886E86@saeab.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41B4D832.2D886E86@saeab.se> User-Agent: Mutt/1.4.2.1i cc: freebsd-fs@FreeBSD.org Subject: Re: Dead vnode locking against itself X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2004 23:13:48 -0000 On Mon, Dec 06, 2004 at 11:07:46PM +0100, Thomas Nystrom wrote: > Alexander Kabaev wrote: > > > > On Fri, Dec 03, 2004 at 09:12:09PM +0100, Thomas Nystrom wrote: > > > > > > If I look at the source I can see that in sys/kern/vfs_subr.c:2696 > > > (in vgonel) the vnode is locked by VI_XLOCK. Later on (via vclean) > > > dead_lock is called and founds that the vnode is locked. It then > > > waits for it to be unlocked and the results is a hanged process. > > > > > > What have I missed or have I found a bug? > > > > > > /thn > > > > > I wonder why vclean was called on a vnode with dead_vnodeops in the > > first place. > > I think that is because the vnode is returned to the free list by arla vith > a call to vgonel(). That would run vclean() on the vnode and setting it to > deadfs. When the vnode then is tried to be recycled vgonel() is called once > more on the same vnode. Vgonel() sets the VI_XLOCK on the node, calls vclean(), > which calls dead_lock() and finally chkvnlock() which finds VI_XLOCK set and > tries to wait for it to be released. Unless I am reading sources wrong, the scenario you describe should not happen. vgonel resets the vnode type to VBAD just before releasing vnode locks for the last time and vtryrecycle avoids calling vgonel on vnodes with that type: if (vp->v_type != VBAD) { VOP_UNLOCK(vp, 0, td); vgonel(vp, td); VI_LOCK(vp); } else VOP_UNLOCK(vp, 0, td); The vnode data below shows that vnode has a type of VDIR and evidently its v_op is set to dead_vnodeops. At the same time, v_tag is "none", which suggests that vnode has been processed by vclean already, but vgonel had not yet have a chance to update vnode's type. Just out of curiosity, can you try your code with VI_UNLOCK(vp);/VI_LOCK(vp); pair removed from the vgonel function around line 294? This is the only place where vnode interlock is released after vclean completes and before vgonel sets the vnode type. There is no point in unlocking the interlock just to lock it again immediately anyway. > Since my first posting I have changed the loop in chkvnlock() to: > > while ((vp->v_iflag & VI_XLOCK) && (vp->v_vxthread != curthread)) { > vp->v_iflag |= VI_XWANT; > (void) msleep((caddr_t)vp, VI_MTX(vp), PINOD, "ckvnlk", 0); > locked = 1; > } > > That seems to fix the lockup problem. There are still problems in arla > but that is another problem. > > > Could you please post an output of 'print *vp' for > > the vnode being cleaned? > > (kgdb) print *vp > $1 = {v_interlock = {mtx_object = {lo_class = 0xc066f25c, > lo_name = 0xc06471bc "vnode interlock", > lo_type = 0xc06471bc "vnode interlock", lo_flags = 196608, lo_list = { > tqe_next = 0xc239d318, tqe_prev = 0xc2399328}, lo_witness = 0x0}, > mtx_lock = 3250837056, mtx_recurse = 0}, v_iflag = 129, v_usecount = 0, > v_numoutput = 0, v_vxthread = 0xc1c3d640, v_holdcnt = 0, v_cleanblkhd = { > tqh_first = 0x0, tqh_last = 0xc239d458}, v_cleanblkroot = 0x0, > v_cleanbufcnt = 0, v_dirtyblkhd = {tqh_first = 0x0, tqh_last = 0xc239d468}, > v_dirtyblkroot = 0x0, v_dirtybufcnt = 0, v_vflag = 0, v_writecount = 0, > v_object = 0x0, v_lastw = 0, v_cstart = 0, v_lasta = 0, v_clen = 0, v_un = { > vu_mountedhere = 0x0, vu_socket = 0x0, vu_spec = {vu_cdev = 0x0, vu_specnext = { > sle_next = 0x0}}, vu_fifoinfo = 0x0}, v_freelist = {tqe_next = 0x0, > tqe_prev = 0xc1e063a0}, v_nmntvnodes = {tqe_next = 0xc241da50, > tqe_prev = 0xc21c9cf0}, v_synclist = {le_next = 0x0, le_prev = 0x0}, > v_type = VDIR, v_tag = 0xc063729d "none", v_data = 0x0, v_lock = { > lk_interlock = 0xc0697808, lk_flags = 16777216, lk_sharecount = 0, > lk_waitcount = 0, lk_exclusivecount = 0, lk_prio = 80, > lk_wmesg = 0xc1d892b5 "afs", lk_timo = 6, lk_lockholder = 0xffffffff, > lk_newlock = 0x0}, v_vnlock = 0xc239d4cc, v_op = 0xc1928800, v_mount = 0x0, > v_cache_src = {lh_first = 0x0}, v_cache_dst = {tqh_first = 0x0, > tqh_last = 0xc239d500}, v_id = 88207, v_dd = 0xc2488b58, v_ddid = 87557, > v_pollinfo = 0x0, v_label = 0x0, v_cachedfs = 4294967295, v_cachedid = 389548441, > v_bsize = 512} > > > -- > --------------------------------------------------------------- > Svensk Aktuell Elektronik AB Thomas Nystr?m > Box 10 Phone: +46 8 35 92 85 > S-191 21 Sollentuna Fax: +46 8 35 92 86 > Sweden Email: thn@saeab.se > --------------------------------------------------------------- > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" From owner-freebsd-fs@FreeBSD.ORG Tue Dec 7 11:36:23 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38B7816A4D0; Tue, 7 Dec 2004 11:36:23 +0000 (GMT) Received: from saeab.se (ture.saeab.se [213.80.3.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC13E43D60; Tue, 7 Dec 2004 11:36:21 +0000 (GMT) (envelope-from thn@saeab.se) Received: from [10.0.1.32] (omar.int.saeab.se [10.0.1.32]) by saeab.se (8.13.1/8.13.1) with ESMTP id iB7BaFgM046345; Tue, 7 Dec 2004 12:36:15 +0100 (CET) (envelope-from thn@saeab.se) Message-ID: <41B595AF.7050602@saeab.se> Date: Tue, 07 Dec 2004 12:36:15 +0100 From: Thomas Nystrom Organization: Sv. Aktuell Elektronik AB User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: sv,en MIME-Version: 1.0 To: Alexander Kabaev References: <41B0C899.C005AE1E@saeab.se> <20041206205628.GA3309@freefall.freebsd.org> <41B4D832.2D886E86@saeab.se> <20041206231347.GA18156@freefall.freebsd.org> In-Reply-To: <20041206231347.GA18156@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on ture.saeab.se X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (saeab.se [213.80.3.133]); Tue, 07 Dec 2004 12:36:20 +0100 (CET) cc: freebsd-fs@FreeBSD.org Subject: Re: Dead vnode locking against itself X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2004 11:36:23 -0000 Alexander Kabaev wrote: >=20 > Unless I am reading sources wrong, the scenario you describe should not= > happen. vgonel resets the vnode type to VBAD just before releasing vnod= e > locks for the last time and vtryrecycle avoids calling vgonel on vnodes= > with that type: >=20 > if (vp->v_type !=3D VBAD) { > VOP_UNLOCK(vp, 0, td); =20 > vgonel(vp, td); > VI_LOCK(vp); > } else > VOP_UNLOCK(vp, 0, td); >=20 > The vnode data below shows that vnode has a type of VDIR and evidently = its > v_op is set to dead_vnodeops. At the same time, v_tag is "none", which > suggests that vnode has been processed by vclean already, but vgonel ha= d > not yet have a chance to update vnode's type. Just out of curiosity, ca= n you > try your code with VI_UNLOCK(vp);/VI_LOCK(vp); pair removed from the > vgonel function around line 294? This is the only place where vnode int= erlock > is released after vclean completes and before vgonel sets the vnode typ= e. > There is no point in unlocking the interlock just to lock it again > immediately anyway. Ok, I missed that VBAD setting. Then I assume that it is arla that is=20 playing around with nodes after it has released via vgonel(). I have=20 seen other indications of that..... /thn --=20 --------------------------------------------------------------- Svensk Aktuell Elektronik AB Thomas Nystr=F6m Box 10 Phone: +46 8 35 92 85 S-191 21 Sollentuna Fax: +46 8 35 92 86 Sweden Email: thn@saeab.se --------------------------------------------------------------- From owner-freebsd-fs@FreeBSD.ORG Thu Dec 9 22:20:35 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 365D716A521 for ; Thu, 9 Dec 2004 22:20:35 +0000 (GMT) Received: from mail.agala.net (I9fb0.i.pppool.de [85.73.159.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A03B43D1F for ; Thu, 9 Dec 2004 22:20:33 +0000 (GMT) (envelope-from frank@barda.agala.net) Received: from mail.agala.net (mail.agala.net [192.168.20.1]) by mail.agala.net (8.13.1/8.13.1) with ESMTP id iB9MIX1s046086 for ; Thu, 9 Dec 2004 23:18:34 +0100 (CET) (envelope-from frank@barda.agala.net) From: "Frank J. Beckmann" Organization: agala naga doron To: freebsd-fs@freebsd.org Date: Thu, 9 Dec 2004 23:18:18 +0100 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200412092318.22325.frank@barda.agala.net> X-Scanned-By: MIMEDefang 2.44 Subject: How to enable ACLs on /? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2004 22:20:35 -0000 Hi, maybe it ist a faq, but I didn't find it in the list archive. How do I enab= le=20 ACLs on / in FreeBSD 5.3? I tried to boot into single user mode and did=20 tunefs -a enable /dev/ad4s2a and ACLs are enabled. But they are not enabled= =20 anymore as soon as I mount /. But as long as / is not mounted, the ACLs sho= w=20 to be enabled. =2D-=20 Tsch=FCss =46rank