lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <znjzumoxtj77t5aaaogfzr6ypreal5djcjl4uf537i66ge6gss@si5pk32ogsx3>
Date: Mon, 24 Nov 2025 14:11:49 +0100
From: Jan Kara <jack@...e.cz>
To: Christoph Hellwig <hch@....de>
Cc: Christian Brauner <brauner@...nel.org>, 
	Al Viro <viro@...iv.linux.org.uk>, David Sterba <dsterba@...e.com>, Jan Kara <jack@...e.cz>, 
	Mike Marshall <hubcap@...ibond.com>, Martin Brandenburg <martin@...ibond.com>, 
	Carlos Maiolino <cem@...nel.org>, Stefan Roesch <shr@...com>, Jeff Layton <jlayton@...nel.org>, 
	linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org, gfs2@...ts.linux.dev, 
	io-uring@...r.kernel.org, devel@...ts.orangefs.org, linux-unionfs@...r.kernel.org, 
	linux-mtd@...ts.infradead.org, linux-xfs@...r.kernel.org, linux-nfs@...r.kernel.org
Subject: Re: [PATCH 08/14] fs: exit early in generic_update_time when there
 is no work

On Fri 14-11-25 07:26:11, Christoph Hellwig wrote:
> Exit early if not attributes are to be updated, to avoid a spurious call
		^^ no

> to __mark_inode_dirty which can turn into a fairly expensive no-op due to
> the extra checks and locking.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/inode.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/inode.c b/fs/inode.c
> index 74e672dd90aa..57c458ee548d 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2098,6 +2098,9 @@ int generic_update_time(struct inode *inode, int flags)
>  	int updated = inode_update_timestamps(inode, flags);
>  	int dirty_flags = 0;
>  
> +	if (!updated)
> +		return 0;
> +
>  	if (updated & (S_ATIME|S_MTIME|S_CTIME))
>  		dirty_flags = inode->i_sb->s_flags & SB_LAZYTIME ? I_DIRTY_TIME : I_DIRTY_SYNC;
>  	if (updated & S_VERSION)
> -- 
> 2.47.3
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