Date: Thu, 29 Sep 2005 10:01:18 +0300 From: Alex Lyashkov <umka@sevcity.net> To: Peter Edwards <peadar.edwards@gmail.com> Cc: freebsd-current@freebsd.org Subject: Re: biodone panics Message-ID: <1127977278.3383.7.camel@berloga.shadowland> In-Reply-To: <34cb7c8405092815247dc89bf6@mail.gmail.com> References: <34cb7c8405092815247dc89bf6@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>
> the call to wakeup may set in motion some events that cause the bio to
> be freed. By the time the mtx_unlock completes, "bp" could point to an
> invalid bio, and the "if (bp->bio_done != NULL)" is bogus. True?
> Shouldn't it be
>
> > biodone(struct bio *bp)
> > {
> > void (*done)(struct bio *);
> >
> > mtx_lock(&bdonelock);
> > bp->bio_flags |= BIO_DONE;
> > done = bp->bio_done
> > if (done == NULL)
> > wakeup(bp);
> > mtx_unlock(&bdonelock);
> > if (done != NULL)
> > bp->bio_done(bp);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
posible
if( done != NULL )
done(bp);
?
> > }
>
> Anyone agree?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1127977278.3383.7.camel>
