diff --git a/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c b/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c index 308a13c74306..4dafd3ef24c3 100644 --- a/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c +++ b/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c @@ -1095,8 +1095,17 @@ zpool_open_func(void *arg) } #endif /* __FreeBSD__ */ #ifdef __NetBSD__ + struct dkwedge_list dkwl; off_t size; + /* skip devices with wedges */ + memset(&dkwl, 0, sizeof(dkwl)); + if (native_ioctl(fd, DIOCLWEDGES, &dkwl) == 0 && + dkwl.dkwl_nwedges > 0) { + (void) close(fd); + return; + } + if (native_ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || size < SPA_MINDEVSIZE) { (void) close(fd);