From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54602282F23; Sat, 30 May 2026 18:29:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165797; cv=none; b=IQuY0UvG6dn2Ga8FAcPSWiR700NcLz6FIUOkOOpdzSRk7x3dG/Ds6ZC5tyoa3ggLTBic2X7jH3fsAbL0aj+LkYr9C1l8v0/G9l49lmFzR8W9hbnO43etc/D9lZ2Il9rJJ0+yi4iBIPr/3ANCWtaVzmLixrNJNVX2/FmBbStjfFo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165797; c=relaxed/simple; bh=5Mvsz75bNFM5HcVLJOONB3gjCtV/APBT7v1JPI3DvlA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZE3GOBxSukORObZL4PswzwXKjA1k6iffV8yh1g7HDrhGEc8hGvWSciBSLT+l4lvTQ6q0Mr4y3N59xxDtf+zZ4uaoY010Mmj7X0+vZcBs1tXtZtfxLUQrdwmeaC83/7JLwStocGUay9QzuKHUzDd+5pX5YzCWUCHuVADSdFJ4IT8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CIxqYoYb; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CIxqYoYb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61BDC1F00893; Sat, 30 May 2026 18:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780165796; bh=Iq25MBno3DtJJahEOkluKnCQvAGGWpt0JY/56bbt+nU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CIxqYoYbzUdjq+rLI0iHPlyNUERWKwAwt4aHD/scPFAXC3XzJ5fray5OxsqaqOhrv /I4FKq/jC2aOaE7JveB79vfjyOB4jOanKVuDvuHD1ggY+39Z+kJrB1etjLp1l466JI vkanm3ggLsUjXZ0ae0EDwi0f23679mNeOvHP7aEw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, FengWei Shih , Chia-Ming Chang , Yu Kuai Subject: [PATCH 5.10 185/589] md/raid5: fix soft lockup in retry_aligned_read() Date: Sat, 30 May 2026 18:01:06 +0200 Message-ID: <20260530160229.751524818@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160224.570625122@linuxfoundation.org> References: <20260530160224.570625122@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chia-Ming Chang commit 7f9f7c697474268d9ef9479df3ddfe7cdcfbbffc upstream. When retry_aligned_read() encounters an overlapped stripe, it releases the stripe via raid5_release_stripe() which puts it on the lockless released_stripes llist. In the next raid5d loop iteration, release_stripe_list() drains the stripe onto handle_list (since STRIPE_HANDLE is set by the original IO), but retry_aligned_read() runs before handle_active_stripes() and removes the stripe from handle_list via find_get_stripe() -> list_del_init(). This prevents handle_stripe() from ever processing the stripe to resolve the overlap, causing an infinite loop and soft lockup. Fix this by using __release_stripe() with temp_inactive_list instead of raid5_release_stripe() in the failure path, so the stripe does not go through the released_stripes llist. This allows raid5d to break out of its loop, and the overlap will be resolved when the stripe is eventually processed by handle_stripe(). Fixes: 773ca82fa1ee ("raid5: make release_stripe lockless") Cc: stable@vger.kernel.org Signed-off-by: FengWei Shih Signed-off-by: Chia-Ming Chang Link: https://lore.kernel.org/linux-raid/20260402061406.455755-1-chiamingc@synology.com/ Signed-off-by: Yu Kuai Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid5.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -6349,7 +6349,13 @@ static int retry_aligned_read(struct r5 } if (!add_stripe_bio(sh, raid_bio, dd_idx, 0, 0)) { - raid5_release_stripe(sh); + int hash; + + spin_lock_irq(&conf->device_lock); + hash = sh->hash_lock_index; + __release_stripe(conf, sh, + &conf->temp_inactive_list[hash]); + spin_unlock_irq(&conf->device_lock); conf->retry_read_aligned = raid_bio; conf->retry_read_offset = scnt; return handled;