From 382353e2e80e216eaf68ee062dd5c85538aca68f Mon Sep 17 00:00:00 2001 From: Christian Brueffer Date: Sun, 26 Jul 2015 08:33:46 +0000 Subject: [PATCH] In tmpfs_chtimes(), remove checks on the nanosecond level when determining whether a node changed. Other filesystems, e.g., UFS, only check on seconds, when determining whether something changed. This also corrects the birthtime case, where we checked tv_nsec twice, instead of tv_sec and tv_nsec (PR). PR: 201284 Submitted by: David Binderman Patch suggested by: kib Reviewed by: kib MFC after: 2 weeks Committed from: Essen FreeBSD Hackathon --- sys/fs/tmpfs/tmpfs_subr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 9a8aa8ace46..fa489b2f384 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1709,20 +1709,18 @@ tmpfs_chtimes(struct vnode *vp, struct vattr *vap, if (error != 0) return (error); - if (vap->va_atime.tv_sec != VNOVAL && vap->va_atime.tv_nsec != VNOVAL) + if (vap->va_atime.tv_sec != VNOVAL) node->tn_status |= TMPFS_NODE_ACCESSED; - if (vap->va_mtime.tv_sec != VNOVAL && vap->va_mtime.tv_nsec != VNOVAL) + if (vap->va_mtime.tv_sec != VNOVAL) node->tn_status |= TMPFS_NODE_MODIFIED; - if (vap->va_birthtime.tv_nsec != VNOVAL && - vap->va_birthtime.tv_nsec != VNOVAL) + if (vap->va_birthtime.tv_sec != VNOVAL) node->tn_status |= TMPFS_NODE_MODIFIED; tmpfs_itimes(vp, &vap->va_atime, &vap->va_mtime); - if (vap->va_birthtime.tv_nsec != VNOVAL && - vap->va_birthtime.tv_nsec != VNOVAL) + if (vap->va_birthtime.tv_sec != VNOVAL) node->tn_birthtime = vap->va_birthtime; MPASS(VOP_ISLOCKED(vp));