From: Greg Kroah-Hartman Date: Tue, 18 Oct 2022 17:34:18 +0000 (+0200) Subject: drop nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_* X-Git-Tag: v6.0.3~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a610f8dfde1f69cd998b578dc2ae0a1bd52e099c;p=thirdparty%2Fkernel%2Fstable-queue.git drop nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_* --- diff --git a/queue-5.19/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch b/queue-5.19/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch deleted file mode 100644 index bcaf6a38772..00000000000 --- a/queue-5.19/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch +++ /dev/null @@ -1,56 +0,0 @@ -From aff72de372e9dbc6d7b66ce7c80d72890c36d667 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 27 Sep 2022 10:26:26 +0200 -Subject: nvmet: don't look at the request_queue in nvmet_bdev_set_limits - -From: Christoph Hellwig - -[ Upstream commit 84fe64f898913ef69f70a8d91aea613b5722b63b ] - -nvmet is a consumer of the block layer and should not directly look at -the request_queue. Use the bdev_ helpers to retrieve the device limits -instead. - -Signed-off-by: Christoph Hellwig -Reviewed-by: Keith Busch -Signed-off-by: Sasha Levin ---- - drivers/nvme/target/io-cmd-bdev.c | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - -diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c -index 27a72504d31c..521fe9469e08 100644 ---- a/drivers/nvme/target/io-cmd-bdev.c -+++ b/drivers/nvme/target/io-cmd-bdev.c -@@ -12,11 +12,9 @@ - - void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id) - { -- const struct queue_limits *ql = &bdev_get_queue(bdev)->limits; -- /* Number of logical blocks per physical block. */ -- const u32 lpp = ql->physical_block_size / ql->logical_block_size; - /* Logical blocks per physical block, 0's based. */ -- const __le16 lpp0b = to0based(lpp); -+ const __le16 lpp0b = to0based(bdev_physical_block_size(bdev) / -+ bdev_logical_block_size(bdev)); - - /* - * For NVMe 1.2 and later, bit 1 indicates that the fields NAWUN, -@@ -42,11 +40,12 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id) - /* NPWA = Namespace Preferred Write Alignment. 0's based */ - id->npwa = id->npwg; - /* NPDG = Namespace Preferred Deallocate Granularity. 0's based */ -- id->npdg = to0based(ql->discard_granularity / ql->logical_block_size); -+ id->npdg = to0based(bdev_discard_granularity(bdev) / -+ bdev_logical_block_size(bdev)); - /* NPDG = Namespace Preferred Deallocate Alignment */ - id->npda = id->npdg; - /* NOWS = Namespace Optimal Write Size */ -- id->nows = to0based(ql->io_opt / ql->logical_block_size); -+ id->nows = to0based(bdev_io_opt(bdev) / bdev_logical_block_size(bdev)); - } - - void nvmet_bdev_ns_disable(struct nvmet_ns *ns) --- -2.35.1 - diff --git a/queue-5.19/series b/queue-5.19/series index dc3db3ebacd..5229183a39a 100644 --- a/queue-5.19/series +++ b/queue-5.19/series @@ -780,7 +780,6 @@ nvme-copy-firmware_rev-on-each-init.patch nvmet-tcp-add-bounds-check-on-transfer-tag.patch usb-idmouse-fix-an-uninit-value-in-idmouse_open.patch blk-mq-use-quiesced-elevator-switch-when-reinitializ.patch -nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch hwmon-occ-retry-for-checksum-failure.patch fsi-occ-prevent-use-after-free.patch fsi-master-ast-cf-fix-missing-of_node_put-in-fsi_mas.patch diff --git a/queue-6.0/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch b/queue-6.0/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch deleted file mode 100644 index 4afc8369aec..00000000000 --- a/queue-6.0/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch +++ /dev/null @@ -1,45 +0,0 @@ -From a4c740795541b913fb1a6faa4544e04e5a8713b0 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 27 Sep 2022 10:24:07 +0200 -Subject: nvmet: don't look at the request_queue in - nvmet_bdev_zone_mgmt_emulate_all - -From: Christoph Hellwig - -[ Upstream commit 8df20252c06046ef4c68107bcaaca56c21028d8c ] - -nvmet is a consumer of the block layer and should not directly look at -the request_queue. Just use the NUMA node ID from the gendisk instead of -the request_queue. - -Signed-off-by: Christoph Hellwig -Reviewed-by: Keith Busch -Signed-off-by: Sasha Levin ---- - drivers/nvme/target/zns.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c -index 835bfda86fcf..1254cf57e008 100644 ---- a/drivers/nvme/target/zns.c -+++ b/drivers/nvme/target/zns.c -@@ -400,7 +400,6 @@ static u16 nvmet_bdev_zone_mgmt_emulate_all(struct nvmet_req *req) - { - struct block_device *bdev = req->ns->bdev; - unsigned int nr_zones = bdev_nr_zones(bdev); -- struct request_queue *q = bdev_get_queue(bdev); - struct bio *bio = NULL; - sector_t sector = 0; - int ret; -@@ -409,7 +408,7 @@ static u16 nvmet_bdev_zone_mgmt_emulate_all(struct nvmet_req *req) - }; - - d.zbitmap = kcalloc_node(BITS_TO_LONGS(nr_zones), sizeof(*(d.zbitmap)), -- GFP_NOIO, q->node); -+ GFP_NOIO, bdev->bd_disk->node_id); - if (!d.zbitmap) { - ret = -ENOMEM; - goto out; --- -2.35.1 - diff --git a/queue-6.0/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch-7526 b/queue-6.0/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch-7526 deleted file mode 100644 index 68569b43a8a..00000000000 --- a/queue-6.0/nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch-7526 +++ /dev/null @@ -1,56 +0,0 @@ -From 80dde9422c812c4c9ec7d79131da0603b27a9a34 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 27 Sep 2022 10:26:26 +0200 -Subject: nvmet: don't look at the request_queue in nvmet_bdev_set_limits - -From: Christoph Hellwig - -[ Upstream commit 84fe64f898913ef69f70a8d91aea613b5722b63b ] - -nvmet is a consumer of the block layer and should not directly look at -the request_queue. Use the bdev_ helpers to retrieve the device limits -instead. - -Signed-off-by: Christoph Hellwig -Reviewed-by: Keith Busch -Signed-off-by: Sasha Levin ---- - drivers/nvme/target/io-cmd-bdev.c | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - -diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c -index 2dc1c1035626..77c20c0db9d5 100644 ---- a/drivers/nvme/target/io-cmd-bdev.c -+++ b/drivers/nvme/target/io-cmd-bdev.c -@@ -12,11 +12,9 @@ - - void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id) - { -- const struct queue_limits *ql = &bdev_get_queue(bdev)->limits; -- /* Number of logical blocks per physical block. */ -- const u32 lpp = ql->physical_block_size / ql->logical_block_size; - /* Logical blocks per physical block, 0's based. */ -- const __le16 lpp0b = to0based(lpp); -+ const __le16 lpp0b = to0based(bdev_physical_block_size(bdev) / -+ bdev_logical_block_size(bdev)); - - /* - * For NVMe 1.2 and later, bit 1 indicates that the fields NAWUN, -@@ -42,11 +40,12 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id) - /* NPWA = Namespace Preferred Write Alignment. 0's based */ - id->npwa = id->npwg; - /* NPDG = Namespace Preferred Deallocate Granularity. 0's based */ -- id->npdg = to0based(ql->discard_granularity / ql->logical_block_size); -+ id->npdg = to0based(bdev_discard_granularity(bdev) / -+ bdev_logical_block_size(bdev)); - /* NPDG = Namespace Preferred Deallocate Alignment */ - id->npda = id->npdg; - /* NOWS = Namespace Optimal Write Size */ -- id->nows = to0based(ql->io_opt / ql->logical_block_size); -+ id->nows = to0based(bdev_io_opt(bdev) / bdev_logical_block_size(bdev)); - } - - void nvmet_bdev_ns_disable(struct nvmet_ns *ns) --- -2.35.1 - diff --git a/queue-6.0/series b/queue-6.0/series index abf04a138fa..d26f31b5aaa 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -868,8 +868,6 @@ nvme-copy-firmware_rev-on-each-init.patch nvmet-tcp-add-bounds-check-on-transfer-tag.patch usb-idmouse-fix-an-uninit-value-in-idmouse_open.patch blk-mq-use-quiesced-elevator-switch-when-reinitializ.patch -nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch -nvmet-don-t-look-at-the-request_queue-in-nvmet_bdev_.patch-7526 hwmon-occ-retry-for-checksum-failure.patch fsi-occ-prevent-use-after-free.patch fsi-master-ast-cf-fix-missing-of_node_put-in-fsi_mas.patch