All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: "Rémi Rérolle" <rrerolle@lacie.com>
Cc: "Rémi Rérolle" <remi.rerolle@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: fix sync_completed reporting for very large drives (>2TB)
Date: Tue, 11 Jan 2011 22:01:50 +1100	[thread overview]
Message-ID: <20110111220150.6444d493@notabene.brown> (raw)
In-Reply-To: <4D2C3302.2090708@lacie.com>

On Tue, 11 Jan 2011 11:37:54 +0100 Rémi Rérolle <rrerolle@lacie.com> wrote:

> Le 04/01/2011 16:44, Rémi Rérolle a écrit :
> > From: Rémi Rérolle<rrerolle@lacie.com>
> >
> > The values exported in the sync_completed file are unsigned long, which
> > overflows with very large drives, resulting in wrong values reported.
> >
> > Since sync_completed uses sectors as unit, we'll start getting wrong
> > values with components larger than 2TB.
> >
> > This patch simply replaces the use of unsigned long by unsigned long long.
> >
> 
> Hi Neil,
> 
> What is the status for this patch ?
> 
> Thanks in advance!

Perfect timing!!

The status is that I had completely forgotten about it, but I have just been
assembling some md patches for the current merge window, so I have just added
your patch - it should appear in -next in a day or so and go to Linus by the
end of the week.

Thanks!

NeilBrown


> 
> > Signed-off-by: Rémi Rérolle<rrerolle@lacie.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 175c424..ea46b3b 100644
> > --- a/drivers/md/md.c
> > +++ b/drivers/md/md.c
> > @@ -3912,7 +3912,7 @@ static struct md_sysfs_entry md_sync_speed = __ATTR_RO(sync_speed);
> >   static ssize_t
> >   sync_completed_show(mddev_t *mddev, char *page)
> >   {
> > -	unsigned long max_sectors, resync;
> > +	unsigned long long max_sectors, resync;
> >
> >   	if (!test_bit(MD_RECOVERY_RUNNING,&mddev->recovery))
> >   		return sprintf(page, "none\n");
> > @@ -3923,7 +3923,7 @@ sync_completed_show(mddev_t *mddev, char *page)
> >   		max_sectors = mddev->dev_sectors;
> >
> >   	resync = mddev->curr_resync_completed;
> > -	return sprintf(page, "%lu / %lu\n", resync, max_sectors);
> > +	return sprintf(page, "%llu / %llu\n", resync, max_sectors);
> >   }
> >
> >   static struct md_sysfs_entry md_sync_completed = __ATTR_RO(sync_completed);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2011-01-11 11:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 15:44 [PATCH] md: fix sync_completed reporting for very large drives (>2TB) Rémi Rérolle
2011-01-11 10:37 ` Rémi Rérolle
2011-01-11 11:01   ` NeilBrown [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=20110111220150.6444d493@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=remi.rerolle@gmail.com \
    --cc=rrerolle@lacie.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.