From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17F961DB54C for ; Thu, 18 Dec 2025 06:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766038405; cv=none; b=Xz+6QXj7BdARZslF76iVnNnCgxerD+FZuZpxA5JR/rHuYI9jvZKvos1M0/61841+apHEjgSS9NWge8J60OjMWFXPpn8DudAMXvJygodlRu9VEJxTAzb7VWz4f1HOQ+/xHTxTwll+GHvTVTB+lw7cb5ucIyQnosPrrBTsl7lmCP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766038405; c=relaxed/simple; bh=ZBYUW2in9iDytsK8dgp3TVcKqNV9Uzw5cFn++gKN9gs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LJpUtsFtlbor62MAqg0Us96YMw+HgYGKNCCiIix2u7l0w1n1wFSx1q+VMuMcanRwGma176J9jZK6PExbNyxtyk8FNSh+PQZJpPdNmq4dl6afRZ687lXuyNuxcuWw/5ndGcIqkPYpc7zqXKvV/FS9fJGf8Y+jTLt33P9hka3p0Hs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 41DC7227A88; Thu, 18 Dec 2025 07:13:18 +0100 (CET) Date: Thu, 18 Dec 2025 07:13:17 +0100 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , Christian Brauner , Al Viro , David Sterba , Mike Marshall , Martin Brandenburg , Carlos Maiolino , Stefan Roesch , Jeff Layton , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, gfs2@lists.linux.dev, io-uring@vger.kernel.org, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, linux-mtd@lists.infradead.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH 07/10] fs: add a ->sync_lazytime method Message-ID: <20251218061317.GA2775@lst.de> References: <20251217061015.923954-1-hch@lst.de> <20251217061015.923954-8-hch@lst.de> Precedence: bulk X-Mailing-List: gfs2@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Wed, Dec 17, 2025 at 01:30:18PM +0100, Jan Kara wrote: > > if (flags & I_DIRTY_INODE) { > > + bool was_dirty_time = > > + inode_state_read_once(inode) & I_DIRTY_TIME; > > + > > /* > > * Inode timestamp update will piggback on this dirtying. > > * We tell ->dirty_inode callback that timestamps need to > > * be updated by setting I_DIRTY_TIME in flags. > > */ > > - if (inode_state_read_once(inode) & I_DIRTY_TIME) { > > + if (was_dirty_time) { > > spin_lock(&inode->i_lock); > > if (inode_state_read(inode) & I_DIRTY_TIME) { > > inode_state_clear(inode, I_DIRTY_TIME); > > flags |= I_DIRTY_TIME; > > + was_dirty_time = true; > > This looks bogus. was_dirty_time is already true here. What I think you > wanted here is to set it to false if locked I_DIRTY_TIME check failed. > Otherwise the patch looks good. Or better set it to false at initialization time and only set it to true here to simply things a bit. But otherwise: yes. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9FFBCD68BE1 for ; Thu, 18 Dec 2025 06:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VlXSz66p2jhdpa1mbxqS1aQY9rYxF8IMTz/MQwV5vRs=; b=zpYS35XthIf+R+ ffi0weIxgMKHjgS5bm+/xe6qTLD3r9jpGdV6tWu06DX+VDohsbApryBTvbwHQVop4G1K8nzYFRfWH cABpmBesJbhl3D3LvNnz1J/w7D2Sdt6ak6B04sjvOzANjYJAczGlav2T28UZSXRl3llM9cWkDEtlL OAnfORXpF5uRZPaG14mo0v4/SnX/WMP5p20oVN/XUOQdjY/eUzWtpsvuz/jJxKlM62XJBl+bABNjy ZoarQijbWZH+t5Jv6RRnotWPU2XcmBVionBGvZ5FLHIHtNT4qXE2zx2iYE9yoGIgB2+iHTt8kG/9s vuza4VfYAYC6goyzH4oQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vW7Gf-00000007seP-0nC5; Thu, 18 Dec 2025 06:13:41 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vW7Ga-00000007sdR-2TgQ for linux-mtd@lists.infradead.org; Thu, 18 Dec 2025 06:13:38 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id 41DC7227A88; Thu, 18 Dec 2025 07:13:18 +0100 (CET) Date: Thu, 18 Dec 2025 07:13:17 +0100 From: Christoph Hellwig To: Jan Kara Cc: Christoph Hellwig , Christian Brauner , Al Viro , David Sterba , Mike Marshall , Martin Brandenburg , Carlos Maiolino , Stefan Roesch , Jeff Layton , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, gfs2@lists.linux.dev, io-uring@vger.kernel.org, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, linux-mtd@lists.infradead.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH 07/10] fs: add a ->sync_lazytime method Message-ID: <20251218061317.GA2775@lst.de> References: <20251217061015.923954-1-hch@lst.de> <20251217061015.923954-8-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251217_221336_798026_F279852E X-CRM114-Status: GOOD ( 17.12 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Wed, Dec 17, 2025 at 01:30:18PM +0100, Jan Kara wrote: > > if (flags & I_DIRTY_INODE) { > > + bool was_dirty_time = > > + inode_state_read_once(inode) & I_DIRTY_TIME; > > + > > /* > > * Inode timestamp update will piggback on this dirtying. > > * We tell ->dirty_inode callback that timestamps need to > > * be updated by setting I_DIRTY_TIME in flags. > > */ > > - if (inode_state_read_once(inode) & I_DIRTY_TIME) { > > + if (was_dirty_time) { > > spin_lock(&inode->i_lock); > > if (inode_state_read(inode) & I_DIRTY_TIME) { > > inode_state_clear(inode, I_DIRTY_TIME); > > flags |= I_DIRTY_TIME; > > + was_dirty_time = true; > > This looks bogus. was_dirty_time is already true here. What I think you > wanted here is to set it to false if locked I_DIRTY_TIME check failed. > Otherwise the patch looks good. Or better set it to false at initialization time and only set it to true here to simply things a bit. But otherwise: yes. ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/