summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-10-07 19:17:51 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-10-07 19:17:51 +0000
commit60dc33f592f6881e7c14811d977a4977b0389c85 (patch)
treed52e1868d83f0147ff2a85450bee7d1f9085b474 /sys/dev
parent64024f9f3ad06a70b0564fbac15d4b3298b50dc4 (diff)
Using '4' as the max # of ccb's in a work unit doesn't work so well
when the number of chunks in your RAID5 is significantly more than 4. Each work unit needs to use at least a ccb per chunk to do the i/o. Set the max to the number of chunks, which all the other RAID types do in one varient or other. Note that it's not really a max, just the number used when allocating the entire collection of ccb's for the volume. Fixes doing largeish i/o's (e.g. dd bs=1m count=128) to RAID5 volumes with many chunks. Problem reported by Alex McWhirter. ok jsing@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/softraid_raid5.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/softraid_raid5.c b/sys/dev/softraid_raid5.c
index 192ceae057d..a3425842808 100644
--- a/sys/dev/softraid_raid5.c
+++ b/sys/dev/softraid_raid5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid5.c,v 1.26 2016/05/31 15:19:12 jsing Exp $ */
+/* $OpenBSD: softraid_raid5.c,v 1.27 2016/10/07 19:17:50 krw Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
@@ -77,7 +77,6 @@ sr_raid5_discipline_init(struct sr_discipline *sd)
strlcpy(sd->sd_name, "RAID 5", sizeof(sd->sd_name));
sd->sd_capabilities = SR_CAP_SYSTEM_DISK | SR_CAP_AUTO_ASSEMBLE |
SR_CAP_REBUILD | SR_CAP_REDUNDANT;
- sd->sd_max_ccb_per_wu = 4; /* only if stripsize <= MAXPHYS */
sd->sd_max_wu = SR_RAID5_NOWU + 2; /* Two for scrub/rebuild. */
/* Setup discipline specific function pointers. */
@@ -132,6 +131,8 @@ sr_raid5_init(struct sr_discipline *sd)
return EINVAL;
}
+ sd->sd_max_ccb_per_wu = sd->sd_meta->ssdi.ssd_chunk_no;
+
return 0;
}