From: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
To: unlisted-recipients:; (no To-header on input)
Cc: mb@lightnvm.io, igor.j.konopko@intel.com,
Marcin Dziegielewski <marcin.dziegielewski@intel.com>,
Keith Busch <keith.busch@intel.com>, Jens Axboe <axboe@fb.com>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] nvme: lightnvm: expose OC devices as zero size to OS
Date: Thu, 14 Mar 2019 14:41:49 +0100 [thread overview]
Message-ID: <1552570910-11706-1-git-send-email-marcin.dziegielewski@intel.com> (raw)
Open channel devices are not able to handle traditional
IO requests addressed by LBA, so following current
approach to exposing special nvme devices as zero size
(e.g. with namespace formatted to use metadata) also
open channel devices should be exposed as zero size
to OS.
Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
---
drivers/nvme/host/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 07bf2bf..52cd5c8 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1606,7 +1606,8 @@ static void nvme_update_disk_info(struct gendisk *disk,
if (ns->ms && !ns->ext &&
(ns->ctrl->ops->flags & NVME_F_METADATA_SUPPORTED))
nvme_init_integrity(disk, ns->ms, ns->pi_type);
- if (ns->ms && !nvme_ns_has_pi(ns) && !blk_get_integrity(disk))
+ if ((ns->ms && !nvme_ns_has_pi(ns) && !blk_get_integrity(disk)) ||
+ ns->ndev)
capacity = 0;
set_capacity(disk, capacity);
--
1.8.3.1
next reply other threads:[~2019-03-14 13:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 13:41 Marcin Dziegielewski [this message]
2019-03-14 13:56 ` Matias Bjørling
2019-03-18 13:32 ` Marcin Dziegielewski
2019-03-25 10:56 ` Matias Bjørling
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=1552570910-11706-1-git-send-email-marcin.dziegielewski@intel.com \
--to=marcin.dziegielewski@intel.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=igor.j.konopko@intel.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=mb@lightnvm.io \
--cc=sagi@grimberg.me \
/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
all inboxes | Powered by JetHome®