aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-02-03 03:03:41 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 08:32:00 -0800
commit29fc7e3e70a05e9eea28afb6707a39c1a53e2f66 (patch)
tree4e8bc28c717116ade3cd723a921f3260656327aa /drivers/md/md.c
parent284ae7cab0f7335c9e0aa8992b28415ef1a54c7c (diff)
[PATCH] md: Assorted little md fixes
- version-1 superblock + The default_bitmap_offset is in sectors, not bytes. + the 'size' field in the superblock is in sectors, not KB - raid0_run should return a negative number on error, not '1' - raid10_read_balance should not return a valid 'disk' number if ->rdev turned out to be NULL - kmem_cache_destroy doesn't like being passed a NULL. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8f161743e18..67bb0d04676 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1081,7 +1081,7 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
mddev->size = le64_to_cpu(sb->size)/2;
mddev->events = le64_to_cpu(sb->events);
mddev->bitmap_offset = 0;
- mddev->default_bitmap_offset = 1024;
+ mddev->default_bitmap_offset = 1024 >> 9;
mddev->recovery_cp = le64_to_cpu(sb->resync_offset);
memcpy(mddev->uuid, sb->set_uuid, 16);
@@ -1162,7 +1162,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
sb->cnt_corrected_read = atomic_read(&rdev->corrected_errors);
sb->raid_disks = cpu_to_le32(mddev->raid_disks);
- sb->size = cpu_to_le64(mddev->size);
+ sb->size = cpu_to_le64(mddev->size<<1);
if (mddev->bitmap && mddev->bitmap_file == NULL) {
sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_offset);