From: Maurizio Lombardi <mlombard@redhat.com>
To: kch@nvidia.com
Cc: linux-nvme@lists.infradead.org, sagi@grimberg.me, hch@lst.de
Subject: [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it.
Date: Mon, 22 Nov 2021 11:08:27 +0100 [thread overview]
Message-ID: <20211122100827.290117-1-mlombard@redhat.com> (raw)
Submit I/O requests with the IOCB_NOWAIT flag set only if
the underlying filesystem supports it.
Fixes: 50a909db36f2 ("nvmet: use IOCB_NOWAIT for file-ns buffered I/O")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
drivers/nvme/target/io-cmd-file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
index 6aa30f30b572..136b14853ed7 100644
--- a/drivers/nvme/target/io-cmd-file.c
+++ b/drivers/nvme/target/io-cmd-file.c
@@ -8,6 +8,7 @@
#include <linux/uio.h>
#include <linux/falloc.h>
#include <linux/file.h>
+#include <linux/fs.h>
#include "nvmet.h"
#define NVMET_MAX_MPOOL_BVEC 16
@@ -266,6 +267,7 @@ static void nvmet_file_execute_rw(struct nvmet_req *req)
if (req->ns->buffered_io) {
if (likely(!req->f.mpool_alloc) &&
+ req->ns->file->f_mode & FMODE_NOWAIT &&
nvmet_file_execute_io(req, IOCB_NOWAIT))
return;
nvmet_file_submit_buffered_io(req);
--
2.27.0
next reply other threads:[~2021-11-22 11:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 10:08 Maurizio Lombardi [this message]
2021-11-22 10:21 ` [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it Sagi Grimberg
2021-11-22 12:51 ` Christoph Hellwig
2021-11-23 8:35 ` Chaitanya Kulkarni
2021-11-23 16:23 ` 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=20211122100827.290117-1-mlombard@redhat.com \
--to=mlombard@redhat.com \
--cc=hch@lst.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox