Commit c26a44ed authored by Justin Maggard's avatar Justin Maggard Committed by NeilBrown

md: fix return value of rdev_size_change()

When trying to grow an array by enlarging component devices,
rdev_size_store() expects the return value of rdev_size_change() to be
in sectors, but the actual value is returned in KBs.

This functionality was broken by commit
     dd8ac336
so this patch is suitable for any kernel since 2.6.30.

Cc: stable@kernel.org
Signed-off-by: default avatarJustin Maggard <jmaggard10@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 3561d43f
...@@ -1337,7 +1337,7 @@ super_90_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors) ...@@ -1337,7 +1337,7 @@ super_90_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size, md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,
rdev->sb_page); rdev->sb_page);
md_super_wait(rdev->mddev); md_super_wait(rdev->mddev);
return num_sectors / 2; /* kB for sysfs */ return num_sectors;
} }
...@@ -1704,7 +1704,7 @@ super_1_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors) ...@@ -1704,7 +1704,7 @@ super_1_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size, md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,
rdev->sb_page); rdev->sb_page);
md_super_wait(rdev->mddev); md_super_wait(rdev->mddev);
return num_sectors / 2; /* kB for sysfs */ return num_sectors;
} }
static struct super_type super_types[] = { static struct super_type super_types[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment