From owner-freebsd-current@FreeBSD.ORG Wed May 7 10:04:00 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 425D937B401 for ; Wed, 7 May 2003 10:04:00 -0700 (PDT) Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F24643FBD for ; Wed, 7 May 2003 10:03:59 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 31584 invoked from network); 7 May 2003 17:04:02 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 7 May 2003 17:04:02 -0000 Received: from laptop.baldwin.cx ([216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h47H3up0005315; Wed, 7 May 2003 13:03:56 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200305070831.h478V90G066558@spider.deepcore.dk> Date: Wed, 07 May 2003 13:04:04 -0400 (EDT) From: John Baldwin To: Soeren Schmidt 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 17:04:00 -0000 On 07-May-2003 Soeren Schmidt wrote: > It seems Masachika ISHIZUKA wrote: >> Hi, this is ishizuka@ish.org. >> >> I installed 5.1-BETA-20030507-JPSNAP from current.freebsd.org. >> I did 'atacontrol rebuild 0' for ata raid ar0 for non-real raid >> ata controller (ICH4 in 845GE) with GENERIC kernel and panic when >> the RAID1 mirror rebuilding had just completed as follows. >> >> panic: mutex Giant not owned at /usr/src/sys/kern/kern_exit.c: 122 > > I know of the problem, but I havn't found a good way to fix it yet. 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 @@ -969,6 +969,7 @@ 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. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/