]> granicus.if.org Git - zfs/commitdiff
Fix bp_embedded_type enum definition
authorloli10K <loli10K@users.noreply.github.com>
Tue, 25 Jun 2019 01:02:17 +0000 (03:02 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 25 Jun 2019 01:02:17 +0000 (18:02 -0700)
With the addition of BP_EMBEDDED_TYPE_REDACTED in 30af21b0 a couple of
codepaths make wrong assumptions and could potentially result in errors.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8951

include/sys/spa.h
module/zfs/zio.c

index 9cc958c7c730aae5a04b06df3998e6eac61e2f56..a7e4d154fe0dc547dabde467c6865de3aa8511f1 100644 (file)
@@ -407,9 +407,9 @@ _NOTE(CONSTCOND) } while (0)
 
 typedef enum bp_embedded_type {
        BP_EMBEDDED_TYPE_DATA,
-       BP_EMBEDDED_TYPE_RESERVED, /* Reserved for an unintegrated feature. */
+       BP_EMBEDDED_TYPE_RESERVED, /* Reserved for Delphix byteswap feature. */
        BP_EMBEDDED_TYPE_REDACTED,
-       NUM_BP_EMBEDDED_TYPES = BP_EMBEDDED_TYPE_RESERVED
+       NUM_BP_EMBEDDED_TYPES
 } bp_embedded_type_t;
 
 #define        BPE_NUM_WORDS 14
index b2f722eb2f534b0c9cb2752a2876990573883979..6454ae5e38650484ce4ed14f5536e4cd4fdb538c 100644 (file)
@@ -908,7 +908,7 @@ zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp)
        }
 
        if (BP_IS_EMBEDDED(bp)) {
-               if (BPE_GET_ETYPE(bp) > NUM_BP_EMBEDDED_TYPES) {
+               if (BPE_GET_ETYPE(bp) >= NUM_BP_EMBEDDED_TYPES) {
                        zfs_panic_recover("blkptr at %p has invalid ETYPE %llu",
                            bp, (longlong_t)BPE_GET_ETYPE(bp));
                }