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 5E3AC1C3E; Tue, 23 Jan 2024 01:09:21 +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=1705972161; cv=none; b=q2K+9Gu+9rfjgcuecAduGB63235f79AKQEV75kBCDUlaCCT9Bzmgg2z9/tayPSR22591XJefZCKShAxkE53YSgJFOXMw+eHwdztfhSdDtVkNG7WgEgmeuQH4/6SQ0nWGBhbwxk2Pyh9VEck2sONRSdzQpFneh/OGODez80UcR08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705972161; c=relaxed/simple; bh=KeNmkEz2Ft96mrh9I+zLY0MrxVT2JiSkf1ibrNIVkfM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rulpTGLaiTPmX1VRAK67Kv+j9q4fpuxVUWrIJA4sNVd5KnyWcg2JHDf6yXlMjCGL2COekbtGsxAOwT2zDUNy6EdZGFCn+953iuCUxY2Hitd12qVT4B459biHufA7R0//57DFJlYiifH/voW66k40RXlxRyhhj1JdvqNYIpvPJJA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2KuRgU4G; 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="2KuRgU4G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19C9CC43394; Tue, 23 Jan 2024 01:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705972161; bh=KeNmkEz2Ft96mrh9I+zLY0MrxVT2JiSkf1ibrNIVkfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2KuRgU4Gqoz/A0phwjM25QLmqLLU7giTUwJsGdNTdfnw3QuXI06mVLYnmvCuf5IgM woDvAmM/F1ToVZbATBcHF0NFnBD62ZaFcCJ8kPtsgWlgJFbFmmse/TlbFvvxLuVHZc Kcv9fpPhv4l3ZFUReeunt3Sl2JNo8XuKLy/CVQW4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Junxiao Bi , Yu Kuai , Song Liu Subject: [PATCH 5.15 054/374] Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d" Date: Mon, 22 Jan 2024 15:55:10 -0800 Message-ID: <20240122235746.485418799@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122235744.598274724@linuxfoundation.org> References: <20240122235744.598274724@linuxfoundation.org> User-Agent: quilt/0.67 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Junxiao Bi commit bed9e27baf52a09b7ba2a3714f1e24e17ced386d upstream. This reverts commit 5e2cf333b7bd5d3e62595a44d598a254c697cd74. That commit introduced the following race and can cause system hung. md_write_start: raid5d: // mddev->in_sync == 1 set "MD_SB_CHANGE_PENDING" // running before md_write_start wakeup it waiting "MD_SB_CHANGE_PENDING" cleared >>>>>>>>> hung wakeup mddev->thread ... waiting "MD_SB_CHANGE_PENDING" cleared >>>> hung, raid5d should clear this flag but get hung by same flag. The issue reverted commit fixing is fixed by last patch in a new way. Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") Cc: stable@vger.kernel.org # v5.19+ Signed-off-by: Junxiao Bi Reviewed-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231108182216.73611-2-junxiao.bi@oracle.com Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid5.c | 12 ------------ 1 file changed, 12 deletions(-) --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -36,7 +36,6 @@ */ #include -#include #include #include #include @@ -6522,18 +6521,7 @@ static void raid5d(struct md_thread *thr spin_unlock_irq(&conf->device_lock); md_check_recovery(mddev); spin_lock_irq(&conf->device_lock); - - /* - * Waiting on MD_SB_CHANGE_PENDING below may deadlock - * seeing md_check_recovery() is needed to clear - * the flag when using mdmon. - */ - continue; } - - wait_event_lock_irq(mddev->sb_wait, - !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags), - conf->device_lock); } pr_debug("%d stripes handled\n", handled);