sys_utime bug in 131?

Richard Fish (rjf@estinc.com)
Tue, 15 Dec 1998 09:42:35 -0700


I think there may be a bug in the way sys_utime works in the current
kernels. To demonstrate:

[root@nile test]# touch -d 19980101 somefile
[root@nile test]# ls -l
total 0
-rw-r--r-- 1 root root 0 Jan 1 1998 somefile
[root@nile test]# ln -s somefile linkfile
[root@nile test]# ls -l
total 0
lrwxrwxrwx 1 root root 8 Dec 15 09:09 linkfile ->
somefile
-rw-r--r-- 1 root root 0 Jan 1 1998 somefile
[root@nile test]# touch -d 19980201 linkfile
[root@nile test]# ls -l
total 0
lrwxrwxrwx 1 root root 8 Dec 15 09:09 linkfile ->
somefile
-rw-r--r-- 1 root root 0 Feb 1 1998 somefile

The above shows that calling utime() on a symbolic link results in the
times being set for the actual file, not the link.

Here is a patch to "fix" it. Let me know if this seems reasonable.

With the patch applied, the results of the above are:

[root@nile test]# touch -d 19980101 somefile
[root@nile test]# ln -s somefile linkfile
[root@nile test]# ls -l
total 0
lrwxrwxrwx 1 root root 8 Dec 15 09:40 linkfile ->
somefile
-rw-r--r-- 1 root root 0 Jan 1 1998 somefile
[root@nile test]# touch -d 19980201 linkfile
[root@nile test]# ls -l
total 0
lrwxrwxrwx 1 root root 8 Feb 1 1998 linkfile ->
somefile
-rw-r--r-- 1 root root 0 Jan 1 1998 somefile

Note! It might also make sense to call lnamei() for the following calls
as well

sys_statfs
sys_fstatfs
sys_utimes

-- 
Richard Fish                      Enhanced Software Technologies, Inc.
Software Developer                4014 E Broadway Rd Suite 405
rjf@estinc.com                    Phoenix, AZ  85040 
(602) 470-1115                    http://www.estinc.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/