* grub-core/fs/zfs/zfs.c (uberblock_verify): Accept version 5000.
(check_pool_label): Likewise. * include/grub/zfs/zfs.h: Rewrite SPA_VERSION_* macros.
This commit is contained in:
parent
53618046da
commit
c71dbd40a9
3 changed files with 18 additions and 12 deletions
|
@ -1,4 +1,10 @@
|
||||||
20013-07-14 Massimo Maggi <me@massimo-maggi.eu>
|
2013-07-14 Massimo Maggi <me@massimo-maggi.eu>
|
||||||
|
|
||||||
|
* grub-core/fs/zfs/zfs.c (uberblock_verify): Accept version 5000.
|
||||||
|
(check_pool_label): Likewise.
|
||||||
|
* include/grub/zfs/zfs.h: Rewrite SPA_VERSION_* macros.
|
||||||
|
|
||||||
|
2013-07-14 Massimo Maggi <me@massimo-maggi.eu>
|
||||||
|
|
||||||
* grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Fix RAIDZ reporting.
|
* grub-core/fs/zfs/zfsinfo.c (print_vdev_info): Fix RAIDZ reporting.
|
||||||
|
|
||||||
|
|
|
@ -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)
|
if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_LITTLE_ENDIAN)
|
||||||
== UBERBLOCK_MAGIC
|
== UBERBLOCK_MAGIC
|
||||||
&& grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN) > 0
|
&& SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN)))
|
||||||
&& grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN)
|
|
||||||
<= SPA_VERSION)
|
|
||||||
endian = GRUB_ZFS_LITTLE_ENDIAN;
|
endian = GRUB_ZFS_LITTLE_ENDIAN;
|
||||||
|
|
||||||
if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_BIG_ENDIAN) == UBERBLOCK_MAGIC
|
if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_BIG_ENDIAN) == UBERBLOCK_MAGIC
|
||||||
&& grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN) > 0
|
&& SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN)))
|
||||||
&& grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN)
|
|
||||||
<= SPA_VERSION)
|
|
||||||
endian = GRUB_ZFS_BIG_ENDIAN;
|
endian = GRUB_ZFS_BIG_ENDIAN;
|
||||||
|
|
||||||
if (endian == GRUB_ZFS_UNKNOWN_ENDIAN)
|
if (endian == GRUB_ZFS_UNKNOWN_ENDIAN)
|
||||||
|
@ -845,13 +841,13 @@ check_pool_label (struct grub_zfs_data *data,
|
||||||
}
|
}
|
||||||
grub_dprintf ("zfs", "check 8 passed\n");
|
grub_dprintf ("zfs", "check 8 passed\n");
|
||||||
|
|
||||||
if (version > SPA_VERSION)
|
if (!SPA_VERSION_IS_SUPPORTED(version))
|
||||||
{
|
{
|
||||||
grub_free (nvlist);
|
grub_free (nvlist);
|
||||||
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||||
"too new version %llu > %llu",
|
"too new version %llu > %llu",
|
||||||
(unsigned long long) version,
|
(unsigned long long) version,
|
||||||
(unsigned long long) SPA_VERSION);
|
(unsigned long long) SPA_VERSION_BEFORE_FEATURES);
|
||||||
}
|
}
|
||||||
grub_dprintf ("zfs", "check 9 passed\n");
|
grub_dprintf ("zfs", "check 9 passed\n");
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,12 @@ typedef enum grub_zfs_endian
|
||||||
/*
|
/*
|
||||||
* On-disk version number.
|
* On-disk version number.
|
||||||
*/
|
*/
|
||||||
#define SPA_VERSION 33ULL
|
#define SPA_VERSION_INITIAL 1ULL
|
||||||
|
#define SPA_VERSION_BEFORE_FEATURES 33ULL
|
||||||
|
#define SPA_VERSION_FEATURES 5000ULL
|
||||||
|
#define SPA_VERSION_IS_SUPPORTED(v) \
|
||||||
|
(((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \
|
||||||
|
((v) == SPA_VERSION_FEATURES))
|
||||||
/*
|
/*
|
||||||
* The following are configuration names used in the nvlist describing a pool's
|
* The following are configuration names used in the nvlist describing a pool's
|
||||||
* configuration.
|
* configuration.
|
||||||
|
|
Loading…
Add table
Reference in a new issue