summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-10-19 16:38:29 +1000
committerNeil Brown <neilb@suse.de>2006-10-19 16:38:29 +1000
commit702b557b1c902e19cc2a157d53f66dcf73662da4 (patch)
tree1de445a67327d4d04ec96878f6de8030e4b957ec
parent26a0b8fd7a80419662c0171b91e95e5057af598e (diff)
downloadmdadm-702b557b1c902e19cc2a157d53f66dcf73662da4.tar.gz
mdadm-702b557b1c902e19cc2a157d53f66dcf73662da4.tar.xz
mdadm-702b557b1c902e19cc2a157d53f66dcf73662da4.zip
Fix bugs related to raid10 and the new offset layout.
Need to mask of bits above the bottom 16 when calculating number of copies.
-rw-r--r--ChangeLog1
-rw-r--r--Create.c2
-rw-r--r--util.c2
3 files changed, 3 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9fd831f..1aaa1ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@ Changes Prior to this release
initramfs, but device doesn't yet exist in /dev.
- When --assemble --scan is run, if all arrays that could be found
have already been started, don't report an error.
+ - Fix a couple of bugs related to raid10 and the new 'offset' layout.
Changes Prior to 2.5.4 release
- When creating devices in /dev/md/ create matching symlinks
diff --git a/Create.c b/Create.c
index ff87df0..e0cc797 100644
--- a/Create.c
+++ b/Create.c
@@ -363,7 +363,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
* which is array.size * raid_disks / ncopies;
* .. but convert to sectors.
*/
- int ncopies = (layout>>8) * (layout & 255);
+ int ncopies = ((layout>>8) & 255) * (layout & 255);
bitmapsize = (unsigned long long)size * raiddisks / ncopies * 2;
/* printf("bms=%llu as=%d rd=%d nc=%d\n", bitmapsize, size, raiddisks, ncopies);*/
} else
diff --git a/util.c b/util.c
index 97707d0..8d06848 100644
--- a/util.c
+++ b/util.c
@@ -179,7 +179,7 @@ int enough(int level, int raid_disks, int layout,
/* This is the tricky one - we need to check
* which actual disks are present.
*/
- copies = (layout&255)* (layout>>8);
+ copies = (layout&255)* ((layout>>8) & 255);
first=0;
do {
/* there must be one of the 'copies' form 'first' */