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/uts/common/fs/zfs Don't assume ever...



details:   https://anonhg.NetBSD.org/src/rev/73ca5386ab83
branches:  trunk
changeset: 973251:73ca5386ab83
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Thu Jun 25 09:39:15 2020 +0000

description:
Don't assume everything is a wedge and has a parent device. On non-wedges
this crashes.

Instead, just talk to the referenced device and rely on the dk driver
to pass requests correctly.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r c72a901a8038 -r 73ca5386ab83 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c    Thu Jun 25 08:00:49 2020 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c    Thu Jun 25 09:39:15 2020 +0000
@@ -222,19 +222,18 @@
 
        pdk = NULL;
        if (getdiskinfo(vp, &dkw) == 0)
-               pdk = disk_find(dkw.dkw_parent);
+               pdk = disk_find(dkw.dkw_devname);
 
        /* XXXNETBSD Once tls-maxphys gets merged this block becomes:
                dvd->vd_maxphys = (pdk ? disk_maxphys(pdk) : MACHINE_MAXPHYS);
        */
        {
                struct buf buf = {
+                       .b_dev = vp->v_rdev,
                        .b_bcount = MAXPHYS,
                };
-               if (pdk && pdk->dk_driver && pdk->dk_driver->d_minphys) {
-                       buf.b_dev = pdk->dk_rawvp->v_rdev;
+               if (pdk && pdk->dk_driver && pdk->dk_driver->d_minphys)
                        (*pdk->dk_driver->d_minphys)(&buf);
-               }
                dvd->vd_maxphys = buf.b_bcount;
        }
 



Home | Main Index | Thread Index | Old Index