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 7B78D14533E; Sun, 28 Jul 2024 00:48:55 +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=1722127735; cv=none; b=PWxO6MlemJXCbDT9LrvlcscKBi9QRF34hc0W/SI80LLIbMLySVy0jsJTe8l9hrlwLuC7zG1/RZ8UGDdkR6Pbx0ezOynzKT7KRxhuZ/6cIIDJK4fcOKEDEwYco1/chp68JfUSOwpTL8cMCkWK4Sml5cdGy8Wej1JpSecZa0rLjsU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722127735; c=relaxed/simple; bh=1izqwVGk60g+18bNbfxFvQC1pXldUL88StacOO05SUA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S28sRNirOoVrQqOztxeZepocpdxTgk4+ANnTWnlxDegpdJKxKKq5WYQqjf4gjbAcbodWbaGyrsfqjFjFqHc1FGD/ijsJ4ZLSCGGdjXpmsqAPf2Zc+dWbr1K7pfleyZNdTAKDspAJo6w3TBC/+S9Jxusa454uHZsAORRNtt8hGxk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BvmZ6ZPi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BvmZ6ZPi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68AA4C32781; Sun, 28 Jul 2024 00:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722127735; bh=1izqwVGk60g+18bNbfxFvQC1pXldUL88StacOO05SUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BvmZ6ZPiWE1nZ4Px+xZK/dle0zy/zvJCQUFsbojnB9oigUamo8xMLpdrNPJW1dll8 kF7Uy60CtUQCMgCzEKkac58j+lYgwr6xhwe/hx+7R7Z3dxhuHf4YKInGOJmlnMqjn5 adqYddOpA+TYzMs+xqKbz4zJe0eh1e9BSY1c5Je2OEQl4BdQNvqFPjK9MWA98YjAzy vKTEFNf3zfHrGvNO7+J3insH+GHBs0B3Mxkr2Mv/R5G73n5JIh+iAh30ICNyw+jCpF CxTqCWLrZiXGO2LG26k9F+EfclyinFubS2HIs7LYr4ImlWJc31Oty/Xy5uKI6TrMSJ iRQW5GcXJk7UA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Li Nan , Yu Kuai , Song Liu , Sasha Levin , linux-raid@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 3/6] md: do not delete safemode_timer in mddev_suspend Date: Sat, 27 Jul 2024 20:48:44 -0400 Message-ID: <20240728004848.1703616-3-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240728004848.1703616-1-sashal@kernel.org> References: <20240728004848.1703616-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.164 Content-Transfer-Encoding: 8bit From: Li Nan [ Upstream commit a8768a134518e406d41799a3594aeb74e0889cf7 ] The deletion of safemode_timer in mddev_suspend() is redundant and potentially harmful now. If timer is about to be woken up but gets deleted, 'in_sync' will remain 0 until the next write, causing array to stay in the 'active' state instead of transitioning to 'clean'. Commit 0d9f4f135eb6 ("MD: Add del_timer_sync to mddev_suspend (fix nasty panic))" introduced this deletion for dm, because if timer fired after dm is destroyed, the resource which the timer depends on might have been freed. However, commit 0dd84b319352 ("md: call __md_stop_writes in md_stop") added __md_stop_writes() to md_stop(), which is called before freeing resource. Timer is deleted in __md_stop_writes(), and the origin issue is resolved. Therefore, delete safemode_timer can be removed safely now. Signed-off-by: Li Nan Reviewed-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20240508092053.1447930-1-linan666@huaweicloud.com Signed-off-by: Sasha Levin --- drivers/md/md.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 45ef1ddd2bd03..5b6c366587d54 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -509,7 +509,6 @@ void mddev_suspend(struct mddev *mddev) clear_bit_unlock(MD_ALLOW_SB_UPDATE, &mddev->flags); wait_event(mddev->sb_wait, !test_bit(MD_UPDATING_SB, &mddev->flags)); - del_timer_sync(&mddev->safemode_timer); /* restrict memory reclaim I/O during raid array is suspend */ mddev->noio_flag = memalloc_noio_save(); } -- 2.43.0