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 Use vn_close to r...
details: https://anonhg.NetBSD.org/src/rev/8a462c842ef6
branches: trunk
changeset: 978669:8a462c842ef6
user: yhardy <yhardy%NetBSD.org@localhost>
date: Sat Nov 28 22:53:06 2020 +0000
description:
Use vn_close to release the vnodes in the error handling blocks, since
the vnodes were opened for writing. Fix proposed on current-users
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 929594df2bf1 -r 8a462c842ef6 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c Sat Nov 28 22:16:23 2020 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c Sat Nov 28 22:53:06 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