From 64c65965a60d6f70247e7fd63114ac1afa126842 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 26 Mar 2017 19:21:38 +0200 Subject: [PATCH] sys/geom: Let g_access() log the actual error number ... before exiting prematurely because of it. "g_access(918): provider da0 has error" is not particularly helpful. Obtained from: ElectroBSD --- sys/geom/geom_subr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 7d19a6fbee15..a0253013d435 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -914,8 +914,8 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int dce) return (EPERM); /* If we try to open more but provider is error'ed: fail */ else if ((dcr > 0 || dcw > 0 || dce > 0) && pp->error != 0) { - printf("%s(%d): provider %s has error\n", - __func__, __LINE__, pp->name); + printf("%s(%d): provider %s has error %d set\n", + __func__, __LINE__, pp->name, pp->error); return (pp->error); } -- 2.14.1