summaryrefslogtreecommitdiff
path: root/sys/miscfs
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-04-17 04:43:22 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-04-17 04:43:22 +0000
commit520315c9c6bce487b0a975df8204f04a6e8c610e (patch)
tree254581334fcf5ab284ca2e11882093d9dda0ba7b /sys/miscfs
parent423b84171151dd257452273b07399e51c37cbbc8 (diff)
Tweaks utimensat/futimens handling to always update ctime, even when both
atime and mtime are UTIME_OMIT (at least for ufs, tmpfs, and ext2fs), and to correctly handle a timestamp of -1. ok millert@
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/fuse/fuse_vnops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/miscfs/fuse/fuse_vnops.c b/sys/miscfs/fuse/fuse_vnops.c
index f6807648338..8ab7140ad50 100644
--- a/sys/miscfs/fuse/fuse_vnops.c
+++ b/sys/miscfs/fuse/fuse_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_vnops.c,v 1.23 2015/02/19 10:22:20 tedu Exp $ */
+/* $OpenBSD: fuse_vnops.c,v 1.24 2015/04/17 04:43:21 guenther Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -478,7 +478,7 @@ fusefs_setattr(void *v)
io->fi_flags |= FUSE_FATTR_SIZE;
}
- if (vap->va_atime.tv_sec != VNOVAL) {
+ if (vap->va_atime.tv_nsec != VNOVAL) {
if (vp->v_mount->mnt_flag & MNT_RDONLY) {
error = EROFS;
goto out;
@@ -488,7 +488,7 @@ fusefs_setattr(void *v)
io->fi_flags |= FUSE_FATTR_ATIME;
}
- if (vap->va_mtime.tv_sec != VNOVAL) {
+ if (vap->va_mtime.tv_nsec != VNOVAL) {
if (vp->v_mount->mnt_flag & MNT_RDONLY) {
error = EROFS;
goto out;
@@ -497,6 +497,7 @@ fusefs_setattr(void *v)
fbuf->fb_vattr.va_mtime.tv_nsec = vap->va_mtime.tv_nsec;
io->fi_flags |= FUSE_FATTR_MTIME;
}
+ /* XXX should set a flag if (vap->va_vaflags & VA_UTIMES_CHANGE) */
if (vap->va_mode != (mode_t)VNOVAL) {
if (vp->v_mount->mnt_flag & MNT_RDONLY) {