Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/lib/libzfs/common Always open the r...



details:   https://anonhg.NetBSD.org/src/rev/cb4058cb604b
branches:  trunk
changeset: 459002:cb4058cb604b
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Aug 20 08:11:21 2019 +0000

description:
Always open the raw block devices as "<device><unit>" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter.  Now pools on wedges get imported too.

diffstat:

 external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c |  5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r 1d7955b0e1f4 -r cb4058cb604b external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c
--- a/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c        Tue Aug 20 06:38:17 2019 +0000
+++ b/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c        Tue Aug 20 08:11:21 2019 +0000
@@ -1262,9 +1262,7 @@
                        static const char mib_name[] = "hw.disknames";
                        size_t len;
                        char *disknames, *last, *name;
-                       char part;
 
-                       part = getrawpartition();
                        if (sysctlbyname(mib_name, NULL, &len, NULL, 0) == -1) {
                                zfs_error_aux(hdl, strerror(errno));
                                (void) zfs_error_fmt(hdl, EZFS_BADPATH,
@@ -1277,11 +1275,10 @@
                        disknames = zfs_alloc(hdl, len + 2);
                        (void)sysctlbyname(mib_name, disknames, &len, NULL, 0);
 
-
                        for ((name = strtok_r(disknames, " ", &last)); name;
                            (name = strtok_r(NULL, " ", &last))) {
                                slice = zfs_alloc(hdl, sizeof (rdsk_node_t));
-                               slice->rn_name = zfs_asprintf(hdl, "%s%c", name, 'a' + part);
+                               slice->rn_name = zfs_strdup(hdl, name);
                                slice->rn_avl = &slice_cache;
                                slice->rn_dfd = dfd;
                                slice->rn_hdl = hdl;



Home | Main Index | Thread Index | Old Index