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: <20230706105446.r32oft4i3cj5bk3y@quack3>
Date:   Thu, 6 Jul 2023 12:54:46 +0200
From:   Jan Kara <jack@...e.cz>
To:     Jeff Layton <jlayton@...nel.org>
Cc:     Christian Brauner <brauner@...nel.org>,
        Joel Becker <jlbec@...lplan.org>,
        Christoph Hellwig <hch@....de>,
        Al Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 32/92] configfs: convert to ctime accessor functions

On Wed 05-07-23 15:00:57, Jeff Layton wrote:
> In later patches, we're going to change how the inode's ctime field is
> used. Switch to using accessor functions instead of raw accesses of
> inode->i_ctime.
> 
> Signed-off-by: Jeff Layton <jlayton@...nel.org>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/configfs/inode.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
> index 1c15edbe70ff..fbdcb3582926 100644
> --- a/fs/configfs/inode.c
> +++ b/fs/configfs/inode.c
> @@ -88,8 +88,7 @@ int configfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>  static inline void set_default_inode_attr(struct inode * inode, umode_t mode)
>  {
>  	inode->i_mode = mode;
> -	inode->i_atime = inode->i_mtime =
> -		inode->i_ctime = current_time(inode);
> +	inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode);
>  }
>  
>  static inline void set_inode_attr(struct inode * inode, struct iattr * iattr)
> @@ -99,7 +98,7 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr)
>  	inode->i_gid = iattr->ia_gid;
>  	inode->i_atime = iattr->ia_atime;
>  	inode->i_mtime = iattr->ia_mtime;
> -	inode->i_ctime = iattr->ia_ctime;
> +	inode_set_ctime_to_ts(inode, iattr->ia_ctime);
>  }
>  
>  struct inode *configfs_new_inode(umode_t mode, struct configfs_dirent *sd,
> @@ -172,7 +171,7 @@ struct inode *configfs_create(struct dentry *dentry, umode_t mode)
>  		return ERR_PTR(-ENOMEM);
>  
>  	p_inode = d_inode(dentry->d_parent);
> -	p_inode->i_mtime = p_inode->i_ctime = current_time(p_inode);
> +	p_inode->i_mtime = inode_set_ctime_current(p_inode);
>  	configfs_set_inode_lock_class(sd, inode);
>  	return inode;
>  }
> -- 
> 2.41.0
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