From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C074E3DE45D; Mon, 4 May 2026 14:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777904782; cv=none; b=AAMRAzetkPbSGN0qfqobNPeSJHjyfoYT0+oOXX5y6BtEwkk/bK0CvMLqO189kAOssjJzP6+Ue8A3Iva8HbQGpA4S8tTOr7hZ5xaMoXzUEz1Eud+wrkJIZQhApB8uLfS+5g1NQ3vLNKSfbCqDpT9PkMl2wjgdcsifjuTPPDYFgLc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777904782; c=relaxed/simple; bh=17gwEeadF7Oyz2ujt0Q1d8w1Lqt0T7jHVAw1NaJwOtk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tDgTPbtZvpxM7Mt9BxFyxuVUgm+G/RpTr3RPKD4/2v/iFTkH4pn7YEgJg5pI3KoqSqamRuSE5ZbDJ//BuL6z6x4edMN9x4BNBMza47SBjaUW9p6zEwFzv4AlNLqtefgjiRLfykvLU0/xy7ji38PpD+FBVNvv4we6+3sU1tVjask= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kdx5C+cp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kdx5C+cp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54C38C2BCB8; Mon, 4 May 2026 14:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777904782; bh=17gwEeadF7Oyz2ujt0Q1d8w1Lqt0T7jHVAw1NaJwOtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kdx5C+cp2nrzrErixLjo/s3CkIzNOrSSbXmwp/ynRHhsdLQxMKN8Us5UsZFYRklKS Ax4k29V0DLQe3n3Ff8/UpI++k4TzWc2m+ZbSfICa5AdUjXMx/0I5+YsWmEdcOrHvFe L6AHDflX2Z3WxEsSAemimlqaL8iSsdpiU6HDAeVQ= 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 6.12 140/215] md/raid5: fix soft lockup in retry_aligned_read() Date: Mon, 4 May 2026 15:52:39 +0200 Message-ID: <20260504135135.268835105@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504135130.169210693@linuxfoundation.org> References: <20260504135130.169210693@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 @@ -6625,7 +6625,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;