From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75AE0C433FE for ; Wed, 23 Nov 2022 12:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237842AbiKWMqG (ORCPT ); Wed, 23 Nov 2022 07:46:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237746AbiKWMpF (ORCPT ); Wed, 23 Nov 2022 07:45:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 890D960E7; Wed, 23 Nov 2022 04:42:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 31302B81F5E; Wed, 23 Nov 2022 12:42:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28243C433B5; Wed, 23 Nov 2022 12:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669207350; bh=xpvXkyQlEKmboJ7ilPWe03Vcs70M+1dNdMMgtpK8SWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UjcuYQZtYEZU8ocICziILrCHyfhLXO6NmG4buMNFvHoqtc3MABwdpAEH63ULs1cKJ mNWMyMh1ISSp2UxWQPbIu01wr9wiE72CY6+99HMym/DQl2DrHRFbLeV0MBDN9nkXhd tdArOnfa9UpgTtdUvRFqrVoQvqxzJGjSalXPGX0FfVx3WFcDkMcP03qACtFesaHjMp pnyEetTjQrVIprv2lSN4GoQsbZ3dcex5ebqMC/w0+t5r0COCpP9/1LAbQANBRJSrgI H9VV+Ji+6fpZpLn532/IE1RzkSaPNMaeTKAhuvaebo1LgGtQOXNgdPTNADM5c6y3yC 91497+8APbE/g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mikulas Patocka , Mike Snitzer , Sasha Levin , agk@redhat.com, dm-devel@redhat.com Subject: [PATCH AUTOSEL 6.0 43/44] dm integrity: flush the journal on suspend Date: Wed, 23 Nov 2022 07:40:52 -0500 Message-Id: <20221123124057.264822-43-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221123124057.264822-1-sashal@kernel.org> References: <20221123124057.264822-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka [ Upstream commit 5e5dab5ec763d600fe0a67837dd9155bdc42f961 ] This commit flushes the journal on suspend. It is prerequisite for the next commit that enables activating dm integrity devices in read-only mode. Note that we deliberately didn't flush the journal on suspend, so that the journal replay code would be tested. However, the dm-integrity code is 5 years old now, so that journal replay is well-tested, and we can make this change now. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-integrity.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index e1e7b205573f..f26a6cd09e0c 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -2591,10 +2591,6 @@ static void integrity_writer(struct work_struct *w) unsigned prev_free_sectors; - /* the following test is not needed, but it tests the replay code */ - if (unlikely(dm_post_suspending(ic->ti)) && !ic->meta_dev) - return; - spin_lock_irq(&ic->endio_wait.lock); write_start = ic->committed_section; write_sections = ic->n_committed_sections; @@ -3101,8 +3097,7 @@ static void dm_integrity_postsuspend(struct dm_target *ti) drain_workqueue(ic->commit_wq); if (ic->mode == 'J') { - if (ic->meta_dev) - queue_work(ic->writer_wq, &ic->writer_work); + queue_work(ic->writer_wq, &ic->writer_work); drain_workqueue(ic->writer_wq); dm_integrity_flush_buffers(ic, true); } -- 2.35.1