summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorriz <riz@NetBSD.org>2011-03-01 22:51:14 +0000
committerriz <riz@NetBSD.org>2011-03-01 22:51:14 +0000
commit4bf09ca06a9066920f6a4dda4b567a7b66a00fd6 (patch)
treeb7214519103b111b4969327658c37b067ab14c62 /sys/dev/raidframe
parent350213f54527cd22a402eb325c81b74b2d26ace6 (diff)
Always return at least one parity region. Fixes PR#44239.
Fix from oster@, code (such as it is) by me.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_paritymap.c6
1 files changed, 4 insertions, 2 deletions
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 <sys/cdefs.h>
-__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 <sys/param.h>
#include <sys/callout.h>
@@ -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;
}