]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Nov 2022 19:37:42 +0000 (20:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Nov 2022 19:37:42 +0000 (20:37 +0100)
added patches:
scsi-sd-revert-scsi-sd-remove-a-local-variable.patch

queue-5.10/arm64-add-ampere1-to-the-spectre-bhb-affected-list.patch
queue-5.10/scsi-sd-revert-scsi-sd-remove-a-local-variable.patch [new file with mode: 0644]
queue-5.10/series

index 21d1843394005b47d86a123683f17d500bd44549..803b1b1c0dd2019186c2361300903b2bc671017c 100644 (file)
@@ -18,12 +18,10 @@ Reviewed-by: James Morse <james.morse@arm.com>
 Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- arch/arm64/include/asm/cputype.h | 4 ++++
- arch/arm64/kernel/proton-pack.c  | 6 ++++++
+ arch/arm64/include/asm/cputype.h |    4 ++++
+ arch/arm64/kernel/proton-pack.c  |    6 ++++++
  2 files changed, 10 insertions(+)
 
-diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
-index 39f5c1672f48..457b6bb276bb 100644
 --- a/arch/arm64/include/asm/cputype.h
 +++ b/arch/arm64/include/asm/cputype.h
 @@ -60,6 +60,7 @@
@@ -51,8 +49,6 @@ index 39f5c1672f48..457b6bb276bb 100644
  
  /* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */
  #define MIDR_FUJITSU_ERRATUM_010001           MIDR_FUJITSU_A64FX
-diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
-index 6ae53d8cd576..faa8a6bf2376 100644
 --- a/arch/arm64/kernel/proton-pack.c
 +++ b/arch/arm64/kernel/proton-pack.c
 @@ -876,6 +876,10 @@ u8 spectre_bhb_loop_affected(int scope)
@@ -75,6 +71,3 @@ index 6ae53d8cd576..faa8a6bf2376 100644
                else if (is_midr_in_range_list(read_cpuid_id(), spectre_bhb_k8_list))
                        k =  8;
  
--- 
-2.35.1
-
diff --git a/queue-5.10/scsi-sd-revert-scsi-sd-remove-a-local-variable.patch b/queue-5.10/scsi-sd-revert-scsi-sd-remove-a-local-variable.patch
new file mode 100644 (file)
index 0000000..b1330a4
--- /dev/null
@@ -0,0 +1,61 @@
+From yukuai1@huaweicloud.com  Tue Nov  1 20:34:27 2022
+From: Yu Kuai <yukuai1@huaweicloud.com>
+Date: Tue,  1 Nov 2022 09:31:24 +0800
+Subject: scsi: sd: Revert "scsi: sd: Remove a local variable"
+To: gregkh@linuxfoundation.org, stable@vger.kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com, hare@suse.com, bvanassche@acm.org
+Cc: linux-scsi@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com
+Message-ID: <20221101013124.2615274-1-yukuai1@huaweicloud.com>
+
+From: Yu Kuai <yukuai3@huawei.com>
+
+This reverts commit 84f7a9de0602704bbec774a6c7f7c8c4994bee9c.
+
+Because it introduces a problem that rq->__data_len is set to the wrong
+value.
+
+before the patch:
+1) nr_bytes = rq->__data_len
+2) rq->__data_len = sdp->sector_size
+3) scsi_init_io()
+4) rq->__data_len = nr_bytes
+
+after the patch:
+1) rq->__data_len = sdp->sector_size
+2) scsi_init_io()
+3) rq->__data_len = rq->__data_len -> __data_len is wrong
+
+It will cause that io can only complete one segment each time, and the io
+will requeue in scsi_io_completion_action(), which will cause severe
+performance degradation.
+
+Scsi write same is removed in commit e383e16e84e9 ("scsi: sd: Remove
+WRITE_SAME support") from mainline, hence this patch is only needed for
+stable kernels.
+
+Fixes: 84f7a9de0602 ("scsi: sd: Remove a local variable")
+Signed-off-by: Yu Kuai <yukuai3@huawei.com>
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/sd.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -1074,6 +1074,7 @@ static blk_status_t sd_setup_write_same_
+       struct bio *bio = rq->bio;
+       u64 lba = sectors_to_logical(sdp, blk_rq_pos(rq));
+       u32 nr_blocks = sectors_to_logical(sdp, blk_rq_sectors(rq));
++      unsigned int nr_bytes = blk_rq_bytes(rq);
+       blk_status_t ret;
+       if (sdkp->device->no_write_same)
+@@ -1110,7 +1111,7 @@ static blk_status_t sd_setup_write_same_
+        */
+       rq->__data_len = sdp->sector_size;
+       ret = scsi_alloc_sgtables(cmd);
+-      rq->__data_len = blk_rq_bytes(rq);
++      rq->__data_len = nr_bytes;
+       return ret;
+ }
index 6df539d6b53c2a5d292528ce2c1c823758b6d78f..bc5f68f603cf4524772c81ee6c6fe7ed89b8d333 100644 (file)
@@ -85,3 +85,4 @@ net-mlx5-fix-possible-use-after-free-in-async-comman.patch
 net-mlx5-fix-crash-during-sync-firmware-reset.patch
 net-enetc-survive-memory-pressure-without-crashing.patch
 arm64-add-ampere1-to-the-spectre-bhb-affected-list.patch
+scsi-sd-revert-scsi-sd-remove-a-local-variable.patch