Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10738864rwl; Thu, 12 Jan 2023 01:46:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXs2/QhWq9Igyir0Zah7qiup++PpGA1cPduqqLjW0v2mfK+BCpJDaGmYbKb5yTzzdPa68/p7 X-Received: by 2002:a05:6a20:1586:b0:ad:5a5d:3571 with SMTP id h6-20020a056a20158600b000ad5a5d3571mr113536245pzj.4.1673516763067; Thu, 12 Jan 2023 01:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673516763; cv=none; d=google.com; s=arc-20160816; b=wdabZpC8PE3ZgPuQHGx6tjTx4t08660ObsEn5WE6OlU7L6Q4ZCuMWCX2ELFO5rPVkm MqHSBUHJ7qWPIm/r4UhnXY72xoxs5H4gyimzYw/Jm9+QWxP7D+kZgrFZKZWYAAzRYwIT 0S9HRl1WsN2rOgOlwhaZ817LU4hqRYoPd6vNz0CyFGWSLOqRn0G5eBUvdcNwDQ67tz7K UpBJ1/3PwwCqTaOXuSyOOgn+TBsD8JPEPy9pkGL5q7RaNO25nB3SXcM67HTC0A9MGVBc LQxs3nQUwYCHhdcROo9TK+Cu37bDPIdQD0Is75azUx7G7O7Y4FkLY6nBU6BxY9qXv14H OW5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=Au5Y5lilpkftIEJcJmkAVkWWK4MwBRarZO0HiIlsDaY=; b=AEXemYyGZrVz6AHP/dD8g6LJzCqeBZ0oDkSQs/dM9wJc/wIVDq/boxP8Gio0+OY0Zu fGhpj+eRsQpe2QfzVbKAUuxW3RTyjd4843zVW9OrGn2PPZRfgLd47ifXzUGGmgsJKQvv lcP6/33Y1fr1PIfJXC7g8XxrzpnJLj0RPKhqDD1vyQjeuDlikPVigj2c75t+JmODVRhD Jyko8do7vVkTqNIbjy5vxKCS/WrZcXS0hJQjg2EGUmXIo4IH/88Wj5BA0lZK9a3rp8zI /89OLjgFsvR9ggOdaevT+s2U77d4j10F5gRIaP+cus+zvuhXX/NaGDevbuHggOKNFcT8 nxoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ZBntweEs; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=cIief3i6; 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 q4-20020a635044000000b0049ac863877asi16093563pgl.523.2023.01.12.01.45.43; Thu, 12 Jan 2023 01:46:03 -0800 (PST) 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=ZBntweEs; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=cIief3i6; 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 S239787AbjALJf1 (ORCPT + 99 others); Thu, 12 Jan 2023 04:35:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240069AbjALJek (ORCPT ); Thu, 12 Jan 2023 04:34:40 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BFC25329A for ; Thu, 12 Jan 2023 01:29:08 -0800 (PST) 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 541773EE65; Thu, 12 Jan 2023 09:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1673515746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Au5Y5lilpkftIEJcJmkAVkWWK4MwBRarZO0HiIlsDaY=; b=ZBntweEsOGOjmrpvxSFlY7uDxfHe2rre8qMcO2sfRBPjVFjmlhqnwm4Ba8lq4i3uxom08F GrSJEwHEckB9285yVFILRAi4XFIBcotxz4sFlC2LtVMNxGDJp9X/CB/mQ4Km3uYVBNsEP1 c5NT1vocfiEHZzpVL0c2B6m19uuKbKc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1673515746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Au5Y5lilpkftIEJcJmkAVkWWK4MwBRarZO0HiIlsDaY=; b=cIief3i6LjU5006LTjwD9v8XWnIIIj6xy1COcsPuJkS8mSYZwpRi9y2x0k2aIrPzvE44BC olh7M7Rcn3s7tuAg== 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 45D0113776; Thu, 12 Jan 2023 09:29:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7OMAEeLSv2P6FwAAMHmgww (envelope-from ); Thu, 12 Jan 2023 09:29:06 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 925B0A0744; Thu, 12 Jan 2023 10:29:05 +0100 (CET) Date: Thu, 12 Jan 2023 10:29:05 +0100 From: Jan Kara To: Ted Tso Cc: linux-ext4@vger.kernel.org, Jan Kara Subject: Re: [PATCH 3/7] ext4: Mark page for delayed dirtying only if it is pinned Message-ID: <20230112092905.chrxh6dlnxfakxz6@quack3> References: <20230111152736.9608-1-jack@suse.cz> <20230111154338.392-3-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230111154338.392-3-jack@suse.cz> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 On Wed 11-01-23 16:43:27, Jan Kara wrote: > In data=journal mode, page should be dirtied only when it has buffers > for checkpoint or it is writeably mapped. In the first case, we don't > need to do anything special. In the second case, page was already added > to the journal by ext4_page_mkwrite() and since transaction commit > writeprotects mapped pages again, page should be writeable (and thus > dirtied) only while it is part of the running transaction. So nothing > needs to be done either. The only special case is when someone pins the > page and uses this pin for modifying page data. So recognize this > special case and only then mark the page as having data that needs > adding to the journal. > > Signed-off-by: Jan Kara ... > static bool ext4_journalled_dirty_folio(struct address_space *mapping, > struct folio *folio) > { > WARN_ON_ONCE(!folio_buffers(folio)); > - folio_set_checked(folio); > + if (folio_may_be_dma_pinned(folio)) Bah, this should be folio_maybe_dma_pinned(). I had it there and that's what I've tested with but before submission I was laboring whether I should really keep this change or not, had it deleted for a while and then restored the change, and while doing that I've introduced this bug. :-| I'll resend with this bug fixed but before doing that I'll wait a few days whether someone has more comments. Honza > + folio_set_checked(folio); > return filemap_dirty_folio(mapping, folio); > } > > -- > 2.35.3 > -- Jan Kara SUSE Labs, CR