From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, kbusch@kernel.org,
sagi@grimberg.me, Chaitanya Kulkarni <kch@nvidia.com>
Subject: Re: [PATCH 0/3] nvmet: add buffered_io support for bdev-ns
Date: Wed, 26 Jan 2022 17:27:47 +0100 [thread overview]
Message-ID: <20220126162747.GB31431@lst.de> (raw)
In-Reply-To: <20220119072038.3942-1-chaitanyak@nvidia.com>
Shouldn't something like the patch below be all we need to use
buffered I/O on a block device?
diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c
index 70ca9dfc1771a..7d9da2f77b83a 100644
--- a/drivers/nvme/target/io-cmd-bdev.c
+++ b/drivers/nvme/target/io-cmd-bdev.c
@@ -76,6 +76,10 @@ int nvmet_bdev_ns_enable(struct nvmet_ns *ns)
{
int ret;
+ /* force fallback to the file backend for buffered I/O mode */
+ if (ns->buffered_io)
+ return -ENOTBLK;
+
ns->bdev = blkdev_get_by_path(ns->device_path,
FMODE_READ | FMODE_WRITE, NULL);
if (IS_ERR(ns->bdev)) {
next prev parent reply other threads:[~2022-01-26 17:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 7:20 [PATCH 0/3] nvmet: add buffered_io support for bdev-ns Chaitanya Kulkarni
2022-01-19 7:20 ` [PATCH 1/3] nvmet: add helper to set ns->blkshift value Chaitanya Kulkarni
2022-01-23 9:18 ` Sagi Grimberg
2022-01-23 23:37 ` Chaitanya Kulkarni
2022-01-19 7:20 ` [PATCH 2/3] nvmet: add helper to open block device Chaitanya Kulkarni
2022-01-19 7:20 ` [PATCH 3/3] nvmet: allow bdev in buffered_io mode Chaitanya Kulkarni
2022-01-26 16:27 ` Christoph Hellwig [this message]
2022-01-27 7:46 ` [PATCH 0/3] nvmet: add buffered_io support for bdev-ns Chaitanya Kulkarni
2022-01-27 8:04 ` Chaitanya Kulkarni
2022-01-27 10:07 ` Christoph Hellwig
2022-01-27 10:07 ` Christoph Hellwig
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=20220126162747.GB31431@lst.de \
--to=hch@lst.de \
--cc=chaitanyak@nvidia.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-nvme@lists.infradead.org \
--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 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.