nvme-5.12 is crashing with fabrics discover

Christoph Hellwig hch at lst.de
Thu Feb 11 13:22:27 EST 2021


On Thu, Feb 11, 2021 at 02:28:32AM -0800, Sagi Grimberg wrote:
> Hey,
>
> Started seeing nvme discovery crashing since commit:
> a7c7f7b2b641 ("nvme: use bio_set_dev to assign ->bi_bdev")
>
> Not yet sure what's going on, but reverting this commit
> makes the issue go away.

The patch below should fix it.  This came up before and I though I had
already queued up a patch from Keith for it, but it looks like it got lost:

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d77f3f26d8d387..4de6a3a135759d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1167,7 +1167,8 @@ static int nvme_submit_user_cmd(struct request_queue *q,
 		if (ret)
 			goto out;
 		bio = req->bio;
-		bio_set_dev(bio, bdev);
+		if (bdev)
+			bio_set_dev(bio, bdev);
 		if (bdev && meta_buffer && meta_len) {
 			meta = nvme_add_user_metadata(bio, meta_buffer, meta_len,
 					meta_seed, write);



More information about the Linux-nvme mailing list