Skip to content

Commit c20fcf4

Browse files
author
Paul Dagnelie
committed
Rob's feedback
Signed-off-by: Paul Dagnelie <[email protected]>
1 parent 7b63670 commit c20fcf4

File tree

17 files changed

+115
-116
lines changed

17 files changed

+115
-116
lines changed

cmd/zdb/zdb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4899,7 +4899,7 @@ dump_l2arc_header(int fd)
48994899
int error = B_FALSE;
49004900

49014901
if (pread64(fd, &l2dhdr, sizeof (l2dhdr),
4902-
VDEV_LABEL_START_SIZE(B_FALSE)) != sizeof (l2dhdr)) {
4902+
VDEV_OLD_LABEL_START_SIZE) != sizeof (l2dhdr)) {
49034903
error = B_TRUE;
49044904
} else {
49054905
if (l2dhdr.dh_magic == BSWAP_64(L2ARC_DEV_HDR_MAGIC))
@@ -5494,7 +5494,7 @@ dump_label(const char *dev)
54945494
if (large_label) {
54955495
char toc_buf[VDEV_TOC_SIZE];
54965496
if (pread64(fd, toc_buf, VDEV_TOC_SIZE,
5497-
label->label_offset + VDEV_NEW_PAD_SIZE) !=
5497+
label->label_offset + VDEV_LARGE_PAD_SIZE) !=
54985498
VDEV_TOC_SIZE) {
54995499
if (!dump_opt['q'])
55005500
(void) printf("failed to read label "
@@ -5506,7 +5506,7 @@ dump_label(const char *dev)
55065506

55075507
label->cksum_valid =
55085508
phys_cksum_valid(toc_buf,
5509-
label->label_offset + VDEV_NEW_PAD_SIZE,
5509+
label->label_offset + VDEV_LARGE_PAD_SIZE,
55105510
VDEV_TOC_SIZE);
55115511

55125512
label->read_failed = B_FALSE;
@@ -5552,7 +5552,7 @@ dump_label(const char *dev)
55525552
buf = alloca(conf_size);
55535553
buflen = conf_size;
55545554
uint64_t phys_off = label->label_offset +
5555-
VDEV_NEW_PAD_SIZE + toc_size + bootenv_size;
5555+
VDEV_LARGE_PAD_SIZE + toc_size + bootenv_size;
55565556
if (pread64(fd, buf, conf_size, phys_off) !=
55575557
conf_size) {
55585558
if (!dump_opt['q'])

cmd/ztest.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6667,8 +6667,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
66676667
* odd label, so that we can handle crashes in the
66686668
* middle of vdev_config_sync().
66696669
*/
6670-
boolean_t new = vdrand->vdev_large_label;
6671-
if ((leaf & 1) == 0 && offset < VDEV_LABEL_START_SIZE(new))
6670+
if ((leaf & 1) == 0 && offset < VDEV_LABEL_START_SIZE(vdrand))
66726671
continue;
66736672

66746673
/*
@@ -6677,10 +6676,10 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
66776676
* sizeof (vdev_label_t).
66786677
*/
66796678
uint64_t psize = P2ALIGN_TYPED(fsize,
6680-
new ? VDEV_LARGE_LABEL_ALIGN : sizeof (vdev_label_t),
6681-
uint64_t);
6679+
vdrand->vdev_large_label ? VDEV_LARGE_LABEL_ALIGN :
6680+
sizeof (vdev_label_t), uint64_t);
66826681
if ((leaf & 1) == 1 && offset + sizeof (bad) >
6683-
psize - VDEV_LABEL_END_SIZE(new))
6682+
psize - VDEV_LABEL_END_SIZE(vdrand))
66846683
continue;
66856684

66866685
if (mirror_save != zs->zs_mirrors) {

include/sys/vdev_impl.h

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,13 @@ struct vdev {
432432
uint64_t vdev_mmp_kstat_id; /* to find kstat entry */
433433
uint64_t vdev_expansion_time; /* vdev's last expansion time */
434434
list_node_t vdev_leaf_node; /* leaf vdev list */
435+
/*
436+
* vdev_large_label has different meanings for leaf and non-leaf vdevs.
437+
* For leaf vdevs, it is true if that specific vdev is using the large
438+
* label format. For non-leaf vdevs, it is true if any of its children
439+
* is using the new format, so that we know if we need to invoke the
440+
* large label sync logic.
441+
*/
435442
boolean_t vdev_large_label;
436443

437444
kmutex_t vdev_be_lock;
@@ -548,11 +555,13 @@ typedef struct vdev_label {
548555
} vdev_label_t; /* 256K total */
549556

550557
/*
551-
* The new label format is intended to help future-proof ZFS as sector sizes
552-
* grow. The number of uberblocks that can be safely written is limited by the
553-
* size of the ring divided by the sector size, which is already getting
554-
* uncomfortably small. The new label is only used on top-level vdevs and their
555-
* children; l2arc and spare devices are excluded. The new label layout:
558+
* The large label format was introduced to help future-proof ZFS as sector
559+
* sizes grow. The number of uberblocks that can be safely written is limited
560+
* by the size of the ring divided by the sector size, which in the original
561+
* format was already getting uncomfortably small. The new label is only used
562+
* on top-level vdevs and their children; l2arc and spare devices are excluded.
563+
*
564+
* Layout of the large label format:
556565
*
557566
* 16 MiB 112 MiB 128 MiB
558567
* +---------+--------------------------------+-------------------------------+
@@ -570,9 +579,9 @@ typedef struct vdev_label {
570579
* sub-section is larger than 16MiB, it will be split in 16MiB - sizeof
571580
* (zio_eck_t) chunks, which will each have their own checksum.
572581
*/
573-
#define VDEV_NEW_PAD_SIZE (1 << 24) // 16MiB
574-
#define VDEV_NEW_DATA_SIZE ((1 << 27) - VDEV_NEW_PAD_SIZE)
575-
#define VDEV_LARGE_LABEL_SIZE (VDEV_NEW_PAD_SIZE + VDEV_NEW_DATA_SIZE + \
582+
#define VDEV_LARGE_PAD_SIZE (1 << 24) // 16MiB
583+
#define VDEV_LARGE_DATA_SIZE ((1 << 27) - VDEV_LARGE_PAD_SIZE)
584+
#define VDEV_LARGE_LABEL_SIZE (VDEV_LARGE_PAD_SIZE + VDEV_LARGE_DATA_SIZE + \
576585
VDEV_LARGE_UBERBLOCK_RING) // 256MiB per label
577586
#define VDEV_LARGE_LABEL_ALIGN (1 << 24) // 16MiB
578587

@@ -587,9 +596,13 @@ typedef struct vdev_label {
587596
* when we need to read this info.
588597
*/
589598
#define VDEV_TOC_TOC_SIZE "toc_size"
599+
/* The size of the section that stores the boot region */
590600
#define VDEV_TOC_BOOT_REGION "boot_region"
601+
/* The size of the section that stores the vdev config */
591602
#define VDEV_TOC_VDEV_CONFIG "vdev_config"
603+
/* The size of the section that stores the pool config */
592604
#define VDEV_TOC_POOL_CONFIG "pool_config"
605+
/* The size of the section that stores auxilliary uberblocks */
593606
#define VDEV_TOC_AUX_UBERBLOCK "aux_uberblock"
594607

595608
/*
@@ -603,24 +616,31 @@ typedef struct vdev_label {
603616
/*
604617
* Size of embedded boot loader region on each label.
605618
* The total size of the first two labels plus the boot area is 4MB.
606-
* On RAIDZ, this space is overwritten during RAIDZ expansion.
619+
* On RAIDZ, this space is overwritten durinvg RAIDZ expansion.
607620
*/
608621
#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */
609622

610623
/*
611624
* Size of label regions at the start and end of each leaf device.
612625
*/
613-
#define VDEV_LABEL_START_SIZE(new) (new ? \
614-
VDEV_RESERVE_OFFSET + VDEV_RESERVE_SIZE : \
615-
2 * sizeof (vdev_label_t) + VDEV_BOOT_SIZE)
616-
#define VDEV_LABEL_END_SIZE(new) (new ? \
617-
2 * VDEV_LARGE_LABEL_SIZE : 2 * sizeof (vdev_label_t))
626+
#define VDEV_OLD_LABEL_START_SIZE (2 * sizeof (vdev_label_t) + \
627+
VDEV_BOOT_SIZE)
628+
#define VDEV_OLD_LABEL_END_SIZE (2 * sizeof (vdev_label_t))
629+
630+
#define VDEV_LARGE_LABEL_START_SIZE (VDEV_RESERVE_OFFSET + \
631+
VDEV_RESERVE_SIZE)
632+
#define VDEV_LARGE_LABEL_END_SIZE (2 * VDEV_LARGE_LABEL_SIZE)
633+
634+
#define VDEV_LABEL_START_SIZE(vd) ((vd)->vdev_large_label ? \
635+
VDEV_LARGE_LABEL_START_SIZE : VDEV_OLD_LABEL_START_SIZE)
636+
#define VDEV_LABEL_END_SIZE(vd) ((vd)->vdev_large_label ? \
637+
VDEV_LARGE_LABEL_END_SIZE : VDEV_OLD_LABEL_END_SIZE)
638+
618639
#define VDEV_LABELS 4
619640
#define VDEV_BEST_LABEL VDEV_LABELS
620-
#define VDEV_OFFSET_IS_LABEL(vd, off) \
621-
(((off) < VDEV_LABEL_START_SIZE(vd->vdev_large_label)) || \
622-
((off) >= ((vd)->vdev_psize - \
623-
VDEV_LABEL_END_SIZE(vd->vdev_large_label))))
641+
#define VDEV_OFFSET_IS_LABEL(vd, off) \
642+
(((off) < VDEV_LABEL_START_SIZE(vd)) || \
643+
((off) >= ((vd)->vdev_psize - VDEV_LABEL_END_SIZE(vd))))
624644

