Commit c024b226 authored by Maurizio Lombardi's avatar Maurizio Lombardi Committed by Christoph Hellwig

nvmet: use IOCB_NOWAIT only if the filesystem supports it

Submit I/O requests with the IOCB_NOWAIT flag set only if
the underlying filesystem supports it.

Fixes: 50a909db ("nvmet: use IOCB_NOWAIT for file-ns buffered I/O")
Signed-off-by: default avatarMaurizio Lombardi <mlombard@redhat.com>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 00b33cf3
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/uio.h> #include <linux/uio.h>
#include <linux/falloc.h> #include <linux/falloc.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/fs.h>
#include "nvmet.h" #include "nvmet.h"
#define NVMET_MAX_MPOOL_BVEC 16 #define NVMET_MAX_MPOOL_BVEC 16
...@@ -266,6 +267,7 @@ static void nvmet_file_execute_rw(struct nvmet_req *req) ...@@ -266,6 +267,7 @@ static void nvmet_file_execute_rw(struct nvmet_req *req)
if (req->ns->buffered_io) { if (req->ns->buffered_io) {
if (likely(!req->f.mpool_alloc) && if (likely(!req->f.mpool_alloc) &&
(req->ns->file->f_mode & FMODE_NOWAIT) &&
nvmet_file_execute_io(req, IOCB_NOWAIT)) nvmet_file_execute_io(req, IOCB_NOWAIT))
return; return;
nvmet_file_submit_buffered_io(req); nvmet_file_submit_buffered_io(req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment