Skip to content

Commit 25e58ee

Browse files
committed
PR/60086: Andrew Parker: cgdconfig may not always find ZFS device labels
Updated cgdconfig to use the same alignment function as zdb (external/cddl/osnet/dist/cmd/zdb/zdb.c).
1 parent 414ef8a commit 25e58ee

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

sbin/cgdconfig/cgdconfig.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cgdconfig.c,v 1.63 2024/05/12 18:02:16 christos Exp $ */
1+
/* $NetBSD: cgdconfig.c,v 1.64 2026/03/17 17:24:47 christos Exp $ */
22

33
/*-
44
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
3333
#ifndef lint
3434
__COPYRIGHT("@(#) Copyright (c) 2002, 2003\
3535
The NetBSD Foundation, Inc. All rights reserved.");
36-
__RCSID("$NetBSD: cgdconfig.c,v 1.63 2024/05/12 18:02:16 christos Exp $");
36+
__RCSID("$NetBSD: cgdconfig.c,v 1.64 2026/03/17 17:24:47 christos Exp $");
3737
#endif
3838

3939
#ifdef HAVE_ARGON2
@@ -1213,6 +1213,7 @@ verify_zfs(int fd)
12131213
return rv;
12141214
}
12151215

1216+
vdev_size = P2ALIGN(vdev_size, (uint64_t)sizeof(vdev_label_t));
12161217
vdev_phys_t *vdev_phys = emalloc(sizeof(*vdev_phys));
12171218
for (size_t i = 0; i < VDEV_LABELS; i++) {
12181219
off_t vdev_phys_off = (i < VDEV_LABELS / 2 ?

0 commit comments

Comments
 (0)