diff options
author | Jordan Hargrave <jordan@cvs.openbsd.org> | 2009-06-17 19:05:27 +0000 |
---|---|---|
committer | Jordan Hargrave <jordan@cvs.openbsd.org> | 2009-06-17 19:05:27 +0000 |
commit | 9d240caa74ea132af0ef4b7b7c3e7b2a54f65658 (patch) | |
tree | a1a49895deb43e0fa40fe68f87ae65bc88a43994 | |
parent | 5b0abfe0d10cb21ccceaefa6fee9ecd3cd91d3b4 (diff) |
Force Raid0/4/5 volume size to multiple of stripe size
ok marco@
-rw-r--r-- | sys/dev/softraid.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index b29dace7b0b..737287fb827 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.150 2009/06/12 17:22:52 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.151 2009/06/17 19:05:26 jordan Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -2100,7 +2100,8 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) */ strip_size = MAXPHYS; vol_size = - ch_entry->src_meta.scmi.scm_coerced_size * no_chunk; + (ch_entry->src_meta.scmi.scm_coerced_size & + ~((strip_size >> DEV_BSHIFT) - 1)) * no_chunk; break; case 1: if (no_chunk < 2) @@ -2125,8 +2126,9 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) * to tinker with that type of stuff */ strip_size = MAXPHYS; - vol_size = ch_entry->src_meta.scmi.scm_coerced_size * - (no_chunk - 1); + vol_size = + (ch_entry->src_meta.scmi.scm_coerced_size & + ~((strip_size >> DEV_BSHIFT) - 1)) * (no_chunk - 1); break; #endif /* not_yet */ #ifdef AOE |