Received: from list by lists.gnu.org with archive (Exim 4.71) id 1U2Js4-0007I2-6v for mharc-grub-devel@gnu.org; Mon, 04 Feb 2013 06:05:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2Js0-0007Ho-Ge for grub-devel@gnu.org; Mon, 04 Feb 2013 06:05:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2Jrx-0008KV-Hx for grub-devel@gnu.org; Mon, 04 Feb 2013 06:05:52 -0500 Received: from mmserver.massimo-maggi.eu ([94.23.66.90]:34920 helo=mmserver.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2Jrx-0008KR-6J for grub-devel@gnu.org; Mon, 04 Feb 2013 06:05:49 -0500 Received: from [IPv6:2001:b05:f:ffff::25] (unknown [IPv6:2001:b05:f:ffff::25]) by mmserver.localdomain (Postfix) with ESMTPSA id E7FBF3C0 for ; Mon, 4 Feb 2013 12:05:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=massimo-maggi.eu; s=mmserver; t=1359975948; bh=10/HS/5dJdDGvJbaWpG6vIq8+gd+zeEe/JqUPSgFANE=; h=Date:From:To:Subject:References:In-Reply-To; b=FmPRIdWsmc/swXNy5rLzou2TgOfxBji+m2blhxKUHhPwLBGu3sxP+LfWJN9k1P7zQ bIyggWe6fYPH+dznWAejdppnwFB5Fe3mT3OxurwFPwn34lA95dGeJ7rxxcOUdpa0T4 oL1Lf9/V/X1EbjvrYSf5+Yb6OILS8N4Vf8vJ155g= Message-ID: <510F96CC.2060308@massimo-maggi.eu> Date: Mon, 04 Feb 2013 12:09:00 +0100 From: Massimo Maggi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130128 Thunderbird/17.0.2 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: [PATCH 2/5] Accept pool version 5000 for feature flags References: In-Reply-To: X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2ORKRUUJCGLSBVVTJPDTT" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 94.23.66.90 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: Mon, 04 Feb 2013 11:05:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ORKRUUJCGLSBVVTJPDTT Content-Type: multipart/mixed; boundary="------------010400010204060202050700" This is a multi-part message in MIME format. --------------010400010204060202050700 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ported to GRUB2 from IllumOS changeset 13700 2889e2596bd6 Author: Christopher Siden Ported-by: Massimo Maggi --- grub-core/fs/zfs/zfs.c | 14 +++++--------- include/grub/zfs/zfs.h | 9 +++++++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index 822d65b..3ea9c95 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -490,15 +490,11 @@ uberblock_verify (uberblock_phys_t * ub, grub_uint64_t offset, if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_LITTLE_ENDIAN) =3D=3D UBERBLOCK_MAGIC - && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN) > 0 - && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN) - <=3D SPA_VERSION) - endian =3D GRUB_ZFS_LITTLE_ENDIAN; + && SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN))) + endian =3D GRUB_ZFS_LITTLE_ENDIAN; if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_BIG_ENDIAN) =3D=3D UBERBLOCK_MAGIC - && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN) > 0 - && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN) - <=3D SPA_VERSION) + && SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN))) endian =3D GRUB_ZFS_BIG_ENDIAN; if (endian =3D=3D GRUB_ZFS_UNKNOWN_ENDIAN) @@ -845,13 +841,13 @@ check_pool_label (struct grub_zfs_data *data, } grub_dprintf ("zfs", "check 8 passed\n"); - if (version > SPA_VERSION) + if (!SPA_VERSION_IS_SUPPORTED(version)) { grub_free (nvlist); return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "too new version %llu > %llu", (unsigned long long) version, - (unsigned long long) SPA_VERSION); + (unsigned long long) SPA_VERSION_BEFORE_FEATURES); } grub_dprintf ("zfs", "check 9 passed\n"); diff --git a/include/grub/zfs/zfs.h b/include/grub/zfs/zfs.h index e326c8b..20b23b7 100644 --- a/include/grub/zfs/zfs.h +++ b/include/grub/zfs/zfs.h @@ -36,8 +36,13 @@ typedef enum grub_zfs_endian /* * On-disk version number. */ -#define SPA_VERSION 33ULL - +#define SPA_VERSION_INITIAL 1ULL +#define SPA_VERSION_BEFORE_FEATURES 33ULL +#define SPA_VERSION 5000ULL +#define SPA_VERSION_FEATURES 5000ULL +#define SPA_VERSION_IS_SUPPORTED(v) \ + (((v) >=3D SPA_VERSION_INITIAL && (v) <=3D SPA_VERSION_BEFORE_FEATURES)= || \ + ((v) >=3D SPA_VERSION_FEATURES && (v) <=3D SPA_VERSION)) /* * The following are configuration names used in the nvlist describing a pool's * configuration. --=20 1.8.1.1 --------------010400010204060202050700 Content-Type: text/plain; charset=ISO-8859-1; name="Attached Message Part" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Attached Message Part" --------------010400010204060202050700-- ------enig2ORKRUUJCGLSBVVTJPDTT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRD5bMAAoJEEO073X3hHDOISIH/1fp70nHmVaEtLqeNYjz+sza 6FUkhdm7sE946Ud5wnj3gtKHZ2bxpTIUHtY5U1t1bA0CrcnL5SXm7Ajw+nH8PklW vZuO0PtDvS/xLL/EYs8Q/zZ826qzSf5y6CAsPI2i3xz3IX1Q8JCu2yT8O5uSlbM2 psHtPA2KTex8XNQdy0U5GmU3+CmVV4JvcOUORyD6ucfvQttWD6l+N2LxMEcRji+l 5o/OixhU2oPoRxh9oqZPgD9WB50uGE6DUmZJNPIRsfbCWBbRjdfbgUVOm1zghXvP rkqBfML/2DEHuVNf49vWW5C96a/zjfgCDevxItBIEerMg6lwS/qDRkuZjsgnJSA= =h7PT -----END PGP SIGNATURE----- ------enig2ORKRUUJCGLSBVVTJPDTT--