[PATCH 2/6] md: Fix a bug in super_1_sync().
From: Andre Noll <hidden>
Date: 2009-05-25 09:27:33
Subsystem:
software raid (multiple disks) support, the rest · Maintainers:
Song Liu, Yu Kuai, Linus Torvalds
From: Andre Noll <hidden>
Date: 2009-05-25 09:27:33
Subsystem:
software raid (multiple disks) support, the rest · Maintainers:
Song Liu, Yu Kuai, Linus Torvalds
The new_chunk fields of both struct mddev_s and struct mdp_superblock_1 are measured in bytes. However, in super_1_sync(), mddev->new_chunk is converted to sectors before it assigned to sb->new_chunk. This results in a too small number being stored in the in-memory image of the superblock which could confuse the reshape process. Signed-off-by: Andre Noll <redacted> --- drivers/md/md.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 48bdbdf..66e32e4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c@@ -1402,7 +1402,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev) sb->new_layout = cpu_to_le32(mddev->new_layout); sb->delta_disks = cpu_to_le32(mddev->delta_disks); sb->new_level = cpu_to_le32(mddev->new_level); - sb->new_chunk = cpu_to_le32(mddev->new_chunk>>9); + sb->new_chunk = cpu_to_le32(mddev->new_chunk); } max_dev = 0;
--
1.5.4.3