625645
#define VDEV_ALLOC_LOAD 0
626646
#define VDEV_ALLOC_ADD 1

lib/libzfs/libzfs.abi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@
638638
<elf-symbol name='fletcher_4_superscalar_ops' size='128' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
639639
<elf-symbol name='libzfs_config_ops' size='16' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
640640
<elf-symbol name='sa_protocol_names' size='16' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
641-
<elf-symbol name='spa_feature_table' size='2576' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
641+
<elf-symbol name='spa_feature_table' size='2632' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
642642
<elf-symbol name='zfeature_checks_disable' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
643643
<elf-symbol name='zfs_deleg_perm_tab' size='528' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
644644
<elf-symbol name='zfs_history_event_names' size='328' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
@@ -9606,8 +9606,8 @@
96069606
</function-decl>
96079607
</abi-instr>
96089608
<abi-instr address-size='64' path='module/zcommon/zfeature_common.c' language='LANG_C99'>
9609-
<array-type-def dimensions='1' type-id='83f29ca2' size-in-bits='20608' id='b9408bab'>
9610-
<subrange length='46' type-id='7359adad' id='8b86bc1b'/>
9609+
<array-type-def dimensions='1' type-id='83f29ca2' size-in-bits='21056' id='fd43354e'>
9610+
<subrange length='47' type-id='7359adad' id='8f8900fe'/>
96119611
</array-type-def>
96129612
<enum-decl name='zfeature_flags' id='6db816a4'>
96139613
<underlying-type type-id='9cac1fee'/>
@@ -9685,7 +9685,7 @@
96859685
<pointer-type-def type-id='611586a1' size-in-bits='64' id='2e243169'/>
96869686
<qualified-type-def type-id='eaa32e2f' const='yes' id='83be723c'/>
96879687
<pointer-type-def type-id='83be723c' size-in-bits='64' id='7acd98a2'/>
9688-
<var-decl name='spa_feature_table' type-id='b9408bab' mangled-name='spa_feature_table' visibility='default' elf-symbol-id='spa_feature_table'/>
9688+
<var-decl name='spa_feature_table' type-id='fd43354e' mangled-name='spa_feature_table' visibility='default' elf-symbol-id='spa_feature_table'/>
96899689
<var-decl name='zfeature_checks_disable' type-id='c19b74c3' mangled-name='zfeature_checks_disable' visibility='default' elf-symbol-id='zfeature_checks_disable'/>
96909690
<function-decl name='opendir' visibility='default' binding='global' size-in-bits='64'>
96919691
<parameter type-id='80f4b756'/>

lib/libzfs/libzfs_import.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ zpool_clear_label(int fd)
208208
"label < l2arc_dev_hdr_phys_t");
209209
memset(label, 0, sizeof (l2arc_dev_hdr_phys_t));
210210
if (pwrite64(fd, label, sizeof (l2arc_dev_hdr_phys_t),
211-
VDEV_LABEL_START_SIZE(B_FALSE)) ==
212-
sizeof (l2arc_dev_hdr_phys_t))
211+
VDEV_OLD_LABEL_START_SIZE) == sizeof (l2arc_dev_hdr_phys_t))
213212
header_cleared = B_TRUE;
214213
}
215214

module/os/freebsd/zfs/vdev_label_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ vdev_check_boot_reserve(spa_t *spa, vdev_t *childvd)
107107
* offset lets us access the boot area.
108108
*/
109109
zio_nowait(zio_vdev_child_io(pio, NULL, childvd,
110-
VDEV_BOOT_OFFSET - VDEV_LABEL_START_SIZE(childvd->vdev_large_label),
110+
VDEV_BOOT_OFFSET - VDEV_LABEL_START_SIZE(childvd),
111111
abd, size, ZIO_TYPE_READ, ZIO_PRIORITY_ASYNC_READ, 0,
112112
vdev_child_done, pio));
113113
zio_wait(pio);

