Re: [PATCH RFC] nvmet: fix tmpfs-based backstores support
From: Chaitanya Kulkarni <hidden>
Date: 2021-11-18 01:59:43
On 11/17/21 07:24, Maurizio Lombardi wrote:
External email: Use caution opening links or attachments
commit 50a909db36f2 ("nvmet: use IOCB_NOWAIT for file-ns buffered I/O")
optimized the read command behaviour when buffered file-nss/behaviour/behavior
configurations are used.
It issues the read commands with the IOCB_NOWAIT flag set to try
to access the data from the cache.
However, the patch was buggy because both read and write commands are
issued with IOCB_NOWAIT, this broke tmpfs-based backstores because tmpfs
doesn't accept write commands with IOCB_NOWAIT.
Fix this bug by restricting IOCB_NOWAIT to read commands only.
Fixes: 50a909db36f2 ("nvmet: use IOCB_NOWAIT for file-ns buffered I/O")
Signed-off-by: Maurizio Lombardi <redacted>We will need blktests for this. Also, can you share performance numbers with this patch and the errors that you are getting without this patch ?
quoted hunk ↗ jump to hunk
--- drivers/nvme/target/io-cmd-file.c | 1 + 1 file changed, 1 insertion(+)diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c index 6aa30f30b572..1d9b41190583 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->cmd->rw.opcode == nvme_cmd_read && nvmet_file_execute_io(req, IOCB_NOWAIT)) return; nvmet_file_submit_buffered_io(req); --2.27.0