From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Nxq1x-0007lw-R5 for mharc-grub-devel@gnu.org; Fri, 02 Apr 2010 19:12:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nxq1w-0007ll-AZ for grub-devel@gnu.org; Fri, 02 Apr 2010 19:12:00 -0400 Received: from [140.186.70.92] (port=43067 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nxq1u-0007ld-0D for grub-devel@gnu.org; Fri, 02 Apr 2010 19:11:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nxq1r-0004W2-Sv for grub-devel@gnu.org; Fri, 02 Apr 2010 19:11:57 -0400 Received: from mail-bw0-f217.google.com ([209.85.218.217]:59653) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nxq1r-0004Vw-L0 for grub-devel@gnu.org; Fri, 02 Apr 2010 19:11:55 -0400 Received: by bwz9 with SMTP id 9so1739661bwz.9 for ; Fri, 02 Apr 2010 16:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=iiJ9C1/aPghxlRPj/RpeUTPz9wlM/wiNLeozWpjua2g=; b=IuNlMmojhzDnpC/xMEc0Xm6WvzcPoKEbS2XAn/86Dsa8NwElwCbA3rIHDAcyk0M+qI oOmrIl7XoAE9omiXbdeP0BhgLdoTco4aavN/aXeZjooJfr+fAZn0aFwiUewE8C7OKofP znDpA8oKFGp5VscYW/J1BzvJEXKnnpFj/stlM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=DiHe+0ZXGYNOKVVDx7Gsy3ood16FrKK7OEEotAVT3+8ZMaZ9jey++q6iFXZPy/YpyE FPFT7jhIiFMJSWRgEQwWclOGE0RTtF+lvuU3O3ckLlHl5O0h2Ibh4pw21juP4nQadjiT LKNI+bgtgycAdzFJ+6AQuL9Urh1/5TlWO0pg0= Received: by 10.204.34.3 with SMTP id j3mr3790207bkd.23.1270249914116; Fri, 02 Apr 2010 16:11:54 -0700 (PDT) Received: from debian.bg45.phnet (222-14.77-83.cust.bluewin.ch [83.77.14.222]) by mx.google.com with ESMTPS id 16sm4728667bwz.5.2010.04.02.16.11.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 02 Apr 2010 16:11:52 -0700 (PDT) Message-ID: <4BB679B0.1070402@gmail.com> Date: Sat, 03 Apr 2010 01:11:44 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <20100322142923.GD20777@riva.ucam.org> In-Reply-To: <20100322142923.GD20777@riva.ucam.org> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigF72491148AEE71E73E686A42" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] Fix LVM/RAID probing without device.map X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 23:12:00 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF72491148AEE71E73E686A42 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable util/deviceiter.c is missing from your patch. > @@ -136,6 +138,22 @@ probe (const char *path, char *device_na > goto end; > } > =20 > + if (stat (dev_map, &dev_map_stat) =3D=3D -1 && > + grub_util_get_dev_abstraction (device_name) !=3D GRUB_DEV_ABSTRA= CTION_NONE) > =20 Looks like it may call stat with NULL argument. I would rather avoid doing this than rely on stat to detect it cleanly and not just segfault > + { > + /* If we don't have a device map, then we won't yet know about t= he > + physical volumes underlying this device, so probe all devices= =2E */ > + grub_util_iterate_devices (grub_util_biosdisk_probe_device, 0); > + > + /* Now reinitialise the higher layers. */ > + grub_lvm_fini (); > + grub_mdraid_fini (); > + grub_raid_fini (); > + grub_raid_init (); > + grub_mdraid_init (); > + grub_lvm_init (); > =20 Can we not to initialise those levels before they should be inited rather than reinit? If it requires unclean workarounds I would rather prefer this since it's relatively clean (approx rmmod+insmod) > +int > +grub_util_biosdisk_probe_device (const char *name, int is_floppy) > +{ > + char *grub_disk; > + > + if (is_floppy) > + grub_disk =3D xasprintf ("fd%d", num_fd++); > + else > + grub_disk =3D xasprintf ("hd%d", num_hd++); > + > =20 You can also choose something more straightforward for name generation. Like just use 'name'. --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigF72491148AEE71E73E686A42 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAku2ebcACgkQNak7dOguQgnVEwEAmJKfV+aGyIsBukrGqX8RDn/R 3+n1y0zL1X0je//DDywA/RqiCOjEUN+x4IUyDGzha+fDPuz5cMmf2UKVFzMrYTTW =5UyQ -----END PGP SIGNATURE----- --------------enigF72491148AEE71E73E686A42--