module/zfs/arc.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6332,12 +6332,10 @@ arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
63326332
} else {
63336333
abd = hdr_abd;
63346334
}
6335-
boolean_t large_label = vd->vdev_large_label;
63366335

6337-
ASSERT(addr >=
6338-
VDEV_LABEL_START_SIZE(large_label) &&
6336+
ASSERT(addr >= VDEV_LABEL_START_SIZE(vd) &&
63396337
addr + asize <= vd->vdev_psize -
6340-
VDEV_LABEL_END_SIZE(large_label));
6338+
VDEV_LABEL_END_SIZE(vd));
63416339

63426340
/*
63436341
* l2arc read. The SCL_L2ARC lock will be
@@ -9173,7 +9171,7 @@ l2arc_evict(l2arc_dev_t *dev, uint64_t distance, boolean_t all)
91739171
*/
91749172
spa_config_exit(dev->l2ad_spa, SCL_L2ARC, dev);
91759173
vdev_trim_simple(vd, dev->l2ad_evict -
9176-
VDEV_LABEL_START_SIZE(vd->vdev_large_label),
9174+
VDEV_LABEL_START_SIZE(vd),
91779175
taddr - dev->l2ad_evict);
91789176
spa_config_enter(dev->l2ad_spa, SCL_L2ARC, dev,
91799177
RW_READER);
@@ -9979,10 +9977,8 @@ l2arc_add_vdev(spa_t *spa, vdev_t *vd)
99799977
/* leave extra size for an l2arc device header */
99809978
l2dhdr_asize = adddev->l2ad_dev_hdr_asize =
99819979
MAX(sizeof (*adddev->l2ad_dev_hdr), 1 << vd->vdev_ashift);
9982-
adddev->l2ad_start = VDEV_LABEL_START_SIZE(vd->vdev_large_label) +
9983-
l2dhdr_asize;
9984-
adddev->l2ad_end = VDEV_LABEL_START_SIZE(vd->vdev_large_label) +
9985-
vdev_get_min_asize(vd);
9980+
adddev->l2ad_start = VDEV_LABEL_START_SIZE(vd) + l2dhdr_asize;
9981+
adddev->l2ad_end = VDEV_LABEL_START_SIZE(vd) + vdev_get_min_asize(vd);
99869982
ASSERT3U(adddev->l2ad_start, <, adddev->l2ad_end);
99879983
adddev->l2ad_hand = adddev->l2ad_start;
99889984
adddev->l2ad_evict = adddev->l2ad_start;
@@ -10541,17 +10537,17 @@ l2arc_dev_hdr_read(l2arc_dev_t *dev)
1054110537
const uint64_t l2dhdr_asize = dev->l2ad_dev_hdr_asize;
1054210538
abd_t *abd;
1054310539
vdev_t *vd = dev->l2ad_vdev;
10544-
boolean_t large_label = vd ? vd->vdev_large_label :
10545-
B_FALSE;
10540+
uint64_t offset = vd ? VDEV_LABEL_START_SIZE(vd) :
10541+
VDEV_OLD_LABEL_START_SIZE;
1054610542

