Source-Changes-HG archive

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

[src/netbsd-9]: src/external/cddl/osnet/dist/uts/common/fs/zfs Pull up follow...



details:   https://anonhg.NetBSD.org/src/rev/291268aa3992
branches:  netbsd-9
changeset: 964204:291268aa3992
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Nov 29 11:39:45 2020 +0000

description:
Pull up following revision(s) (requested by yhardy in ticket #1138):

        external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c: revision 1.19

Use vn_close to release the vnodes in the error handling blocks, since
the vnodes were opened for writing. Fix proposed on tech-kern
and improved by hannken@.

diffstat:

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

diffs (27 lines):

diff -r c6f80a637d09 -r 291268aa3992 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c    Sun Nov 29 11:36:46 2020 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c    Sun Nov 29 11:39:45 2020 +0000
@@ -215,7 +215,11 @@
                return (SET_ERROR(error));
        }
        if (vp->v_type != VBLK) {
+#ifdef __NetBSD__
+               vn_close(vp, FREAD|FWRITE, kcred);
+#else
                vrele(vp);
+#endif
                vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED;
                return (SET_ERROR(EINVAL));
        }
@@ -247,7 +251,11 @@
        error = workqueue_create(&dvd->vd_wq, "vdevsync",
            vdev_disk_flush, dvd, PRI_NONE, IPL_NONE, WQ_MPSAFE);
        if (error != 0) {
+#ifdef __NetBSD__
+               vn_close(vp, FREAD|FWRITE, kcred);
+#else
                vrele(vp);
+#endif
                return (SET_ERROR(error));
        }
 



Home | Main Index | Thread Index | Old Index