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 840E622F0F; Thu, 18 Jan 2024 11:02:24 +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=1705575744; cv=none; b=D5wLG3pt7wIJlbRfX14qK9ekMZ6A9T8b9LpwXFUoMYwE6CA6E6mCR730c3hbh3GrzFSgB1eKflmVtf2CaiYWebIoGgu7z6v7Dsm/sKhuhfcrnepJ9bjEccczXrpV9lakGzJuQ7rmF/IHIqFaLE5hdos6ZjWFcWwPoNoBL/u+1Hw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705575744; c=relaxed/simple; bh=O0pB9hu/W9EcFeuzfYXhAiRB+Hxg4QL3AAYYjWZIIqY=; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:User-Agent:X-stable: X-Patchwork-Hint:MIME-Version:Content-Transfer-Encoding; b=aphAjo8YhlKe7k9pX3Wwm7s69bWWO44PiKPdJTOh9V37+N0gfkzomRhEiWz376fwLKmKaFdmFV7S7MESq0zuoLGVWLwheoPZqRpsx4/X+fGk5qr1uD/qupesYXKmBA+zOxFYg+aecibyLiO8FYxjiQmyITAXNjattGZSKaPcLoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tkyiUF8G; 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="tkyiUF8G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC77DC433F1; Thu, 18 Jan 2024 11:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705575744; bh=O0pB9hu/W9EcFeuzfYXhAiRB+Hxg4QL3AAYYjWZIIqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkyiUF8GIcfK7qhsG72/7khVuKMZP+mMFVtHVtW0Ov/Hp4f/19qedrUSGsjwwqIB9 MXnyyqJImJ/hLmbkbPN+O8sihOzu3lTa2vnauqaxDM2RYKoCHbspuJv3JeKot46CHS Wsu825ixfCMWU/oys34QSSyMDSgLQzQbMM0GU+WU= 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 6.1 089/100] Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d" Date: Thu, 18 Jan 2024 11:49:37 +0100 Message-ID: <20240118104314.770809153@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240118104310.892180084@linuxfoundation.org> References: <20240118104310.892180084@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 6.1-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 @@ -6833,18 +6832,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);