1054710543
guid = spa_guid(dev->l2ad_vdev->vdev_spa);
1054810544

1054910545
abd = abd_get_from_buf(l2dhdr, l2dhdr_asize);
1055010546

10551-
err = zio_wait(zio_read_phys(NULL, dev->l2ad_vdev,
10552-
VDEV_LABEL_START_SIZE(large_label), l2dhdr_asize, abd,
10553-
ZIO_CHECKSUM_LABEL, NULL, NULL, ZIO_PRIORITY_SYNC_READ,
10554-
ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY |
10547+
err = zio_wait(zio_read_phys(NULL, dev->l2ad_vdev, offset,
10548+
l2dhdr_asize, abd, ZIO_CHECKSUM_LABEL, NULL, NULL,
10549+
ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL |
10550+
ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY |
1055510551
ZIO_FLAG_SPECULATIVE, B_FALSE));
1055610552

1055710553
abd_free(abd);
@@ -10905,8 +10901,8 @@ l2arc_dev_hdr_update(l2arc_dev_t *dev)
1090510901
abd_t *abd;
1090610902
int err;
1090710903
vdev_t *vd = dev->l2ad_vdev;
10908-
boolean_t large_label = vd ? vd->vdev_large_label :
10909-
B_FALSE;
10904+
uint64_t offset = vd ? VDEV_LABEL_START_SIZE(vd) :
10905+
VDEV_OLD_LABEL_START_SIZE;
1091010906

1091110907
VERIFY(spa_config_held(dev->l2ad_spa, SCL_STATE_ALL, RW_READER));
1091210908

@@ -10929,9 +10925,8 @@ l2arc_dev_hdr_update(l2arc_dev_t *dev)
1092910925
abd = abd_get_from_buf(l2dhdr, l2dhdr_asize);
1093010926

1093110927
err = zio_wait(zio_write_phys(NULL, dev->l2ad_vdev,
10932-
VDEV_LABEL_START_SIZE(large_label), l2dhdr_asize, abd,
10933-
ZIO_CHECKSUM_LABEL, NULL, NULL, ZIO_PRIORITY_ASYNC_WRITE,
10934-
ZIO_FLAG_CANFAIL, B_FALSE));
10928+
offset, l2dhdr_asize, abd, ZIO_CHECKSUM_LABEL, NULL, NULL,
10929+
ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_CANFAIL, B_FALSE));
1093510930

1093610931
abd_free(abd);
1093710932

