From owner-freebsd-current@FreeBSD.ORG Sat Jun 6 17:52:18 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED7F106566B for ; Sat, 6 Jun 2009 17:52:18 +0000 (UTC) (envelope-from yuri.pankov@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id EA4048FC0A for ; Sat, 6 Jun 2009 17:52:17 +0000 (UTC) (envelope-from yuri.pankov@gmail.com) Received: by bwz10 with SMTP id 10so90722bwz.43 for ; Sat, 06 Jun 2009 10:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received :x-authentication-warning:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=FToe4Wa3lzUqS3gncRmtZMQAbPJL3tBoztClSJ5P1Vs=; b=fsArY8wMNHV1/Wckmw/L8oqSxdW2qsDCgJEloKwVLWUXwxEYYnMoCLeIALiKd2aVRH 1hXVwXFog5VxkdDt3x1cFVTs72mGnv2GTj/IfUdt5EhzMwRRF73pa2VdyuTRvuwDNu8U KNUvbvgxqFMUXxSFNkOHuU0gw8VyKEHJTHVPs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-authentication-warning:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; b=xTv9s62+QRyF7QlTAjcadsY8LQT5DShlxM22ozhQzabOfz3GsYA6JdJjgR78EQFnMS k49tXJO3KWFahjugKhTnO5cBHDyFBsP8QP2Zpoms0jjlxH9ifNA8joJQ5+mj/JSp3r+6 wOpRzA00RknTiXm3CSCAekeN7TnYnm5ESS0N8= Received: by 10.204.60.72 with SMTP id o8mr4575487bkh.184.1244310736800; Sat, 06 Jun 2009 10:52:16 -0700 (PDT) Received: from darklight.homeunix.org ([85.175.193.190]) by mx.google.com with ESMTPS id z15sm1393308fkz.4.2009.06.06.10.52.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 06 Jun 2009 10:52:16 -0700 (PDT) Received: from darklight.homeunix.org (darklight.homeunix.org [127.0.0.1]) by darklight.homeunix.org (8.14.3/8.14.3) with ESMTP id n56HpwEp086627 for ; Sat, 6 Jun 2009 21:51:59 +0400 (MSD) (envelope-from yuri.pankov@gmail.com) Received: (from yuri@localhost) by darklight.homeunix.org (8.14.3/8.14.3/Submit) id n56HpwSS086626 for freebsd-current@freebsd.org; Sat, 6 Jun 2009 21:51:58 +0400 (MSD) (envelope-from yuri.pankov@gmail.com) X-Authentication-Warning: darklight.homeunix.org: yuri set sender to yuri.pankov@gmail.com using -f Date: Sat, 6 Jun 2009 21:51:58 +0400 From: Yuri Pankov To: freebsd-current@freebsd.org Message-ID: <20090606175158.GA1080@darklight.homeunix.org> References: <20090606021835.GC1077@darklight.homeunix.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline In-Reply-To: <20090606021835.GC1077@darklight.homeunix.org> User-Agent: Mutt/1.5.19 (2009-01-05) Subject: Re: loader panics with 2 GPT partitioned drives X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 06 Jun 2009 17:52:18 -0000 --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jun 06, 2009 at 06:18:35AM +0400, Yuri Pankov wrote: > Hi, > > I'm getting the following "panic" from loader when trying to attach > another GPT partitioned drive. loader is built using LOADER_ZFS_SUPPORT. > > BTX Loader 1.00 BTX version is 1.02 > Consoles: internal video/keyboard > BIOS drive C: is disk0 > BIOS drive D: is disk1 > > panic:free: guard1 fail @ 0x7fd4b3f4 from > /usr/src/sys/boot/i386/libi386/biosdisk.c:1048 > > > ad4: > => 34 488397101 ad4 GPT (233G) > 34 128 1 freebsd-boot (64K) > 162 16777216 2 freebsd-swap (8.0G) > 16777378 471619757 3 freebsd-zfs (225G) > > ad10: > empty disk, `gpart create -s GPT ad10` > > > > Yuri Looks like there are no checks in loader with GPT support if there are no partitions defined (very rare case, but still.. :-). Attached patch fixes booting with GPT disk without partitions (for me). Yuri --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="biosdisk.c.diff" Index: biosdisk.c =================================================================== --- biosdisk.c (revision 193589) +++ biosdisk.c (working copy) @@ -990,7 +990,8 @@ out: if (error) { - free(od->od_partitions); + if (od->od_nparts > 0) + free(od->od_partitions); od->od_flags &= ~BD_GPTOK; } return (error); @@ -1044,7 +1045,7 @@ delay(3000000); #endif #ifdef LOADER_GPT_SUPPORT - if (od->od_flags & BD_GPTOK) + if (od->od_flags & BD_GPTOK && od->od_nparts > 0) free(od->od_partitions); #endif free(od); --2fHTh5uZTiUOsy+g--