aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_replay.c
diff options
context:
space:
mode:
authorNikolay Borisov <[email protected]>2016-09-12 22:35:56 +0300
committerBrian Behlendorf <[email protected]>2016-09-13 12:00:18 -0700
commit87f9371aefca857e7091dfdee3ec2d36b0de54c4 (patch)
tree8769eb3e29dd3fa77ca59e4552201f8e4ab1f355 /module/zfs/zfs_replay.c
parent9f5f0019ab3c03f59060d752b0be69290ec1abb9 (diff)
Simplify time handling logic in zfs_settattr
Simplify time handling in zfs_setattr by mimicking the logic in setattr_copy from the linux kernel. In order to achieve this in the case when ZFS' log is being replayed it is necessary to unconditionally set the ctime in zfs_replay_setattr. Also use the timespec_trunc function when assigning values to the generic inode struct. This is currently a noop since zfs sets s_time_gran to 1, however in the future rules about precision might change. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Chunwei Chen <[email protected]> Signed-off-by: Nikolay Borisov <[email protected]> Closes #4916
Diffstat (limited to 'module/zfs/zfs_replay.c')
-rw-r--r--module/zfs/zfs_replay.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/zfs_replay.c b/module/zfs/zfs_replay.c
index 54c175437..b631ba65b 100644
--- a/module/zfs/zfs_replay.c
+++ b/module/zfs/zfs_replay.c
@@ -805,6 +805,8 @@ zfs_replay_setattr(zfs_sb_t *zsb, lr_setattr_t *lr, boolean_t byteswap)
vap->va_size = lr->lr_size;
ZFS_TIME_DECODE(&vap->va_atime, lr->lr_atime);
ZFS_TIME_DECODE(&vap->va_mtime, lr->lr_mtime);
+ gethrestime(&vap->va_ctime);
+ vap->va_mask |= ATTR_CTIME;
/*
* Fill in xvattr_t portions if necessary.