From 4bf09ca06a9066920f6a4dda4b567a7b66a00fd6 Mon Sep 17 00:00:00 2001 From: riz Date: Tue, 1 Mar 2011 22:51:14 +0000 Subject: Always return at least one parity region. Fixes PR#44239. Fix from oster@, code (such as it is) by me. --- sys/dev/raidframe/rf_paritymap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev/raidframe') diff --git a/sys/dev/raidframe/rf_paritymap.c b/sys/dev/raidframe/rf_paritymap.c index 187b7e8129a..5d00002b944 100644 --- a/sys/dev/raidframe/rf_paritymap.c +++ b/sys/dev/raidframe/rf_paritymap.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_paritymap.c,v 1.5 2010/03/14 21:11:41 jld Exp $ */ +/* $NetBSD: rf_paritymap.c,v 1.6 2011/03/01 22:51:14 riz Exp $ */ /*- * Copyright (c) 2009 Jed Davis. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rf_paritymap.c,v 1.5 2010/03/14 21:11:41 jld Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_paritymap.c,v 1.6 2011/03/01 22:51:14 riz Exp $"); #include #include @@ -409,6 +409,8 @@ rf_paritymap_nreg(RF_Raid_t *raid) nreg = bytes_per_disk / REGION_MINSIZE; if (nreg > RF_PARITYMAP_NREG) nreg = RF_PARITYMAP_NREG; + if (nreg < 1) + nreg = 1; return (u_int)nreg; } -- cgit