From: kbusch@kernel.org (Keith Busch)
Subject: [PATCH v3 1/3] nvme: fail namespace revalidate if block size exceeds PAGE_SIZE
Date: Mon, 11 Mar 2019 15:21:37 -0600 [thread overview]
Message-ID: <20190311212136.GA11299@localhost.localdomain> (raw)
In-Reply-To: <20190311211608.16628-2-sagi@grimberg.me>
On Mon, Mar 11, 2019@02:16:06PM -0700, Sagi Grimberg wrote:
> -static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
> +static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
> {
> struct nvme_ns *ns = disk->private_data;
>
> @@ -1644,8 +1644,13 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
> * block layer can use before failing read/write for 0 capacity.
> */
> ns->lba_shift = id->lbaf[id->flbas & NVME_NS_FLBAS_LBA_MASK].ds;
> - if (ns->lba_shift == 0)
> + if (ns->lba_shift > 12) {
> + dev_err(ns->ctrl->device, "ns lba_shift %d not supported\n",
> + ns->lba_shift);
> + return -ENOTSUPP;
> + } else if (ns->lba_shift == 0) {
> ns->lba_shift = 9;
> + }
Instead of deleting the namespace, can we make this a 0-capacity block
device like we do with extended metadata formats? That will fence it off
from generic read/write where this would cause a problem, and I'd like
to use these namespaces in passthrough mode for product testing purposes.
next prev parent reply other threads:[~2019-03-11 21:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-11 21:16 [PATCH v3 0/3] Couple of fixes detected with blktests Sagi Grimberg
2019-03-11 21:16 ` [PATCH v3 1/3] nvme: fail namespace revalidate if block size exceeds PAGE_SIZE Sagi Grimberg
2019-03-11 21:21 ` Keith Busch [this message]
2019-03-11 22:02 ` Sagi Grimberg
2019-03-11 22:05 ` Keith Busch
2019-03-11 21:16 ` [PATCH v3 2/3] nvme: put ns_head ref if namespace fails allocation Sagi Grimberg
2019-03-11 21:16 ` [PATCH v3 3/3] nvmet-file: clamp-down file namespace lba_shift Sagi Grimberg
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=20190311212136.GA11299@localhost.localdomain \
--to=kbusch@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