bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#340236: coreutils: cp -p to nfs destination fails to preserve ti


From: Jim Meyering
Subject: Re: Bug#340236: coreutils: cp -p to nfs destination fails to preserve timestamps
Date: Sat, 17 Dec 2005 08:43:09 +0100

Thanks for the report.
You might be right that the problem is due to the
combination of using /proc/self/fd/N and NFS.
I've Cc'd bug-coreutils, in case someone else has
time to investigate this.

Mikko Rasa <address@hidden> wrote:
> Package: coreutils
> Version: 5.93-5
> Followup-For: Bug #340236
>
> I hit this problem as well today.  Poking around with strace, I noticed
> several things:
>
> 1. cp executes utimes before closing the file.  This might be a problem,
> although it seems to work on local destinations.
>
> open("baz", O_WRONLY|O_TRUNC|O_LARGEFILE) = 4
> fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> write(4, "foo\n", 4)                    = 4
> utimes("/proc/self/fd/4", {1134767841, 0}) = 0
> chmod("baz", 0100644)                   = 0
> close(4)                                = 0
>
> 2. Timestamps of empty files are preserved, which reinforces the above
> suspicion (no writes for empty file)
>
> 3. touch -r works correctly, and it also uses /proc/self/fd to refer to
> the file, so that should be okay.
>
> address@hidden:20 23:17:56 ~/roinaa/test$ echo "foo" >foo
> address@hidden:20 23:18:29 ~/roinaa/test$ strace -e utimes touch -r foo bar
> utimes("/proc/self/fd/0", {1134767841, 0}) = 0
> address@hidden:20 23:18:34 ~/roinaa/test$ strace -e utimes cp -p foo baz
> utimes("/proc/self/fd/4", {1134767841, 0}) = 0
> address@hidden:20 23:18:37 ~/roinaa/test$ ls -l --full-time
> total 8
> -rw-r--r-- 1 tdb tdb 0 2005-12-16 23:18:29.000000000 +0200 bar
> -rw-r--r-- 1 tdb tdb 4 2005-12-16 23:18:37.000000000 +0200 baz
> -rw-r--r-- 1 tdb tdb 4 2005-12-16 23:18:29.000000000 +0200 foo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]