]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xfs: sync up xfs_trans_inode with userspace
authorEric Sandeen <sandeen@redhat.com>
Fri, 12 Jul 2019 22:07:05 +0000 (15:07 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 15 Jul 2019 15:10:34 +0000 (08:10 -0700)
Add an XFS_ICHGTIME_CREATE case to xfs_trans_ichgtime() to keep in
sync with userspace.  (Currently no kernel caller sends this flag.)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_trans_inode.c

index 93d14e47269d1f1cbc18906de9edbb6ab18dadd4..a9ad90926b873fc6ba602cf13460ea175c0bef6c 100644 (file)
@@ -66,6 +66,10 @@ xfs_trans_ichgtime(
                inode->i_mtime = tv;
        if (flags & XFS_ICHGTIME_CHG)
                inode->i_ctime = tv;
+       if (flags & XFS_ICHGTIME_CREATE) {
+               ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
+               ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
+       }
 }
 
 /*