On Mon 04-01-21 16:54:44, Eric Biggers wrote: > From: Eric Biggers <ebiggers@xxxxxxxxxx> > > There is no need to call ->dirty_inode for lazytime timestamp updates > (i.e. for __mark_inode_dirty(I_DIRTY_TIME)), since by the definition of > lazytime, filesystems must ignore these updates. Filesystems only need > to care about the updated timestamps when they expire. > > Therefore, only call ->dirty_inode when I_DIRTY_INODE is set. > > Based on a patch from Christoph Hellwig: > https://lore.kernel.org/r/20200325122825.1086872-4-hch@xxxxxx > > Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx> ... > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c > index 081e335cdee47..e3347fd6eb13a 100644 > --- a/fs/fs-writeback.c > +++ b/fs/fs-writeback.c > @@ -2264,16 +2264,16 @@ void __mark_inode_dirty(struct inode *inode, int flags) > * Don't do this for I_DIRTY_PAGES - that doesn't actually > * dirty the inode itself > */ > - if (flags & (I_DIRTY_INODE | I_DIRTY_TIME)) { > + if (flags & I_DIRTY_INODE) { > trace_writeback_dirty_inode_start(inode, flags); > > if (sb->s_op->dirty_inode) > sb->s_op->dirty_inode(inode, flags); OK, but shouldn't we pass just (flags & I_DIRTY_INODE) to ->dirty_inode(). Just to make it clear what the filesystem is supposed to consume in 'flags'... Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR