Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2083561rwa; Mon, 22 Aug 2022 01:34:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR4+a+XnHxsBlPAYzmATu3fYiCeXl59tTQ2oG32OO9W9CI2qhc/yb2c4P5pwwE7vjiGOH9QP X-Received: by 2002:a05:6a00:27a0:b0:52f:8766:82ec with SMTP id bd32-20020a056a0027a000b0052f876682ecmr19895899pfb.17.1661157263789; Mon, 22 Aug 2022 01:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661157263; cv=none; d=google.com; s=arc-20160816; b=t7Ixxltzq37XHQoHSvYNxywte06bl7hhevfmi/hYr3Eipq9+KPJsQvOODlSsATwN7K gceaBE8QubulJXA/ZMCfetP0m0h2IK2vYaLAy5SlCOOet9XzakPNWPCsPRM+FeOB2n9r HvcFpPIQFIx/9fd2IlSVUQATsr3kvFGz5LrbUd9X6ECcdMskI4UcdBwPDdqslTnavEao 96VQuVSAJdglOM84995kKLvkZ+15nWe4HH+IRQAi3AbSbf3KxaJak7CRu5joylKBW403 cbNRszhiXrfGOntrQJzQ9bpr7FWxh3DkUPaBWItZgQgVlrA2f5BKqJ58qtGr8OHxc2T9 ww5g== 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=wNrEwveCSL7WYjQAcGTc/DSIBycLUN2ZDQvXyHz1zWo=; b=KwxJ7HpjfT7NoiW7MdT0AjRDFSpC4rZjKESBXtli7UPeUubJfBgm/kx4BDsbzyMG9p m5KE7qQtCVl8hTmPHy2f57Vu+dEeEM1/Xy0eM3NvfGk/alg6zLR4R/nAHC/MUC3wEl02 UXGqMkKlJgtweQpPBLNkIuduvU3qfWQ1YnYZbTdBBZPbGLiCHzXXB99hah/NrTth4605 mRtWXYQvpJFLLOWCQRfCSxtZUhjaNhyhits7WOyp/1EjJ42aA48igxqnq+dj7hvhYl/9 yiIVqoSMGprwJPyW3nO8Ktww5nfs/YCFdSgO320tSv6CfrM2ii+iuudt//f0xUNvCewQ 6NuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vWK48HYG; 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 w19-20020a170902a71300b0016eccdd02cdsi10957124plq.222.2022.08.22.01.34.03; Mon, 22 Aug 2022 01:34:23 -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=vWK48HYG; 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 S234028AbiHVIde (ORCPT + 99 others); Mon, 22 Aug 2022 04:33:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234015AbiHVIdc (ORCPT ); Mon, 22 Aug 2022 04:33:32 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E48CDA1AF; Mon, 22 Aug 2022 01:33:29 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0BCC41FAE9; Mon, 22 Aug 2022 08:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1661157208; 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=wNrEwveCSL7WYjQAcGTc/DSIBycLUN2ZDQvXyHz1zWo=; b=vWK48HYG4BgRPuC85lafn2WpteGe08QpmeMSY8dZRDbMMi67ySk2ZgxXWyd9iLtOxKnLET UcCXci9zlVMEE4hua2htQhBKXvBKBIEIWbm2irSoPYEDrl4ZUPCZ5eCFksDhns5vMcCIk2 KDlg+W/iitMyVoMyfyLyJ07F+QucSMc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1661157208; 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=wNrEwveCSL7WYjQAcGTc/DSIBycLUN2ZDQvXyHz1zWo=; b=GDd78NkhVZC8uqOnzv7XAPpvzLhInFDp864DZTLnrMzc8PbiYCJYb+zTain/xwWv6at8pD mclaru2UTR3mYrBQ== Received: from quack3.suse.cz (unknown [10.100.200.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E92022C141; Mon, 22 Aug 2022 08:33:27 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 54059A066D; Mon, 22 Aug 2022 10:33:24 +0200 (CEST) Date: Mon, 22 Aug 2022 10:33:24 +0200 From: Jan Kara To: Christoph Hellwig Cc: Jan Kara , Eric Biggers , Lukas Czerner , linux-ext4@vger.kernel.org, tytso@mit.edu, jlayton@kernel.org, linux-fsdevel@vger.kernel.org, david@fromorbit.com Subject: Re: [PATCH v3 2/3] fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE Message-ID: <20220822083324.q7qcxtkfji66ho4l@quack3> 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: 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,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 Sat 20-08-22 23:14:37, Christoph Hellwig wrote: > 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? Yes, we could do that if people prefer this. Although I'd say that good documentation at the place in __mark_inode_dirty() where this gets used and in documentation of .dirty_inode might clear the confusion as well. Honza -- Jan Kara SUSE Labs, CR