linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Eduard Hasenleithner <eduard@hasenleithner.at>,
	Dakshaja Uppalapati <dakshaja@chelsio.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"kbusch@kernel.org" <kbusch@kernel.org>
Cc: Potnuri Bharat Teja <bharat@chelsio.com>,
	Nirranjan Kirubaharan <nirranjan@chelsio.com>
Subject: Re: nvme blk_update_request IO error observed on formatting device with kernels 5.5-rc1 and above.
Date: Sat, 28 Dec 2019 01:01:03 -0800	[thread overview]
Message-ID: <00d16b98-fcd1-2439-b50f-ccc992bbf871@grimberg.me> (raw)
In-Reply-To: <0b33acdb-2b8c-2a06-3c6d-b978f9a760ad@hasenleithner.at>


>> I am trying to setup and run NVMF with tot linux kernel installed(5.5.0-rc3) on
>> both target and host. Attached is the target configuration using ramdisk device.
> 
>> The following error is seen in dmesg:
>> [  219.507989] blk_update_request: I/O error, dev nvme0c0n1, sector 0 op 0x3:(DISCARD) flags 0x4000800 phys_seg 1 prio class 0
> 
>> Please let me know if any info is needed further.
> 
> How big is the ramdisk?
> Are there further error messages in the kernel log?
> My current speculation is that it might fail in blk_cloned_rq_check_limits,
> but then there should be an additional error message,
>   e.g. "blk_cloned_rq_check_limits: over max size limit".

Its probably the target not expecting that dsm ranges payload doesn't
match the command sgl desc...

Does this untested patch help?
--
iff --git a/drivers/nvme/target/io-cmd-bdev.c 
b/drivers/nvme/target/io-cmd-bdev.c
index b6fca0e421ef..945dffc82503 100644
--- a/drivers/nvme/target/io-cmd-bdev.c
+++ b/drivers/nvme/target/io-cmd-bdev.c
@@ -280,8 +280,11 @@ static void nvmet_bdev_execute_discard(struct 
nvmet_req *req)

  static void nvmet_bdev_execute_dsm(struct nvmet_req *req)
  {
-       if (!nvmet_check_data_len(req, nvmet_dsm_len(req)))
+       if (unlikely(nvmet_dsm_len(req) > req->transfer_len)) {
+               req->error_loc = offsetof(struct nvme_common_command, dptr);
+               nvmet_req_complete(req, NVME_SC_SGL_INVALID_DATA | 
NVME_SC_DNR);
                 return;
+       }
--

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2019-12-28  9:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27 14:08 nvme blk_update_request IO error observed on formatting device with kernels 5.5-rc1 and above Dakshaja Uppalapati
2019-12-27 15:03 ` Eduard Hasenleithner
2019-12-28  9:01   ` Sagi Grimberg [this message]
2019-12-30 10:52     ` Dakshaja Uppalapati
2020-01-24  8:51       ` Dakshaja Uppalapati
2020-01-24 17:40         ` Sagi Grimberg

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=00d16b98-fcd1-2439-b50f-ccc992bbf871@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=bharat@chelsio.com \
    --cc=dakshaja@chelsio.com \
    --cc=eduard@hasenleithner.at \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nirranjan@chelsio.com \
    /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;
as well as URLs for NNTP newsgroup(s).