Skip to contentSkip to conversation

vfs: utimensat(): ignore tv_sec if tv_nsec == UTIME_OMIT or UTIME_NOW

PATCH Superseded Michael Kerrisk 2 participants 3 messages Jun 3, 2008 – Jun 4, 2008 VFS

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 vfs: utimensat(): ignore tv_sec if tv_nsec == UTIME_OMIT or UTIME_NOW

The POSIX.1 draft spec for utimensat() says that if a times[n].tv_nsec field is UTIME_OMIT or UTIME_NOW, then the value in the corresponding tv_sec field is ignored. However the current Linux implementation requires the tv_sec value to be zero (or the EINVAL error results). This requirement should be removed.

CC Miklos Szeredi <[email protected]>
CC Al Viro <[email protected]>
CC Ulrich Drepper <[email protected]>
fs/utimes.c +0 -8
@@ -169,14 +169,6 @@
 	if (utimes) {
 		if (copy_from_user(&tstimes, utimes, sizeof(tstimes)))
 			return -EFAULT;
-		if ((tstimes[0].tv_nsec == UTIME_OMIT ||
-		     tstimes[0].tv_nsec == UTIME_NOW) &&
-		    tstimes[0].tv_sec != 0)
-			return -EINVAL;
-		if ((tstimes[1].tv_nsec == UTIME_OMIT ||
-		     tstimes[1].tv_nsec == UTIME_NOW) &&
-		    tstimes[1].tv_sec != 0)
-			return -EINVAL;
 
 		/* Nothing to do, we must not even check the path.  */
 		if (tstimes[0].tv_nsec == UTIME_OMIT &&
Acked-by on v1 1/4
#1 lore raw
Quoted 10 lines

The POSIX.1 draft spec for utimensat() says that if a times[n].tv_nsec field is UTIME_OMIT or UTIME_NOW, then the value in the corresponding tv_sec field is ignored. However the current Linux implementation requires the tv_sec value to be zero (or the EINVAL error results). This requirement should be removed.

CC Miklos Szeredi <[email protected]>
CC Al Viro <[email protected]>
CC Ulrich Drepper <[email protected]>

Would it be possible to quote the relevant parts of the draft? Otherwise

#2 lore raw
Quoted 6 lines · Miklos Szeredi
Quoted 6 lines

The POSIX.1 draft spec for utimensat() says that if a times[n].tv_nsec field is UTIME_OMIT or UTIME_NOW, then the value in the corresponding tv_sec field is ignored. However the current Linux implementation requires the tv_sec value to be zero (or the EINVAL error results). This requirement should be removed.

Quoted 6 lines
Quoted 4 lines
CC Miklos Szeredi <[email protected]>
CC Al Viro <[email protected]>
CC Ulrich Drepper <[email protected]>

Would it be possible to quote the relevant parts of the draft?

Will do, for the next revision of this patch series.

Quoted 4 lines

Otherwise

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html