From: Sasha Levin Date: Mon, 19 Feb 2024 20:58:52 +0000 (-0500) Subject: Fixes for 6.6 X-Git-Tag: v4.19.307~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=789062c7bb2bd17f4d82e10e16712970559c734b;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.6 Signed-off-by: Sasha Levin --- diff --git a/queue-6.6/block-fix-partial-zone-append-completion-handling-in.patch b/queue-6.6/block-fix-partial-zone-append-completion-handling-in.patch new file mode 100644 index 00000000000..7cc23d218d0 --- /dev/null +++ b/queue-6.6/block-fix-partial-zone-append-completion-handling-in.patch @@ -0,0 +1,58 @@ +From 229a06cbdead9f40d728c31e915c6cd729d1e86c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 10 Jan 2024 18:29:42 +0900 +Subject: block: fix partial zone append completion handling in req_bio_endio() + +From: Damien Le Moal + +[ Upstream commit 748dc0b65ec2b4b7b3dbd7befcc4a54fdcac7988 ] + +Partial completions of zone append request is not allowed but if a zone +append completion indicates a number of completed bytes different from +the original BIO size, only the BIO status is set to error. This leads +to bio_advance() not setting the BIO size to 0 and thus to not call +bio_endio() at the end of req_bio_endio(). + +Make sure a partially completed zone append is failed and completed +immediately by forcing the completed number of bytes (nbytes) to be +equal to the BIO size, thus ensuring that bio_endio() is called. + +Fixes: 297db731847e ("block: fix req_bio_endio append error handling") +Cc: stable@kernel.vger.org +Signed-off-by: Damien Le Moal +Reviewed-by: Christoph Hellwig +Reviewed-by: Johannes Thumshirn +Reviewed-by: Hannes Reinecke +Link: https://lore.kernel.org/r/20240110092942.442334-1-dlemoal@kernel.org +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/blk-mq.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/block/blk-mq.c b/block/blk-mq.c +index 257b0addd47e..d8b47f534df9 100644 +--- a/block/blk-mq.c ++++ b/block/blk-mq.c +@@ -767,11 +767,16 @@ static void req_bio_endio(struct request *rq, struct bio *bio, + /* + * Partial zone append completions cannot be supported as the + * BIO fragments may end up not being written sequentially. ++ * For such case, force the completed nbytes to be equal to ++ * the BIO size so that bio_advance() sets the BIO remaining ++ * size to 0 and we end up calling bio_endio() before returning. + */ +- if (bio->bi_iter.bi_size != nbytes) ++ if (bio->bi_iter.bi_size != nbytes) { + bio->bi_status = BLK_STS_IOERR; +- else ++ nbytes = bio->bi_iter.bi_size; ++ } else { + bio->bi_iter.bi_sector = rq->__sector; ++ } + } + + bio_advance(bio, nbytes); +-- +2.43.0 + diff --git a/queue-6.6/md-bypass-block-throttle-for-superblock-update.patch b/queue-6.6/md-bypass-block-throttle-for-superblock-update.patch new file mode 100644 index 00000000000..6fba60060ff --- /dev/null +++ b/queue-6.6/md-bypass-block-throttle-for-superblock-update.patch @@ -0,0 +1,48 @@ +From 68232e4f8f03af373ef8fe4f25f46c31026b4169 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 8 Nov 2023 10:22:15 -0800 +Subject: md: bypass block throttle for superblock update + +From: Junxiao Bi + +[ Upstream commit d6e035aad6c09991da1c667fb83419329a3baed8 ] + +commit 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") +introduced a hung bug and will be reverted in next patch, since the issue +that commit is fixing is due to md superblock write is throttled by wbt, +to fix it, we can have superblock write bypass block layer throttle. + +Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") +Cc: stable@vger.kernel.org # v5.19+ +Suggested-by: Yu Kuai +Signed-off-by: Junxiao Bi +Reviewed-by: Logan Gunthorpe +Reviewed-by: Yu Kuai +Signed-off-by: Song Liu +Link: https://lore.kernel.org/r/20231108182216.73611-1-junxiao.bi@oracle.com +Signed-off-by: Sasha Levin +--- + drivers/md/md.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/md/md.c b/drivers/md/md.c +index dccf270aa1b4..108590041db6 100644 +--- a/drivers/md/md.c ++++ b/drivers/md/md.c +@@ -940,9 +940,10 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, + return; + + bio = bio_alloc_bioset(rdev->meta_bdev ? rdev->meta_bdev : rdev->bdev, +- 1, +- REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | REQ_FUA, +- GFP_NOIO, &mddev->sync_set); ++ 1, ++ REQ_OP_WRITE | REQ_SYNC | REQ_IDLE | REQ_META ++ | REQ_PREFLUSH | REQ_FUA, ++ GFP_NOIO, &mddev->sync_set); + + atomic_inc(&rdev->nr_pending); + +-- +2.43.0 + diff --git a/queue-6.6/series b/queue-6.6/series index 936f89d95e7..1b78b5585f3 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -249,3 +249,5 @@ pmdomain-core-move-the-unused-cleanup-to-a-_sync-initcall.patch fs-proc-do_task_stat-move-thread_group_cputime_adjusted-outside-of-lock_task_sighand.patch tracing-fix-have_dynamic_ftrace_with_regs-ifdef.patch tracing-inform-kmemleak-of-saved_cmdlines-allocation.patch +md-bypass-block-throttle-for-superblock-update.patch +block-fix-partial-zone-append-completion-handling-in.patch