From 8ad6178d29fba3a8f45a26258d6474ec9aba49cd Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 7 Oct 2004 20:13:23 +0000 Subject: 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(+) (limited to 'sys') diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 928efa0..9c023a1 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); } -- cgit v1.1