From 7aefe57c5c8a65b2e07c2355b7889e5fee5ef954 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Thu, 7 Oct 2004 20:13:23 +0000 Subject: [PATCH] Be sure to always return 0 for negative access requests. Reported by: Maciej Kucharz --- sys/geom/mirror/g_mirror.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 928efa088b4..9c023a1aabd 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -2366,6 +2366,14 @@ g_mirror_access(struct g_provider *pp, int acr, int acw, int ace) G_MIRROR_EVENT_DONTWAIT); } } + /* + * Be sure to return 0 for negativate access requests. + * In case of some HW problems, it is possible that we don't have + * any active disk here, so loop above will be no-op and error will + * be ENXIO. + */ + if (error != 0 && acr <= 0 && acw <= 0 && ace <= 0) + error = 0; return (error); }