From owner-freebsd-current@FreeBSD.ORG Sat Mar 14 01:47:57 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 3292A106564A; Sat, 14 Mar 2009 01:47:57 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f164.google.com (mail-bw0-f164.google.com [209.85.218.164]) by mx1.freebsd.org (Postfix) with ESMTP id E6B658FC2C; Sat, 14 Mar 2009 01:47:55 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by bwz8 with SMTP id 8so2752558bwz.43 for ; Fri, 13 Mar 2009 18:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=iM0ddllXXApWWnA5x0nhnk02efXH7F/6pUfjQ018pf4=; b=SQeJmwtBn0dMU0cipbwIBwl50lO5uPDJkAQxvliA6a2I50ZZyyPPizUP5b5yh2eNQC h2uQw4lAXuHVKkM+SDVWMIyAL9ME3NBJyvyPJMNDT4h6RLQOIKyB4r9jKmy5/YSywMMB S3ey2E7H5QSVJjCHg3wZsiHi7ozsL1xZONq0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=klFm0Q1IRiio56Jl9eRR00AKIPbvcxRYdOIesJmMBrbgBAZuWLsEyy/rRCiaaJ6kUI /JGqko+DKA5d76fIQwcsouLPEJpAlcQW9B4NRh5kauhjvQgd1fqkimEISWtfZpUbymn4 V1Pkbc3+8X3DrE2X1FWSewYxPrJs+hvFbLMV8= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.117.14 with SMTP id o14mr816677faq.21.1236995274707; Fri, 13 Mar 2009 18:47:54 -0700 (PDT) In-Reply-To: <49BAA103.2060508@FreeBSD.org> 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> Date: Sat, 14 Mar 2009 02:47:54 +0100 X-Google-Sender-Auth: d4d3eadfda5d9450 Message-ID: <3bbf2fe10903131847q464a98a0rb24b172e6c16315b@mail.gmail.com> From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Pawel Jakub Dawidek , "freebsd-current@freebsd.org" , Tim Kientzle , Mark Powell , Anonymous , 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: Sat, 14 Mar 2009 01:47:57 -0000 2009/3/13, John Baldwin : > John Baldwin wrote: > > > Attilio Rao wrote: > > > > > 2009/3/13, John Baldwin : > > > > > > > This is similar to the patch I've asked lulf@ to test except that it > is longer and I fix a bug where zfs_lookup() can leak a vnode lock if the > access check fails. :-) The last one I sent to lulf@ is at > www.FreeBSD.org/~jhb/patches/zfs_ea.patch. > > > > > > > > > > I really thought zfs_lookup() was returning the lock held as a feature > assming no LOCKLEAF. Is that a bug instead? > > > > > > > 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_dir.c > > @@ -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. > > > > So lulf@ reports success with this patch. Pawel, can you review it? Yeah, I proposed to lulf this same patch yesterday, I just didn't wait for him to complete the test because I had to sleep, so I think this is the right fix. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein