Page MenuHomeFreeBSD

D3050.id7614.diff
No OneTemporary

D3050.id7614.diff

Index: head/sys/geom/geom_dev.c
===================================================================
--- head/sys/geom/geom_dev.c
+++ head/sys/geom/geom_dev.c
@@ -401,6 +401,20 @@
#else
e = 0;
#endif
+
+ /*
+ * The vgonel(9) - caused by eg. forced unmount of devfs - calls
+ * VOP_CLOSE(9) on devfs vnode without any FREAD or FWRITE flags,
+ * which would result in zero deltas, which in turn would cause
+ * panic in g_access(9).
+ *
+ * Note that we cannot zero the counters (ie. do "r = cp->acr"
+ * etc) instead, because the consumer might be opened in another
+ * devfs instance.
+ */
+ if (r + w + e == 0)
+ return (EINVAL);
+
sc = cp->private;
mtx_lock(&sc->sc_mtx);
sc->sc_open += r + w + e;

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 22, 1:32 AM (19 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25859935
Default Alt Text
D3050.id7614.diff (719 B)

Event Timeline