Author: kib
Date: Mon Dec 21 11:44:54 2015
New Revision: 292540
URL: https://svnweb.freebsd.org/changeset/base/292540

Log:
  MFC r291936:
  Update ctime when atime or birthtime are updated.
  Cleanup setting of ctime/mtime/birthtime.

Modified:
  stable/10/sys/ufs/ufs/ufs_vnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- stable/10/sys/ufs/ufs/ufs_vnops.c   Mon Dec 21 11:24:14 2015        
(r292539)
+++ stable/10/sys/ufs/ufs/ufs_vnops.c   Mon Dec 21 11:44:54 2015        
(r292540)
@@ -640,19 +640,14 @@ ufs_setattr(ap)
                error = vn_utimes_perm(vp, vap, cred, td);
                if (error != 0)
                        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;
-               if (vap->va_birthtime.tv_sec != VNOVAL &&
-                   ip->i_ump->um_fstype == UFS2)
-                       ip->i_flag |= IN_MODIFIED;
-               ufs_itimes(vp);
+               ip->i_flag |= IN_CHANGE | IN_MODIFIED;
                if (vap->va_atime.tv_sec != VNOVAL) {
+                       ip->i_flag &= ~IN_ACCESS;
                        DIP_SET(ip, i_atime, vap->va_atime.tv_sec);
                        DIP_SET(ip, i_atimensec, vap->va_atime.tv_nsec);
                }
                if (vap->va_mtime.tv_sec != VNOVAL) {
+                       ip->i_flag &= ~IN_UPDATE;
                        DIP_SET(ip, i_mtime, vap->va_mtime.tv_sec);
                        DIP_SET(ip, i_mtimensec, vap->va_mtime.tv_nsec);
                }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to