From: Greg Kroah-Hartman Date: Tue, 1 Nov 2022 19:37:42 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v4.9.332~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c00c9051c9dfd1ca94a7881faa5038ead44c35ac;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: scsi-sd-revert-scsi-sd-remove-a-local-variable.patch --- diff --git a/queue-5.10/arm64-add-ampere1-to-the-spectre-bhb-affected-list.patch b/queue-5.10/arm64-add-ampere1-to-the-spectre-bhb-affected-list.patch index 21d18433940..803b1b1c0dd 100644 --- a/queue-5.10/arm64-add-ampere1-to-the-spectre-bhb-affected-list.patch +++ b/queue-5.10/arm64-add-ampere1-to-the-spectre-bhb-affected-list.patch @@ -18,12 +18,10 @@ Reviewed-by: James Morse Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- - 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 index 00000000000..b1330a4a897 --- /dev/null +++ b/queue-5.10/scsi-sd-revert-scsi-sd-remove-a-local-variable.patch @@ -0,0 +1,61 @@ +From yukuai1@huaweicloud.com Tue Nov 1 20:34:27 2022 +From: Yu Kuai +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 + +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 +Reviewed-by: Bart Van Assche +Signed-off-by: Greg Kroah-Hartman +--- + 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; + } diff --git a/queue-5.10/series b/queue-5.10/series index 6df539d6b53..bc5f68f603c 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -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