linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Justin Maggard <jmaggard10@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: fix return value of rdev_size_change()
Date: Mon, 15 Nov 2010 12:00:57 +1100	[thread overview]
Message-ID: <20101115120057.4879d7dc@notabene.brown> (raw)
In-Reply-To: <4cdc55d1.4800e70a.1ffa.6729@mx.google.com>

On Thu, 11 Nov 2010 20:25:17 +0000
Justin Maggard <jmaggard10@gmail.com> wrote:

> 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.

Thanks.
This was broken by commit dd8ac336c13fd8afdb082ebacb1cddd5cf727889
so is broken in all kernels since 2.6.30.
I've queued of the patch for my next pull request to Linus.

Thanks for the report and the patch.

NeilBrown


> 
> Signed-off-by: Justin Maggard <jmaggard10@gmail.com>
> ---
>  drivers/md/md.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 4e957f3..a0615af 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[] = {


      parent reply	other threads:[~2010-11-15  1:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 20:25 [PATCH] md: fix return value of rdev_size_change() Justin Maggard
     [not found] ` <AANLkTikEgZVC=0spvkYsXN4KWoNgbK9VMZ8EnN_VWZnf@mail.gmail.com>
2010-11-11 21:01   ` Justin Maggard
2010-11-15  1:00 ` Neil Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101115120057.4879d7dc@notabene.brown \
    --to=neilb@suse.de \
    --cc=jmaggard10@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).