Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Mar 2009 02:47:54 +0100
From:      Attilio Rao <attilio@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Pawel Jakub Dawidek <pjd@freebsd.org>, "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>, Tim Kientzle <kientzle@freebsd.org>, Mark Powell <M.S.Powell@salford.ac.uk>, Anonymous <swell.k@gmail.com>, Peter Schuller <peter.schuller@infidyne.com>
Subject:   Re: repeatable ZFS panic: share->excl
Message-ID:  <3bbf2fe10903131847q464a98a0rb24b172e6c16315b@mail.gmail.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
2009/3/13, John Baldwin <jhb@freebsd.org>:
> John Baldwin wrote:
>
> > Attilio Rao wrote:
> >
> > > 2009/3/13, John Baldwin <john@baldwin.cx>:
> > >
> > > > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe10903131847q464a98a0rb24b172e6c16315b>