Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: axboe@kernel.dk (Jens Axboe)
Subject: [PATCH] NVMe: Fix VPD B0 max sectors translation
Date: Thu, 23 Apr 2015 10:43:15 -0600	[thread overview]
Message-ID: <55392123.3090508@kernel.dk> (raw)
In-Reply-To: <1429806285-11418-1-git-send-email-keith.busch@intel.com>

On 04/23/2015 10:24 AM, Keith Busch wrote:
> Use the namespace's block format for reporting the max transfer length.
>
> Max unmap count is left as-is since NVMe doesn't provide a max, so the
> value the driver provided the block layer is valid for any format.
>
> Reported-by: Martin K. Petersen <martin.petersen at oracle.com>
> Signed-off-by: Keith Busch <keith.busch at intel.com>
> ---
>   drivers/block/nvme-scsi.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/nvme-scsi.c b/drivers/block/nvme-scsi.c
> index 6b736b0..88f13c5 100644
> --- a/drivers/block/nvme-scsi.c
> +++ b/drivers/block/nvme-scsi.c
> @@ -944,7 +944,8 @@ static int nvme_trans_ext_inq_page(struct nvme_ns *ns, struct sg_io_hdr *hdr,
>   static int nvme_trans_bdev_limits_page(struct nvme_ns *ns, struct sg_io_hdr *hdr,
>   					u8 *inq_response, int alloc_len)
>   {
> -	__be32 max_sectors = cpu_to_be32(queue_max_hw_sectors(ns->queue));
> +	__be32 max_sectors = cpu_to_be32(
> +		nvme_block_nr(ns, queue_max_hw_sectors(ns->queue)));
>   	__be32 max_discard = cpu_to_be32(ns->queue->limits.max_discard_sectors);
>   	__be32 discard_desc_count = cpu_to_be32(0x100);

Applied for 4.1, thanks.

-- 
Jens Axboe

      reply	other threads:[~2015-04-23 16:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 16:24 [PATCH] NVMe: Fix VPD B0 max sectors translation Keith Busch
2015-04-23 16:43 ` Jens Axboe [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=55392123.3090508@kernel.dk \
    --to=axboe@kernel.dk \
    /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