Re: [PATCH 10/14] fs: factor out a sync_lazytime helper

Jan Kara <[email protected]>
Newsgroups dev.linux.lists.gfs2,org.infradead.lists.linux-mtd,org.kernel.vger.io-uring,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs,org.kernel.vger.linux-unionfs,org.kernel.vger.linux-xfs
Message-ID <zxcwflyr4gjglqmpjnr6vgcb6iv3zu5iub4yf35i2kdhn37ox5@rudbrvydeev5>
On Mon 24-11-25 15:09:24, Christoph Hellwig wrote:
> On Mon, Nov 24, 2025 at 02:31:02PM +0100, Jan Kara wrote:
> > > +	if (wbc->sync_mode == WB_SYNC_ALL ||
> > > +	    time_after(jiffies, inode->dirtied_time_when +
> > > +			dirtytime_expire_interval * HZ))
> > > +		sync_lazytime(inode);
> > 
> > The checking of inode->dirtied_time_when for inode potentially without
> > I_DIRTY_TIME set (and thus with unclear value of dirtied_time_when) is kind
> > of odd. It is harmless but IMO still not a good practice. Can't we keep
> > this condition as is and just call sync_lazytime()?
> 
> As in keeping the I_DIRTY_TIME in the caller?  Sure, I could do that.

Yes, keeping I_DIRTY_TIME check at this call site.

								Honza
-- 
Jan Kara <[email protected]>
SUSE Labs, CR
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.