From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Uo2DY-00087o-O4 for mharc-grub-devel@gnu.org; Sat, 15 Jun 2013 21:57:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uo2DV-00086q-Fr for grub-devel@gnu.org; Sat, 15 Jun 2013 21:57:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uo2DU-0002x1-9O for grub-devel@gnu.org; Sat, 15 Jun 2013 21:57:17 -0400 Received: from mail-ee0-x22c.google.com ([2a00:1450:4013:c00::22c]:45402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uo2DU-0002wp-0I for grub-devel@gnu.org; Sat, 15 Jun 2013 21:57:16 -0400 Received: by mail-ee0-f44.google.com with SMTP id c13so1075608eek.3 for ; Sat, 15 Jun 2013 18:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=Ud7GbtsAhftod4ezOnvaE4AWbXmwINk6W/CsKE7TK8s=; b=Xh7NRr3P5CepI0U8NjpTKOdZ1BBrvXr/u/sfI95ytgw0SYa0uWX4NydEpK4x221vzz GXW21TJ7SylGoMhWpzxS2JtbC+2OMyti/uYNLn7e4oFnRSzck1LCHkuIvmOrAoa/cO4g pyc6Um9fdsSHKKdKEAS3iDZWSJsZLDAxEJNbS54dSWnOOn/mimyuUXYr1E49o3fJp7vu pjFWB3zOWuZaBCxc7GEm5F1e6Ch8+hvcpxn1CcWuJARJ5b0BJocdH0tnUVIXg7kStUBm /LCDYe1qU2kBjQhWLloHi8lk2JgKRzLt+K4DPDPyh1pIjMEHwkp/eB75Dpa8aiuT6Il/ +KTw== X-Received: by 10.14.1.136 with SMTP id 8mr10066783eed.106.1371347835159; Sat, 15 Jun 2013 18:57:15 -0700 (PDT) Received: from [192.168.1.113] (31-249.1-85.cust.bluewin.ch. [85.1.249.31]) by mx.google.com with ESMTPSA id l42sm3693572eeo.14.2013.06.15.18.57.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Jun 2013 18:57:13 -0700 (PDT) Message-ID: <51BD1B74.2090008@gmail.com> Date: Sun, 16 Jun 2013 03:57:08 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130518 Icedove/17.0.5 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH] fix multilevel diskfilter detection after rev 5024 References: <1370675539-31143-1-git-send-email-arvidjaar@gmail.com> In-Reply-To: <1370675539-31143-1-git-send-email-arvidjaar@gmail.com> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2HMXVFWDCXJMRJHEMUCEC" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Sun, 16 Jun 2013 01:57:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2HMXVFWDCXJMRJHEMUCEC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08.06.2013 09:12, Andrey Borzenkov wrote: > After commit "Fix order to discover ambigouos RAID before discovering > RAIDs on top of it" diskfilter scans all volumes exactly once. This > means that only first level is found. Scanning second time will find > next level etc. >=20 > This means that e.g. MD RAID on top of MD RAID is not found. Do you mean raid on top of raid on top of raid? Otherwise I don't understand the problem. >=20 > Change scan to iteratively rescan volume list until nothing new was > detected (or scan depth exceeded). >=20 > Signed-off-by: Andrey Borzenkov >=20 > --- > ChangeLog | 5 +++++ > grub-core/disk/diskfilter.c | 29 +++++++++++++++++++++-------- > 2 files changed, 26 insertions(+), 8 deletions(-) >=20 > diff --git a/ChangeLog b/ChangeLog > index 4d8f343..bebcc8a 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,8 @@ > +2013-06-08 Andrey Borzenkov > + > + * grub-core/disk/diskfilter.c (scan_devices): Iteratively > + rescan diskfilter devices until nothing new is found. > + > 2013-06-07 Andrey Borzenkov > =20 > * grub-core/script/execute.c (grub_script_execute_sourcecode): Split > diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c > index c8d267a..0455177 100644 > --- a/grub-core/disk/diskfilter.c > +++ b/grub-core/disk/diskfilter.c > @@ -188,6 +188,7 @@ scan_disk (const char *name, int accept_diskfilter)= > if (!accept_diskfilter && is_valid_diskfilter_name (name)) > return 0; > =20 > + /* FIXME do we still need it? It is not called recursively anymore *= / > if (scan_depth > 100) > return 0; Still need it. Consider raid on loopback where underlying OS may call into diskfilter again. > =20 > @@ -219,6 +220,8 @@ scan_devices (const char *arname) > grub_disk_pull_t pull; > struct grub_diskfilter_vg *vg; > struct grub_diskfilter_lv *lv =3D NULL; > + int scan_depth; > + int need_rescan; > =20 > for (pull =3D 0; pull < GRUB_DISK_PULL_MAX; pull++) > for (p =3D grub_disk_dev_list; p; p =3D p->next) > @@ -231,16 +234,26 @@ scan_devices (const char *arname) > return; > } > =20 > - for (vg =3D array_list; vg; vg =3D vg->next) > + scan_depth =3D 0; > + need_rescan =3D 1; > + while (need_rescan && scan_depth++ < 100) > { > - if (vg->lvs) > - for (lv =3D vg->lvs; lv; lv =3D lv->next) > - if (!lv->scanned && lv->fullname && lv->became_readable_at) > - { > - scan_disk (lv->fullname, 1); > - lv->scanned =3D 1; > - } > + need_rescan =3D 0; > + for (vg =3D array_list; vg; vg =3D vg->next) > + { > + if (vg->lvs) > + for (lv =3D vg->lvs; lv; lv =3D lv->next) > + if (!lv->scanned && lv->fullname && lv->became_readable_at) > + { > + scan_disk (lv->fullname, 1); > + lv->scanned =3D 1; > + need_rescan =3D 1; > + } > + } > } > + > + if (need_rescan) > + grub_error (GRUB_ERR_UNKNOWN_DEVICE, "DISKFILTER scan depth excee= ded"); > } > =20 > static int >=20 ------enig2HMXVFWDCXJMRJHEMUCEC 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.12 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlG9G3QACgkQNak7dOguQgnQhQD/aF78/1wOY9PBpNcSafBzJQK3 ZK4czal46wLiAY/+FOQA/RHgwVaIcD/cxdFEBcYh94ixD6GnnF9xP8pVy2fCJJyS =xKQG -----END PGP SIGNATURE----- ------enig2HMXVFWDCXJMRJHEMUCEC--