From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UoBJu-0004L3-1G for mharc-grub-devel@gnu.org; Sun, 16 Jun 2013 07:40:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoBJr-0004Kx-40 for grub-devel@gnu.org; Sun, 16 Jun 2013 07:40:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoBJp-00044t-VV for grub-devel@gnu.org; Sun, 16 Jun 2013 07:40:27 -0400 Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]:36688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoBJp-00044n-Lb for grub-devel@gnu.org; Sun, 16 Jun 2013 07:40:25 -0400 Received: by mail-ee0-f45.google.com with SMTP id c1so1216659eek.18 for ; Sun, 16 Jun 2013 04:40:24 -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=+RjybrvnPIZ+yks3DxnyGENDXseqpnB9GhmnXmIWmFE=; b=fIctF9dNQAEn08SaWaQ63+tKYqh5tqGvR38kmTgxwD4sCdb7tgC9NREe9og0YrUUDx 1Dyn9u88sFEOz0t+05FWaVlgZMP8De+oG1TMFFjud/Jglr0ndQHZO6kkXlbTfnW2U8A9 wmqWeXdDg/VZE/4ZvitF0ugoMdvDtJ4G/rdLfZsmsF11y4rn9fFt9iipH87D0BavEkY6 vR5PIxkfToK/Zyb/qsWMMNy4h5Lqe0kHmKE/uciyq6nJfC8fVRuvueSV6TVqFmUQkHVR S/53gzLrBEJ51cm1yJ0+ILtsRjOZKfpEFmit8UA4HSSDgOF17aPCHrI1HMYbP50TWUGK 4skA== X-Received: by 10.15.24.129 with SMTP id j1mr11870498eeu.17.1371382824828; Sun, 16 Jun 2013 04:40:24 -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 y44sm16377662eel.10.2013.06.16.04.40.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Jun 2013 04:40:23 -0700 (PDT) Message-ID: <51BDA422.9030807@gmail.com> Date: Sun, 16 Jun 2013 13:40:18 +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: The development of GNU GRUB Subject: Re: [PATCH] fix multilevel diskfilter detection after rev 5024 References: <1370675539-31143-1-git-send-email-arvidjaar@gmail.com> <51BD1B74.2090008@gmail.com> <20130616075821.49205473@opensuse.site> In-Reply-To: <20130616075821.49205473@opensuse.site> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2MXRTMQNTLXXJNUUJEVGP" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22d 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 11:40:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2MXRTMQNTLXXJNUUJEVGP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 16.06.2013 05:58, Andrey Borzenkov wrote: > =D0=92 Sun, 16 Jun 2013 03:57:08 +0200 > Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0= =B8=D1=88=D0=B5=D1=82: >=20 >> 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. >>> >>> 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 > Yes. Any configuration with more than two levels. >=20 Ok, go ahead then. >>> >>> Change scan to iteratively rescan volume list until nothing new was >>> detected (or scan depth exceeded). >>> >>> Signed-off-by: Andrey Borzenkov >>> >>> --- >>> ChangeLog | 5 +++++ >>> grub-core/disk/diskfilter.c | 29 +++++++++++++++++++++-------- >>> 2 files changed, 26 insertions(+), 8 deletions(-) >>> >>> 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): Spli= t >>> 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_diskfilte= r) >>> 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 exc= eeded"); >>> } >>> =20 >>> static int >>> >> >> >=20 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 ------enig2MXRTMQNTLXXJNUUJEVGP 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/ iF4EAREKAAYFAlG9pCIACgkQNak7dOguQglnUgD/artJ+h/1FG86HQFboHZzRCZ4 Tqpmp0+7imeZPVgjsGAA/R73UhY/nrHIGLItGFrERwhJsaYVFSY+uMkBiMvUo22f =KS32 -----END PGP SIGNATURE----- ------enig2MXRTMQNTLXXJNUUJEVGP--