From: Justin Maggard Date: Wed, 24 Nov 2010 05:36:17 +0000 (+1100) Subject: md: fix return value of rdev_size_change() X-Git-Tag: v2.6.37-rc6~7^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c26a44ed1e552aaa1d4ceb71842002d235fe98d7;p=profile%2Fcommon%2Fkernel-common.git 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 dd8ac336c13fd8afdb082ebacb1cddd5cf727889 so this patch is suitable for any kernel since 2.6.30. Cc: stable@kernel.org Signed-off-by: Justin Maggard Signed-off-by: NeilBrown --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 324a366..7b9e229a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -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, rdev->sb_page); 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) md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size, rdev->sb_page); md_super_wait(rdev->mddev); - return num_sectors / 2; /* kB for sysfs */ + return num_sectors; } static struct super_type super_types[] = {