]> git.proxmox.com Git - mirror_zfs.git/blobdiff - include/sys/vdev_impl.h
Illumos 4958 zdb trips assert on pools with ashift >= 0xe
[mirror_zfs.git] / include / sys / vdev_impl.h
index 16fcaa0422784139873f819aed3ca02f3a8396b5..c0c8f52876bee46a3b066381e06540dc6840a988 100644 (file)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  */
 
 #ifndef _SYS_VDEV_IMPL_H
@@ -239,8 +239,11 @@ struct vdev {
 #define        VDEV_PHYS_SIZE          (112 << 10)
 #define        VDEV_UBERBLOCK_RING     (128 << 10)
 
+/* The largest uberblock we support is 8k. */
+#define        MAX_UBERBLOCK_SHIFT (13)
 #define        VDEV_UBERBLOCK_SHIFT(vd)        \
-       MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT)
+       MIN(MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT), \
+           MAX_UBERBLOCK_SHIFT)
 #define        VDEV_UBERBLOCK_COUNT(vd)        \
        (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd))
 #define        VDEV_UBERBLOCK_OFFSET(vd, n)    \