From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2] sd: Fix excessive capacity printing on devices with blocks bigger than 512 bytes
Date: Wed, 30 Mar 2016 10:06:25 +0200 [thread overview]
Message-ID: <56FB8901.2040600@suse.de> (raw)
In-Reply-To: <1459214336-12668-1-git-send-email-martin.petersen@oracle.com>
On 03/29/2016 03:18 AM, Martin K. Petersen wrote:
> During revalidate we check whether device capacity has changed before we
> decide whether to output disk information or not.
>
> The check for old capacity failed to take into account that we scaled
> sdkp->capacity based on the reported logical block size. And therefore
> the capacity test would always fail for devices with sectors bigger than
> 512 bytes and we would print several copies of the same discovery
> information.
>
> Avoid scaling sdkp->capacity and instead adjust the value on the fly
> when setting the block device capacity and generating fake C/H/S
> geometry.
>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> Reported-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/scsi/sd.c | 28 ++++++++--------------------
> drivers/scsi/sd.h | 7 ++++++-
> 2 files changed, 14 insertions(+), 21 deletions(-)
>
After some testing I do prefer this version over mine.
Especially as I need the exported version of logical_to_sectors for
my SMR patchset :-)
So:
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-03-30 8:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-21 12:27 [PATCH] sd: fixup capacity calculation for 4k drives Hannes Reinecke
2016-03-21 14:31 ` Christoph Hellwig
2016-03-22 1:16 ` Martin K. Petersen
2016-03-22 6:55 ` Christoph Hellwig
2016-03-22 7:14 ` Hannes Reinecke
2016-03-22 14:16 ` Ewan D. Milne
2016-03-29 1:14 ` Martin K. Petersen
2016-03-29 1:18 ` [PATCH v2] sd: Fix excessive capacity printing on devices with blocks bigger than 512 bytes Martin K. Petersen
2016-03-30 8:06 ` Hannes Reinecke [this message]
2016-03-30 16:34 ` Ewan D. Milne
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=56FB8901.2040600@suse.de \
--to=hare@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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.