From 0a5d8f0afb3d0f3b8a3f2746d71a14040cc3c99c Mon Sep 17 00:00:00 2001 From: Artur Paszkiewicz Date: Thu, 25 May 2023 14:02:00 +0200 Subject: [PATCH] raid5f: fix missing stripe_request release in xor error path Change-Id: Ibcdace7d88fa142f8923756c380b860abe4806a1 Signed-off-by: Artur Paszkiewicz Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/18387 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Community-CI: Mellanox Build Bot --- module/bdev/raid/raid5f.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/module/bdev/raid/raid5f.c b/module/bdev/raid/raid5f.c index 20f0aaa6c79..d164db7a9aa 100644 --- a/module/bdev/raid/raid5f.c +++ b/module/bdev/raid/raid5f.c @@ -159,16 +159,21 @@ static void raid5f_xor_stripe_retry(struct stripe_request *stripe_req); static void raid5f_xor_stripe_done(struct stripe_request *stripe_req) { + struct raid5f_io_channel *r5ch = stripe_req->r5ch; + if (stripe_req->xor.status != 0) { + struct raid_bdev_io *raid_io = stripe_req->raid_io; + SPDK_ERRLOG("stripe xor failed: %s\n", spdk_strerror(-stripe_req->xor.status)); - raid_bdev_io_complete(stripe_req->raid_io, SPDK_BDEV_IO_STATUS_FAILED); + raid5f_stripe_request_release(stripe_req); + raid_bdev_io_complete(raid_io, SPDK_BDEV_IO_STATUS_FAILED); } else { raid5f_stripe_request_submit_chunks(stripe_req); } - if (!TAILQ_EMPTY(&stripe_req->r5ch->xor_retry_queue)) { - stripe_req = TAILQ_FIRST(&stripe_req->r5ch->xor_retry_queue); - TAILQ_REMOVE(&stripe_req->r5ch->xor_retry_queue, stripe_req, link); + if (!TAILQ_EMPTY(&r5ch->xor_retry_queue)) { + stripe_req = TAILQ_FIRST(&r5ch->xor_retry_queue); + TAILQ_REMOVE(&r5ch->xor_retry_queue, stripe_req, link); raid5f_xor_stripe_retry(stripe_req); } }