diff options
Diffstat (limited to 'sys/ufs/ext2fs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vnops.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c index c88e6f4617b..13c3356781b 100644 --- a/sys/ufs/ext2fs/ext2fs_vnops.c +++ b/sys/ufs/ext2fs/ext2fs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vnops.c,v 1.72 2015/03/14 03:38:52 jsg Exp $ */ +/* $OpenBSD: ext2fs_vnops.c,v 1.73 2015/04/17 04:43:21 guenther Exp $ */ /* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */ /* @@ -290,7 +290,9 @@ ext2fs_setattr(void *v) if (error) return (error); } - if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { + if ((vap->va_vaflags & VA_UTIMES_CHANGE) || + vap->va_atime.tv_nsec != VNOVAL || + vap->va_mtime.tv_nsec != VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != ip->i_e2fs_uid && @@ -298,17 +300,19 @@ ext2fs_setattr(void *v) ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(vp, VWRITE, cred, p)))) return (error); - if (vap->va_mtime.tv_sec != VNOVAL) + if (vap->va_mtime.tv_nsec != VNOVAL) ip->i_flag |= IN_CHANGE | IN_UPDATE; - if (vap->va_atime.tv_sec != VNOVAL) { + else if (vap->va_vaflags & VA_UTIMES_CHANGE) + ip->i_flag |= IN_CHANGE; + if (vap->va_atime.tv_nsec != VNOVAL) { if (!(vp->v_mount->mnt_flag & MNT_NOATIME) || (ip->i_flag & (IN_CHANGE | IN_UPDATE))) ip->i_flag |= IN_ACCESS; } EXT2FS_ITIMES(ip); - if (vap->va_mtime.tv_sec != VNOVAL) + if (vap->va_mtime.tv_nsec != VNOVAL) ip->i_e2fs_mtime = vap->va_mtime.tv_sec; - if (vap->va_atime.tv_sec != VNOVAL) + if (vap->va_atime.tv_nsec != VNOVAL) ip->i_e2fs_atime = vap->va_atime.tv_sec; error = ext2fs_update(ip, 1); if (error) |