Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MSG4k-0007Mm-1k for mharc-grub-devel@gnu.org; Sat, 18 Jul 2009 16:00:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MSG4i-0007Jk-6P for grub-devel@gnu.org; Sat, 18 Jul 2009 16:00:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MSG4d-0007H8-Ht for grub-devel@gnu.org; Sat, 18 Jul 2009 16:00:03 -0400 Received: from [199.232.76.173] (port=47367 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MSG4d-0007H5-BZ for grub-devel@gnu.org; Sat, 18 Jul 2009 15:59:59 -0400 Received: from mx20.gnu.org ([199.232.41.8]:47867) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MSG4c-0007Ox-Ss for grub-devel@gnu.org; Sat, 18 Jul 2009 15:59:59 -0400 Received: from mail-fx0-f215.google.com ([209.85.220.215]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MSG4c-00006N-6f for grub-devel@gnu.org; Sat, 18 Jul 2009 15:59:58 -0400 Received: by fxm11 with SMTP id 11so640444fxm.42 for ; Sat, 18 Jul 2009 12:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=nXyP0ripl4WNrkIoDJFg2QC8dfwvM3LWuVkg5rNJvwI=; b=h/AJLiLJImZrb5G+ntByEp2/1otJBcvOQHpx4t8aThm0lFTiFQ0CL/mUcYTjxPOTvA M3tQVMP9RbUv5zCiw8FEfQtmbT6f2BJ/N6fNz+tM8EfZXK58ZTuZCriHrQW0OQ9kyAXR fKab7hqylxsGJKSydBAb7xAVEGDXBY1hqb69k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=lavSTCrBT4IVdCmoJU8UHjbDlx4NNyUhFwkyDKxsW9q1uf+ZpgD/Wp4Au1ZrrA76TM 9WRSLZLHmpqzmDNCUBlnXh9vRayOzBpFaXlpNMwFlP7KNB2IHhWZdij9gBL6dtzdmD8O EWfwxYkulsX1j+dkAI9YsCvo8398IMJph247E= MIME-Version: 1.0 Received: by 10.204.61.137 with SMTP id t9mr2386023bkh.204.1247947195978; Sat, 18 Jul 2009 12:59:55 -0700 (PDT) In-Reply-To: References: <20090718191114.GK8867@thorin> Date: Sat, 18 Jul 2009 21:59:55 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: Re: [PATCH] Bug fix for LVM X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2009 20:00:04 -0000 On Sat, Jul 18, 2009 at 9:43 PM, Bean wrote: > On Sun, Jul 19, 2009 at 3:11 AM, Robert Millan wrote: >> On Sat, Jul 18, 2009 at 10:11:19PM +0800, Bean wrote: >>> =A0 =A0 =A0} >>> >>> =A0 =A0grub_raid_rescan (); >>> + =A0grub_lvm_fini (); >>> + =A0grub_lvm_init (); >> >> This is aside from this patch, but I don't see the purpose of this >> grub_raid_rescan() function. =A0It's in raid.mod but only used by >> grub-fstest, so at least it should be #ifdef'ed out, but looking at >> what it does, it seems very ad-hoc. =A0It basically amounts to the >> same you're doing with grub_lvm_fini() and grub_lvm_init(). =A0Could >> you fix this while at it? > > This is required. As raid and lvm scan device in init function, but > grub-fstest uses loopback device, which hasn't been setup in > grub_init_all. This code rescan raid and lvm, otherwise there won't be > available. > This situation isn't strictly speaking restricted to grub-fstest then. One would sensibly want to loopmount lvm image in grub shell. Is there a way to do it cleanly? >>> + =A0if (print =3D=3D PRINT_ABSTRACTION) >>> + =A0 =A0{ >>> + =A0 =A0 =A0char buf[30]; >> >> This is a buffer overflow waiting to happen. =A0Please use asprintf(), t= his >> will help you avoid the "&buf[1]" hack. >> >>> + =A0 =A0 =A0grub_disk_memberlist_t list =3D NULL, tmp; >>> + =A0 =A0 =A0int is_lvm =3D 0; >>> + =A0 =A0 =A0int is_raid =3D 0; >> >> I think you can add const qualifier in the is_lvm one. >> >>> + =A0 =A0 =A0is_lvm =3D (dev->disk->dev->id =3D=3D GRUB_DISK_DEVICE_LVM= _ID); >>> + =A0 =A0 =A0is_raid |=3D (dev->disk->dev->id =3D=3D GRUB_DISK_DEVICE_R= AID_ID); >> >> No need for logic OR here. > > Ok. > > -- > Bean > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git