All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guoqing Jiang <gqjiang@suse.com>
To: Xiao Ni <xni@redhat.com>, linux-raid@vger.kernel.org
Cc: ncroxon@redhat.com, jes.sorensen@gmail.com
Subject: Re: [MDADM PATCH 1/1] Array size is wrong when run mdadm -E
Date: Tue, 4 Jul 2017 17:03:30 +0800	[thread overview]
Message-ID: <595B59E2.10407@suse.com> (raw)
In-Reply-To: <1499151006-7924-1-git-send-email-xni@redhat.com>



On 07/04/2017 02:50 PM, Xiao Ni wrote:
> The size of array shows wrongly. It shifs wrong number.
>
> Signed-off-by: Xiao Ni <xni@redhat.com>
> ---
>   super1.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/super1.c b/super1.c
> index 86ec850..f3b864d 100644
> --- a/super1.c
> +++ b/super1.c
> @@ -366,7 +366,7 @@ static void examine_super1(struct supertype *st, char *homehost)
>   		}
>   		if (ddsks) {
>   			long long asize = __le64_to_cpu(sb->size);
> -			asize = (asize << 9) * ddsks / ddsks_denom;
> +			asize = (asize << 10) * ddsks / ddsks_denom;
>   			printf("     Array Size : %llu%s\n",
>   			       asize >> 10,  human_size(asize));
>   		}

IIRC, sb->size represents the num of sectors, so the shift should be 9.

Thanks,
Guoqing

  reply	other threads:[~2017-07-04  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04  6:50 [MDADM PATCH 1/1] Array size is wrong when run mdadm -E Xiao Ni
2017-07-04  9:03 ` Guoqing Jiang [this message]
2017-07-04  9:55   ` Xiao Ni
2017-07-05  1:56     ` Guoqing Jiang
2017-07-05  2:40       ` Xiao Ni
2017-07-05  3:21         ` Guoqing Jiang
2017-07-05  3:24           ` Xiao Ni

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=595B59E2.10407@suse.com \
    --to=gqjiang@suse.com \
    --cc=jes.sorensen@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=xni@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.