[patch for 2.6.26 2/4] vfs: utimensat(): be consistent with utime() for immutable...
[firefly-linux-kernel-4.4.55.git] / fs / utimes.c
index af059d5cb485df8289eda123380f4937c0c7b77c..14d3edbb3d7ca83dee12ebe2e3af8f804fde69eb 100644 (file)
@@ -102,6 +102,10 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
        if (error)
                goto dput_and_out;
 
+       if (times && times[0].tv_nsec == UTIME_NOW &&
+                    times[1].tv_nsec == UTIME_NOW)
+               times = NULL;
+
        /* Don't worry, the checks are done in inode_change_ok() */
        newattrs.ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_ATIME;
        if (times) {