module/zfs/vdev.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ vdev_probe(vdev_t *vd, zio_t *zio)
19331933
offset_t offset;
19341934
if (vd->vdev_large_label) {
19351935
size = P2ROUNDUP(VDEV_TOC_SIZE, 1 << vd->vdev_ashift);
1936-
offset = VDEV_NEW_PAD_SIZE;
1936+
offset = VDEV_LARGE_PAD_SIZE;
19371937
} else {
19381938
size = VDEV_PAD_SIZE;
19391939
offset = offsetof(vdev_label_t, vl_be);
@@ -2272,15 +2272,16 @@ vdev_open(vdev_t *vd)
22722272
VDEV_AUX_TOO_SMALL);
22732273
return (SET_ERROR(EOVERFLOW));
22742274
}
2275+
uint64_t ssize = large_label ? VDEV_LARGE_LABEL_START_SIZE :
2276+
VDEV_OLD_LABEL_START_SIZE;
2277+
uint64_t esize = large_label ? VDEV_LARGE_LABEL_END_SIZE :
2278+
VDEV_OLD_LABEL_END_SIZE;
22752279
psize = osize;
2276-
asize = osize - (VDEV_LABEL_START_SIZE(large_label) +
2277-
VDEV_LABEL_END_SIZE(large_label));
2278-
max_asize = max_osize - (VDEV_LABEL_START_SIZE(large_label) +
2279-
VDEV_LABEL_END_SIZE(large_label));
2280+
asize = osize - (ssize + esize);
2281+
max_asize = max_osize - (ssize + esize);
22802282
} else {
22812283
if (vd->vdev_parent != NULL && osize < SPA_MINDEVSIZE -
2282-
(VDEV_LABEL_START_SIZE(B_FALSE) +
2283-
VDEV_LABEL_END_SIZE(B_FALSE))) {
2284+
(VDEV_OLD_LABEL_START_SIZE + VDEV_OLD_LABEL_END_SIZE)) {
22842285
vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN,
22852286
VDEV_AUX_TOO_SMALL);
22862287
return (SET_ERROR(EOVERFLOW));
@@ -4923,9 +4924,8 @@ vdev_get_stats_ex(vdev_t *vd, vdev_stat_t *vs, vdev_stat_ex_t *vsx)
49234924

49244925
if (vd->vdev_ops->vdev_op_leaf) {
49254926
vs->vs_pspace = vd->vdev_psize;
4926-
vs->vs_rsize +=
4927-
VDEV_LABEL_START_SIZE(vd->vdev_large_label) +
4928-
VDEV_LABEL_END_SIZE(vd->vdev_large_label);
4927+
vs->vs_rsize += VDEV_LABEL_START_SIZE(vd) +
4928+
VDEV_LABEL_END_SIZE(vd);
49294929
/*
49304930
* Report initializing progress. Since we don't
49314931
* have the initializing locks held, this is only

module/zfs/vdev_draid.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,11 +2480,9 @@ vdev_draid_spare_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
24802480
vdev_draid_calculate_asize(tvd, &asize, &max_asize,
24812481
logical_ashift, physical_ashift);
24822482

2483-
*psize = asize + VDEV_LABEL_START_SIZE(vd->vdev_large_label) +
2484-
VDEV_LABEL_END_SIZE(vd->vdev_large_label);
2485-
*max_psize = max_asize +
2486-
VDEV_LABEL_START_SIZE(vd->vdev_large_label) +
2487-
VDEV_LABEL_END_SIZE(vd->vdev_large_label);
2483+
*psize = asize + VDEV_LABEL_START_SIZE(vd) + VDEV_LABEL_END_SIZE(vd);
2484+
*max_psize = max_asize + VDEV_LABEL_START_SIZE(vd) +
2485+
VDEV_LABEL_END_SIZE(vd);
24882486

24892487
vds->vds_draid_vdev = tvd;
24902488
vd->vdev_nonrot = tvd->vdev_nonrot;
@@ -2586,8 +2584,7 @@ vdev_draid_spare_io_start(zio_t *zio)
25862584
{
25872585
vdev_t *cvd = NULL, *vd = zio->io_vd;
25882586
vdev_draid_spare_t *vds = vd->vdev_tsd;
2589-
uint64_t offset = zio->io_offset -
2590-
VDEV_LABEL_START_SIZE(vd->vdev_large_label);
2587+
uint64_t offset = zio->io_offset - VDEV_LABEL_START_SIZE(vd);
25912588

25922589
/*
25932590
* If the vdev is closed, it's likely in the REMOVED or FAULTED state.

module/zfs/vdev_indirect.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,7 @@ vdev_indirect_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
952952
uint64_t *logical_ashift, uint64_t *physical_ashift)
953953
{
954954
*psize = *max_psize = vd->vdev_asize +
955-
VDEV_LABEL_START_SIZE(vd->vdev_large_label) +
956-
VDEV_LABEL_END_SIZE(vd->vdev_large_label);
955+
VDEV_LABEL_START_SIZE(vd) + VDEV_LABEL_END_SIZE(vd);
957956
*logical_ashift = vd->vdev_ashift;
958957
*physical_ashift = vd->vdev_physical_ashift;
959958
return (0);

0 commit comments

Comments
 (0)