Thread (5 messages) 5 messages, 4 authors, 2021-11-23

Re: [PATCH] nvmet: use IOCB_NOWAIT only if the filesystem supports it.

From: Sagi Grimberg <sagi@grimberg.me>
Date: 2021-11-22 11:35:51


On 11/22/21 12:08 PM, Maurizio Lombardi wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
---
  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);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help