Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7736382rwl; Thu, 23 Mar 2023 08:07:22 -0700 (PDT) Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=d2sPERhF; dkim=neutral (no key) header.i=@suse.cz X-Google-Smtp-Source: AK7set/8BQ7WC2aDO8f2/o0JTfDeoIVRYtuPtN2oqxj8adE9mBKzoJL3y+8la4g1QZBlX9HE1QZq X-Received: by 2002:a17:90b:38c5:b0:23f:81de:6a77 with SMTP id nn5-20020a17090b38c500b0023f81de6a77mr8102903pjb.28.1679584042624; Thu, 23 Mar 2023 08:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679584042; cv=none; d=google.com; s=arc-20160816; b=baAjlmXDqY4CZT9oH3gXFpQx8Eu7gkpBYAJOBKi5R7WR2cNI9z4UK6LzGd1dQp9zyu QDN0ZL+/r2QCbBJ7w/mC07VBTAWBHnvB8BGgNH/KGXtRw06Zi1PIwFs6kUPAxEUHdGgT zrmm7zD2fjYu476E3aUZ0eI2JTEFRcj9FdxMGmd5PfceTL/nuCpamnTRVKCB75alkZr7 7R7/EFCdQ+KuxXjp/4hhVsXmBxXxgAS/siqJctaM7GtrBouH2ie4kbOu9dDKs0vUeDnu Q4Amr/4FA46mqL8wCwN1yRQ+nvbEXSjw/KqZALeCBnNkM1zCKCJ6N5v4mB3/wGjaTFQ/ BU6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=0dmk5Q4C3guQmEpiXuzzzuPN4hd6KwB+S4yuEEvg06U=; b=J428mwnGDVAs+pTIXbQaDcEpFkq9ak37JLZMDQoKFN8SOCWzaLNEXkpm5MDrpM9NLe WjhOcSzdmUIc5M6MqThHnZDCUtV3oGhGZjMfavjLTXUBR0ZZxgMBQ5qwSEgZJInF6eXX Ywx2CSFxpghRszx2Jr2lc7LtpBN1oePpCsz7PdsJmtSonuyqmH8ML4GaUAMxz7FRByGg rKBtXRAOVpvXwuofhiwYHOiONvpP/7JchF/MKTVqnNt69KNq7mH4uF4NJ8jJxY7dWH8o epaJ9C+lKPWGJEgcK5Riz8k4x5vakkWAu49Asei4BVFH/U3QnCbbUxsQbOc0DcI9nzgX s+1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=d2sPERhF; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lt3-20020a17090b354300b00230c8e3ed4bsi1951700pjb.24.2023.03.23.08.07.07; Thu, 23 Mar 2023 08:07:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=d2sPERhF; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231273AbjCWOyL (ORCPT + 99 others); Thu, 23 Mar 2023 10:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231916AbjCWOyJ (ORCPT ); Thu, 23 Mar 2023 10:54:09 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B806C17CF9 for ; Thu, 23 Mar 2023 07:54:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 84AFB1FE58; Thu, 23 Mar 2023 14:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1679583245; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0dmk5Q4C3guQmEpiXuzzzuPN4hd6KwB+S4yuEEvg06U=; b=d2sPERhFl5BpnZUCJU4amQHOYFS7GHUXNse5CSovuyi13nsJgAZPgYTiW26Q9JYseuHX/7 dMac2disrDMPvJ1kha6OGsyzLwUJvoNKSwj9kOSV4bOvvaxAn8StywsrQqnjd5SGBYCAGl Dl7XmxCYToQv1t681/21KxNwCn8xiUo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1679583245; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0dmk5Q4C3guQmEpiXuzzzuPN4hd6KwB+S4yuEEvg06U=; b=JCAqyA9rOUk5xOrKbiKd8MRITsEfPDRWUO4Dlbw8HBMJrvVoI9GOp0gWaAoo+byAFDk48I e0x5rm8SWniVRMCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 717DF132C2; Thu, 23 Mar 2023 14:54:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YjG3Gw1oHGSaDwAAMHmgww (envelope-from ); Thu, 23 Mar 2023 14:54:05 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id C19F9A06F2; Thu, 23 Mar 2023 15:54:04 +0100 (CET) From: Jan Kara To: Ted Tso Cc: , Eric Biggers , Jan Kara Subject: [PATCH 1/2] ext4: Fix data=journal writeback of DMA pinned page Date: Thu, 23 Mar 2023 15:53:58 +0100 Message-Id: <20230323145404.21381-1-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230323145102.3042-1-jack@suse.cz> References: <20230323145102.3042-1-jack@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1023; i=jack@suse.cz; h=from:subject; bh=4auudl/oofRIzGTxWiDlBiCE3uHqE84wg8RsV/7Br9Y=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBkHGgFhIX1w8j+AIY5PW0aX0jFbJE2gw5D1BuMSFyl jIBNF4KJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZBxoBQAKCRCcnaoHP2RA2Y7KB/ 9hgWvYacbRvu3mtE+6R6z6WuLQj5MPy/XS09G9Q6eHpNRRHDl75cuPxErTxl6sThbUxWZfFnznW+x7 x/xXc8h0G/0BN+BhxYdU/ijNzCiVsl5QvL+pQOeiWIlum/NFwf3fERN5YH3d/JDvlOlxlRhtBqcwqD qJOUbWV5Q/FIXPr7yw+qYifpCDS3VUk4hg3+BNAGrKuG8bNawyt/l6BPKsfXe33EJ+b+QedIzWXwKu VuN8IrTOi+UHJQveLNHG6ge+BuGjRXTFuXU4hCvgmGYFNYU6bVs57HJ6ZrTSwXYWtG+BCOLeErZBPY 57FATkvvWDXwFoFdBwOdpWVBwp5rmt X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The condition in ext4_writepages() checking whether the filesystem is frozen had a brown paper bag bug resulting in us never writing back DMA pinned pages. Fix the condition. Reported-by: Eric Biggers Link: https://lore.kernel.org/all/20230319183617.GA896@sol.localdomain Fixes: 18b7f4107219 ("ext4: Fix warnings when freezing filesystem with journaled data") Signed-off-by: Jan Kara --- fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 3e311c85df08..15bac8181798 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2436,7 +2436,7 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) * loop clears them. */ if (ext4_should_journal_data(mpd->inode) && - sb->s_writers.frozen >= SB_FREEZE_FS) { + sb->s_writers.frozen < SB_FREEZE_FS) { handle = ext4_journal_start(mpd->inode, EXT4_HT_WRITE_PAGE, bpp); if (IS_ERR(handle)) -- 2.35.3