From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Uo46o-0003l3-Dv for mharc-grub-devel@gnu.org; Sat, 15 Jun 2013 23:58:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uo46k-0003kR-I2 for grub-devel@gnu.org; Sat, 15 Jun 2013 23:58:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uo46j-0001kg-In for grub-devel@gnu.org; Sat, 15 Jun 2013 23:58:26 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:49536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uo46j-0001kU-6z for grub-devel@gnu.org; Sat, 15 Jun 2013 23:58:25 -0400 Received: by mail-lb0-f170.google.com with SMTP id t13so1618782lbd.15 for ; Sat, 15 Jun 2013 20:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=8wPuEQvsh8RkzgM2RTemw3nPGqLMCLApSZEUp2e3t20=; b=EgDwCPVNskkkPhEci29Nrsk/M7phtUjbQyq6a2NErMYImeMrZK9Vbe19w3ULUdroJ4 6he/8kampgp4vgWZKEjMgHM2rQaGmbHCsQin36nJy9jXn6/QTC7YX4pP8C08AFr5OSRt zFwWc+WwQ7+6Mz9v704GoNhlGC383sK+zDsaScWr6L7S2yUVMVCuxVak+iu6GT3UlIxM mbyaB4DiPv2WDxhCHsAjzwImn8CImG7rWWFZ6m6fpHjGqhjgTx2Oxq0fwmpi25gXqfEH bt9NLdrvtCclZxDUn9PB+IKQQ7IWriHCV5A1FTxNEMUvn1swKJ0aQfsvq+vBeRMczP+d NswQ== X-Received: by 10.112.210.37 with SMTP id mr5mr3910820lbc.60.1371355103545; Sat, 15 Jun 2013 20:58:23 -0700 (PDT) Received: from opensuse.site (ppp79-139-160-84.pppoe.spdop.ru. [79.139.160.84]) by mx.google.com with ESMTPSA id et10sm3178973lbc.6.2013.06.15.20.58.22 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sat, 15 Jun 2013 20:58:23 -0700 (PDT) Date: Sun, 16 Jun 2013 07:58:21 +0400 From: Andrey Borzenkov To: grub-devel@gnu.org Subject: Re: [PATCH] fix multilevel diskfilter detection after rev 5024 Message-ID: <20130616075821.49205473@opensuse.site> In-Reply-To: <51BD1B74.2090008@gmail.com> References: <1370675539-31143-1-git-send-email-arvidjaar@gmail.com> <51BD1B74.2090008@gmail.com> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.18; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/fqeR.ks3Bvlxa83nPNv/Rbk"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.170 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 03:58:28 -0000 --Sig_/fqeR.ks3Bvlxa83nPNv/Rbk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =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: > 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. Yes. Any configuration with more than two levels. > >=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 >=20 >=20 --Sig_/fqeR.ks3Bvlxa83nPNv/Rbk Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlG9N90ACgkQR6LMutpd94xI5wCgnrNJYpBm4TTmIXukh5syIN2m s/EAoIoxtMuAnulJWBwhyYKS4+TqvMTy =ERl7 -----END PGP SIGNATURE----- --Sig_/fqeR.ks3Bvlxa83nPNv/Rbk--