From owner-freebsd-fs@FreeBSD.ORG Fri Apr 28 23:06:26 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org 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 D55C116A400 for ; Fri, 28 Apr 2006 23:06:26 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 261BB43D46 for ; Fri, 28 Apr 2006 23:06:26 +0000 (GMT) (envelope-from kabaev@gmail.com) Received: by wproxy.gmail.com with SMTP id 67so211920wri for ; Fri, 28 Apr 2006 16:06:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; b=kGuVIXe7FnWIeyIWL7GvrBP3azphHvhdmw3OkUtwTXGB/PmN8kYzy30mK+Ucx8zyeuUxt/0Lc3ATPu8RZ5yy84WAjve+bKe34UBIXFVnmh7uSpSEfqvHQp6WiKiWTDUbLRy9ldDwUffZXL9XXRsaGo9ymTlyQHcWd9T4m/tylGs= Received: by 10.54.132.6 with SMTP id f6mr1412617wrd; Fri, 28 Apr 2006 16:06:25 -0700 (PDT) Received: from kan.dnsalias.net ( [24.63.93.195]) by mx.gmail.com with ESMTP id 27sm2968345wrl.2006.04.28.16.06.24; Fri, 28 Apr 2006 16:06:24 -0700 (PDT) Date: Fri, 28 Apr 2006 19:06:13 -0400 From: Alexander Kabaev To: Alexander Kabaev Message-ID: <20060428190613.45f72f84@kan.dnsalias.net> In-Reply-To: <20060428185749.171da2bc@kan.dnsalias.net> References: <20060428130030.GC1270@deviant.kiev.zoral.com.ua> <20060428185749.171da2bc@kan.dnsalias.net> X-Mailer: Sylpheed-Claws 2.0.0 (GTK+ 2.8.16; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_.YN5kr1+mMa.icmu778WIth; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: freebsd-fs@freebsd.org Subject: Re: vn_lock & ffs_snapremove X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2006 23:06:27 -0000 --Sig_.YN5kr1+mMa.icmu778WIth Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Fri, 28 Apr 2006 18:57:49 -0400 Alexander Kabaev wrote: > On Fri, 28 Apr 2006 16:00:30 +0300 > Kostik Belousov wrote: >=20 > > Look at the two code fragments > >=20 > > 1. from vn_lock(9): > >=20 > > error =3D VOP_LOCK(vp, flags | LK_INTERLOCK, td); > > flags &=3D ~LK_INTERLOCK; > > KASSERT((flags & LK_RETRY) =3D=3D 0 || error =3D=3D 0, > > ("LK_RETRY set with incompatible flags %d\n", > > flags)); /* > > * Callers specify LK_RETRY if they wish to get dead > > vnodes. > > * If RETRY is not set, we return ENOENT instead. > > */ > > if (error =3D=3D 0 && vp->v_iflag & VI_DOOMED && > > (flags & LK_RETRY) =3D=3D 0) { > > VOP_UNLOCK(vp, 0, td); > > error =3D ENOENT; > > break; > > } > >=20 > > 2. ffs_snapremove(9): > >=20 > > (vp->v_vnlock for snapshot vnode vp points to sn_snlock) > > lkp =3D vp->v_vnlock; > > vp->v_vnlock =3D &vp->v_lock; > >=20 > > Is there anything that would prevent these two fragments to > > intervene ? Esp. bad looks the situation where VOP_LOCK() from > > vn_lock executed and locked doomed snapshot vnode, after that > > ffs_snapremove replaces vnode lock and VOP_UNLOCK attempted on > > _another_ lock. > >=20 > > If this scenario can happen (as it seems), then, probably, > > some measures like transferlockers(9) are needed ? > > _______________________________________________ > > 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" >=20 > =F0=D2=C9=D7=C5=D4, >=20 > =D4=D5=D4 =D7=CF=DA=CE=C9=CB=CC=CF =D0=D2=C5=C4=CC=CF=D6=C5=CE=C9=C5 =CE= =C1=CB=C1=DA=C1=D4=D8 =D4=C5=C2=D1 commit bit-=CF=CD. =E9=CE=D4=C5=D2=C5=D3= =D5=C5=D4 > =CD=CE=C5=CE=C9=C5 =D3=C1=CD=CF=C7=CF =CE=C1=CB=C1=DA=D5=C5=CD=CF=C7=CF = =CE=C1 =DC=D4=CF =D0=D2=C5=C4=CC=CF=D6=C5=CE=C9=C5 :) >=20 > --=20 > Alexander Kabaev Sorry for wide distribution. Throw stones in my direction, please. --=20 Alexander Kabaev --Sig_.YN5kr1+mMa.icmu778WIth Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQFEUp/vQ6z1jMm+XZYRAmeKAJsF6QubAgB9sdO4Sd37hIuktXYjtgCgp/zz pbUDz2A1hjBSaa9nE6yrzEk= =9REo -----END PGP SIGNATURE----- --Sig_.YN5kr1+mMa.icmu778WIth--