From owner-freebsd-current@FreeBSD.ORG Tue Mar 17 07:04:09 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA2601065675; Tue, 17 Mar 2009 07:04:09 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206045082.chello.pl [87.206.45.82]) by mx1.freebsd.org (Postfix) with ESMTP id ED8478FC14; Tue, 17 Mar 2009 07:04:07 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id DFB5D45C98; Tue, 17 Mar 2009 08:04:06 +0100 (CET) Received: from localhost (chello087206045082.chello.pl [87.206.45.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 7129745B36; Tue, 17 Mar 2009 08:04:01 +0100 (CET) Date: Tue, 17 Mar 2009 08:04:40 +0100 From: Pawel Jakub Dawidek To: John Baldwin Message-ID: <20090317070440.GE2012@garage.freebsd.pl> References: <20090312175345.Y80227@rust.salford.ac.uk> <20090312191333.GA97342@hyperion.scode.org> <49B97617.8010709@freebsd.org> <86r6124f2v.fsf@gmail.com> <3bbf2fe10903122035i20b2767cod2322c39c6f850ee@mail.gmail.com> <29C8FA04-D5B1-49B7-ACF0-4185537367B0@baldwin.cx> <3bbf2fe10903122156u650417f0s5c49b68bdf4ffa07@mail.gmail.com> <49BA9801.5080505@FreeBSD.org> <49BAA103.2060508@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M38YqGLZlgb6RLPS" Content-Disposition: inline In-Reply-To: <49BAA103.2060508@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: Attilio Rao , Tim Kientzle , Mark Powell , Anonymous , "freebsd-current@freebsd.org" , Peter Schuller Subject: Re: repeatable ZFS panic: share->excl X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2009 07:04:10 -0000 --M38YqGLZlgb6RLPS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 13, 2009 at 02:08:03PM -0400, John Baldwin wrote: > John Baldwin wrote: > >Yes, I think that is the real bug. Looking at this further I think > >zfs_get_xattrdir() will return the vnode locked if it has to create a > >new node via zfs_make_attrdir() but only returns it held and unlocked if > >it finds an existing one. So my new patch is to just fix > >zfs_get_xattrdir() to unlock the vnode if it creates a new one like so: > > > >(Sorry, TBird is probably going to butcher all the whitespace): > > > >--- > >//depot/user/jhb/lock/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir= .c > >+++ > >/Users/jhb/work/p4/lock/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_d= ir.c=20 > > > >@@ -940,6 +940,7 @@ > > /* NB: we already did dmu_tx_wait() if necessary */ > > goto top; > > } > >+ VOP_UNLOCK(*xvpp, 0); > > > > return (error); > > } > > > >A non-butchered version is at www.FreeBSD.org/~jhb/patches/zfs_ea.patch. >=20 > So lulf@ reports success with this patch. Pawel, can you review it? Yes, it works for me too and looks good. The only thing we need to change is to check for error beeing 0 before unlocking the vnode. The zfs_make_xattrdir() function can still return with EIO, so I'd add something like this: if (error =3D=3D 0) VOP_UNLOCK(*xvpp, 0); Thank you John for spending time on tracking this one down. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --M38YqGLZlgb6RLPS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFJv0uHForvXbEpPzQRAhlpAJ4qJTXetJNyhAOtDvdHD7aGUEGh7gCguoRG uEwHGOxaS6Y1tQVSOEj0fdg= =LRHI -----END PGP SIGNATURE----- --M38YqGLZlgb6RLPS--