From: Maurizio Lombardi <mlombard@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: kch@nvidia.com, linux-nvme@lists.infradead.org, sagi@grimberg.me
Subject: Re: [PATCH RFC] nvmet: fix tmpfs-based backstores support
Date: Sun, 21 Nov 2021 15:25:22 +0100 [thread overview]
Message-ID: <20211121142522.GA255554@raketa> (raw)
In-Reply-To: <20211119170233.GB15360@lst.de>
On Fri, Nov 19, 2021 at 06:02:33PM +0100, Christoph Hellwig wrote:
> The proper fix is to check if the file has FMODE_NOWAIT is set before
> using FMODE_NOWAIT for reads or writes, not to blindly disable it for
> reads.
>
Ah thanks for the info!
Now I see that filesystems that support NOWAIT set the FMODE_NOWAIT
flag in their open() functions.
So the correct patch should be the following:
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
index 1dd1a0fe2e81..bf3f440c98d5 100644
--- a/drivers/nvme/target/io-cmd-file.c
+++ b/drivers/nvme/target/io-cmd-file.c
@@ -266,6 +266,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);
I'm going to test it.
Maurizio
prev parent reply other threads:[~2021-11-21 14:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 15:24 [PATCH RFC] nvmet: fix tmpfs-based backstores support Maurizio Lombardi
2021-11-18 1:59 ` Chaitanya Kulkarni
2021-11-18 8:29 ` Maurizio Lombardi
2021-11-18 8:41 ` Chaitanya Kulkarni
2021-11-18 8:42 ` Chaitanya Kulkarni
2021-11-18 9:16 ` Maurizio Lombardi
2021-11-19 17:02 ` Christoph Hellwig
2021-11-21 14:25 ` Maurizio Lombardi [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=20211121142522.GA255554@raketa \
--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