Re: [PATCH v2 66/92] overlayfs: convert to ctime accessor functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2023-07-06 at 15:58 +0200, Jan Kara wrote:
> On Wed 05-07-23 15:01:31, 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.
> > 
> > Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx>
> > Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> ...
> > diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
> > index 21245b00722a..7acd3e3fe790 100644
> > --- a/fs/overlayfs/file.c
> > +++ b/fs/overlayfs/file.c
> ...
> > @@ -249,10 +250,12 @@ static void ovl_file_accessed(struct file *file)
> >  	if (!upperinode)
> >  		return;
> >  
> > +	ctime = inode_get_ctime(inode);
> > +	uctime = inode_get_ctime(upperinode);
> >  	if ((!timespec64_equal(&inode->i_mtime, &upperinode->i_mtime) ||
> > -	     !timespec64_equal(&inode->i_ctime, &upperinode->i_ctime))) {
> > +	     !timespec64_equal(&ctime, &uctime))) {
> >  		inode->i_mtime = upperinode->i_mtime;
> > -		inode->i_ctime = upperinode->i_ctime;
> > +		inode_set_ctime_to_ts(inode, inode_get_ctime(upperinode));
> 
> I think you can use uctime here instead of inode_get_ctime(upperinode)?
> Otherwise the patch looks good. Feel free to add:
> 
> Reviewed-by: Jan Kara <jack@xxxxxxx>
> 

Thanks, fixed in tree.
-- 
Jeff Layton <jlayton@xxxxxxxxxx>




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux