* [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it.
@ 2021-11-22 10:08 Maurizio Lombardi
2021-11-22 10:21 ` Sagi Grimberg
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Maurizio Lombardi @ 2021-11-22 10:08 UTC (permalink / raw)
To: kch; +Cc: linux-nvme, sagi, hch
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it.
2021-11-22 10:08 [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it Maurizio Lombardi
@ 2021-11-22 10:21 ` Sagi Grimberg
2021-11-22 12:51 ` Christoph Hellwig
2021-11-23 8:35 ` Chaitanya Kulkarni
2021-11-23 16:23 ` Christoph Hellwig
2 siblings, 1 reply; 5+ messages in thread
From: Sagi Grimberg @ 2021-11-22 10:21 UTC (permalink / raw)
To: Maurizio Lombardi, kch; +Cc: linux-nvme, hch
On 11/22/21 12:08 PM, Maurizio Lombardi wrote:
> 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))
I'd suggest to fix the alignment if we are touching this.
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);
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it.
2021-11-22 10:21 ` Sagi Grimberg
@ 2021-11-22 12:51 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2021-11-22 12:51 UTC (permalink / raw)
To: Sagi Grimberg; +Cc: Maurizio Lombardi, kch, linux-nvme, hch
On Mon, Nov 22, 2021 at 12:21:46PM +0200, Sagi Grimberg wrote:
> I'd suggest to fix the alignment if we are touching this.
> if (likely(!req->f.mpool_alloc) &&
> req->ns->file->f_mode & FMODE_NOWAIT &&
> nvmet_file_execute_io(req, IOCB_NOWAIT))
I had the same though and wil fix this up when applying the patch.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it.
2021-11-22 10:08 [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it Maurizio Lombardi
2021-11-22 10:21 ` Sagi Grimberg
@ 2021-11-23 8:35 ` Chaitanya Kulkarni
2021-11-23 16:23 ` Christoph Hellwig
2 siblings, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2021-11-23 8:35 UTC (permalink / raw)
To: Maurizio Lombardi, Chaitanya Kulkarni; +Cc: linux-nvme, sagi, hch
On 11/22/21 02:08, Maurizio Lombardi wrote:
> External email: Use caution opening links or attachments
>
>
> 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>
> ---
With Sagi's comment, looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it.
2021-11-22 10:08 [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it Maurizio Lombardi
2021-11-22 10:21 ` Sagi Grimberg
2021-11-23 8:35 ` Chaitanya Kulkarni
@ 2021-11-23 16:23 ` Christoph Hellwig
2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2021-11-23 16:23 UTC (permalink / raw)
To: Maurizio Lombardi; +Cc: kch, linux-nvme, sagi, hch
Thanks,
applied to nvme-5.16.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-11-23 16:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 10:08 [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it Maurizio Lombardi
2021-11-22 10:21 ` Sagi Grimberg
2021-11-22 12:51 ` Christoph Hellwig
2021-11-23 8:35 ` Chaitanya Kulkarni
2021-11-23 16:23 ` Christoph Hellwig
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.