Re: panic: mutex Giant not owned at /usr/src/sys/kern/kern_exit.cwhen ata RAID1 rebuild has completed

From: Simon L. Nielsen <simon_at_nitro.dk>
Date: Wed, 7 May 2003 21:41:46 +0200
On 2003.05.07 14:38:24 -0400, John Baldwin wrote:

> > Index: ata-raid.c
> > ===================================================================
> > RCS file: /usr/cvs/src/sys/dev/ata/ata-raid.c,v
> > retrieving revision 1.64
> > diff -u -r1.64 ata-raid.c
> > --- ata-raid.c  4 May 2003 16:17:54 -0000       1.64
> > +++ ata-raid.c  5 May 2003 18:15:35 -0000
> > _at__at_ -969,6 +969,7 _at__at_
> >      int disk, s, count = 0, error = 0;
> >      caddr_t buffer;
> >  
> > +    mtx_lock(&Giant);
> >      if ((rdp->flags & (AR_F_READY|AR_F_DEGRADED)) != (AR_F_READY|AR_F_DEGRADED))
> >         kthread_exit(EEXIST);
> >  
> > 
> > ?
> > 
> > The rebuild kthread doesn't automatically grab Giant.
> > If the rebuild thread doesn't need Giant, then you can
> > push down Giant to all the kthread_exit() calls.
> 
> Ishizuka-san, can you test this patch?

I had the same problem which was solved with a similiar patch the only
difference being that I just aquired Giant before each of the calls to
kthread_exit since I didn't know if it was safe to hold Giant the entire
time the rebuild thread is running.  I did send the patch to Søren.

-- 
Simon L. Nielsen

Received on Wed May 07 2003 - 10:41:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:06 UTC