From owner-freebsd-current@FreeBSD.ORG Wed May 7 12:41:57 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E2B337B401; Wed, 7 May 2003 12:41:57 -0700 (PDT) Received: from arthur.nitro.dk (port324.ds1-khk.adsl.cybercity.dk [212.242.113.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 539A143F93; Wed, 7 May 2003 12:41:56 -0700 (PDT) (envelope-from simon@arthur.nitro.dk) Received: by arthur.nitro.dk (Postfix, from userid 1000) id E1AF110BF81; Wed, 7 May 2003 21:41:46 +0200 (CEST) Date: Wed, 7 May 2003 21:41:46 +0200 From: "Simon L. Nielsen" To: John Baldwin Message-ID: <20030507194145.GB910@nitro.dk> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: current@FreeBSD.ORG cc: sos@FreeBSD.ORG Subject: Re: panic: mutex Giant not owned at /usr/src/sys/kern/kern_exit.cwhen ata RAID1 rebuild has completed X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 07 May 2003 19:41:57 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2003.05.07 14:38:24 -0400, John Baldwin wrote: > > Index: ata-raid.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > 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 > > @@ -969,6 +969,7 @@ > > int disk, s, count =3D 0, error =3D 0; > > caddr_t buffer; > > =20 > > + mtx_lock(&Giant); > > if ((rdp->flags & (AR_F_READY|AR_F_DEGRADED)) !=3D (AR_F_READY|AR_= F_DEGRADED)) > > kthread_exit(EEXIST); > > =20 > >=20 > > ? > >=20 > > 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. >=20 > 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=F8ren. --=20 Simon L. Nielsen --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+uWF58kocFXgPTRwRAioxAKCuf3cemhA9BLEuMbMrPE6nUElP+ACcCPp6 FrKTMRFvjIBYFMwY5gB3PRM= =2/aB -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--