Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1062512rwa; Sat, 20 Aug 2022 23:27:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ZXN9A6yYFVFNXnr6S0EOtvLiAI489MWOfi0BFll/oCcH+Z49phQ/aZJ4JCE6DZzLUVjDx X-Received: by 2002:a17:90a:db95:b0:1fa:c02b:5e34 with SMTP id h21-20020a17090adb9500b001fac02b5e34mr16848578pjv.159.1661063245855; Sat, 20 Aug 2022 23:27:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661063245; cv=none; d=google.com; s=arc-20160816; b=iLV/PRgixeK52UWitfN2R+D/ULyCpmYWNYAHqD5eoxWdqVyqXJXiOfeLd/XHxRlTfd tZrb0EXnmtRn4tZMR1ngne2mElueGBgiH0roA1Hi+YeyD4P9zJ6nL+4UzL9gTZJ0LCqA CpyCZrdWYD//iagvDnZJjgJctQr9iLPxqK82DusHrCplXIH2SU531EiqfAO0hAgF1CRI +JsUsVf6LaHXZulBl1j/5wvelOU1E3LVz/59a1BeuFjBT2B2tmjs+EjEBS74SxiFGQUw q5WV8hRqRkVvBZRbSVQVRoDBQZEvjndGvf9KipvP3pYzEfKmV/SScwksAiwaLLWiHy9N shoQ== 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; bh=Hee5baA8G/Tb1eW1PswaoqWbo659LhIRzth23nd69hI=; b=Walx8r9ilAA2hs+jrmdxs7icKPLUS8EDgRmEA98Z3S0zFEA4OHFj+Kuf5ukINsIIve iVXnaTFG/szjJayv254wiIP1FuMSCLsBQsYerCeIsCvuNcfYjW1r7MJJaHH0Sz4Q3IQK wC1ghxYOuYkEyivzI32vrAVEeHyvRDkyg7uGUY0QU6pGNGkxZ9s1eOdD38tuKBNjQiLv 3tPpheC3CR1PLiUYdESLaksnpdcoibjuakAjJpjFsRHvVsHTm20XUsGMgiDleJ8aw00+ 6PXVvuFw/oi/n3Xq+dOFZNyQy/y/c1ansjjP8qek94HfHymL+BtRB+MutxBqq4TU27Be ++jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=TEzkjmAj; 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 pv4-20020a17090b3c8400b001f75d60a649si2617819pjb.173.2022.08.20.23.27.03; Sat, 20 Aug 2022 23:27:25 -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=@infradead.org header.s=bombadil.20210309 header.b=TEzkjmAj; 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 S229665AbiHUGO6 (ORCPT + 99 others); Sun, 21 Aug 2022 02:14:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiHUGOy (ORCPT ); Sun, 21 Aug 2022 02:14:54 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62C2320F63; Sat, 20 Aug 2022 23:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Hee5baA8G/Tb1eW1PswaoqWbo659LhIRzth23nd69hI=; b=TEzkjmAjFQuuX9pFBpQiT4h9zL 77ZwQKMWgyojuoTDteUSggUtJXkp5o2QDQ4zboEMgdR08RCl8fRPoDXdQwn1HZTgpWm7d1LMdRgix TohM0BGhjA9/RPHkGHoWBPssyRnAkzOzs2E8A8y14s5J107veLvVF3DP0m3QYB68rMO01pt3RaQe2 dwLm7Zus6gsvcdqoR+3cT5Mz+jjLI6QQo16XQTVCgMjpfLwsSdvh/bt1R4q91ms+GxdsUlMGPnQE+ N75XSeAFlbzB+KjzI4tdZh8HMvbFenzxs+3AxGkmmy4fm2N0IfCUFdQ+5IUw8eFW5oaKBOo+3Q+hR y7PLwE5g==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPeEH-006fIc-AK; Sun, 21 Aug 2022 06:14:37 +0000 Date: Sat, 20 Aug 2022 23:14:37 -0700 From: Christoph Hellwig To: Jan Kara Cc: Eric Biggers , Lukas Czerner , linux-ext4@vger.kernel.org, tytso@mit.edu, jlayton@kernel.org, linux-fsdevel@vger.kernel.org, david@fromorbit.com, Christoph Hellwig Subject: Re: [PATCH v3 2/3] fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE Message-ID: References: <20220812123727.46397-1-lczerner@redhat.com> <20220812123727.46397-2-lczerner@redhat.com> <20220816112124.taqvli527475gwv4@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220816112124.taqvli527475gwv4@quack3> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Tue, Aug 16, 2022 at 01:21:24PM +0200, Jan Kara wrote: > 2) I_DIRTY_TIME flag passed to ->dirty_inode() callback. This is admittedly > bit of a hack. Currently XFS relies on the fact that the only time its > ->dirty_inode() callback needs to do anything is when VFS decides it is > time to writeback timestamps and XFS detects this situation by checking for > I_DIRTY_TIME in inode->i_state. Now to fix the race, we need to first clear > I_DIRTY_TIME in inode->i_state and only then call the ->dirty_inode() > callback (otherwise timestamp update can get lost). So the solution I've > suggested was to propagate the information "timestamp update needed" to XFS > through I_DIRTY_TIME in flags passed to ->dirty_inode(). Maybe we should just add a separate update_lazy_time method to make this a little more clear?