Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Feb 2016 15:53:08 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r295811 - head/sys/fs/ext2fs
Message-ID:  <201602191553.u1JFr8s5043412@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Fri Feb 19 15:53:08 2016
New Revision: 295811
URL: https://svnweb.freebsd.org/changeset/base/295811

Log:
  Ext2: cleanup setting of ctime/mtime/birthtime.
  
  This adopts the same change as r291936 for UFS.
  Directly clear IN_ACCESS or IN_UPDATE when user supplied the time, and
  copy the value into the inode.
  
  This keeps the behaviour cleaner and is consistent with UFS.
  
  Reviewed by:	bde
  MFC after:	1 month (only 10)

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Fri Feb 19 15:35:20 2016	(r295810)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Fri Feb 19 15:53:08 2016	(r295811)
@@ -464,16 +464,14 @@ ext2_setattr(struct vop_setattr_args *ap
 		    ((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
 		    (error = VOP_ACCESS(vp, VWRITE, cred, td))))
 			return (error);
-		if (vap->va_atime.tv_sec != VNOVAL)
-			ip->i_flag |= IN_ACCESS;
-		if (vap->va_mtime.tv_sec != VNOVAL)
-			ip->i_flag |= IN_CHANGE | IN_UPDATE;
-		ext2_itimes(vp);
+		ip->i_flag |= IN_CHANGE | IN_MODIFIED;
 		if (vap->va_atime.tv_sec != VNOVAL) {
+			ip->i_flag &= ~IN_ACCESS;
 			ip->i_atime = vap->va_atime.tv_sec;
 			ip->i_atimensec = vap->va_atime.tv_nsec;
 		}
 		if (vap->va_mtime.tv_sec != VNOVAL) {
+			ip->i_flag &= ~IN_UPDATE;
 			ip->i_mtime = vap->va_mtime.tv_sec;
 			ip->i_mtimensec = vap->va_mtime.tv_nsec;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602191553.u1JFr8s5043412>