[Bug 443395] New: cp -p does not copy mtime to CIFS share

bugzilla at redhat.com bugzilla at redhat.com
Mon Apr 21 10:59:39 UTC 2008


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug report.




https://bugzilla.redhat.com/show_bug.cgi?id=443395

           Summary: cp -p does not copy mtime to CIFS share
           Product: Red Hat Enterprise Linux 5
           Version: 5.3
          Platform: i686
        OS/Version: Linux
            Status: NEW
          Severity: medium
          Priority: low
         Component: kernel
        AssignedTo: kernel-mgr at redhat.com
        ReportedBy: jplans at redhat.com
         QAContact: mjenner at redhat.com
                CC: fedora-triage-list at redhat.com


+++ This bug was initially created as a clone of Bug #305191 +++

Description of problem:
When a file is copied to a CIFS share (tested with W2K and NT4),
mtime is not copied from original file.
On the other hand, tar x does copy mtime.

Version-Release number of selected component (if applicable):
kernel 2.6.22.5-49.fc6, CIFS Version 1.49,
coreutils-5.97-12.5.fc6.i386

How reproducible:
always

Steps to Reproduce:
1. mount a CIFS share, say to /mnt/cifs1
2. cd /tmp; echo 123 > f123; touch -d '2005-01-02 11:00' f123
3. cp -p f123 /mnt/cifs1
4. env LANG=C ls -l --full-time f123 /mnt/cifs1/f123
  
Actual results:
/mnt/cifs1/f123 has mtime taken from current time

Expected results:
/mnt/cifs1/f123 should have mtime 2005-01-02

Additional info:
The difference between tar and cp is that tar 
sets mtime on closed file using utime on destination pathname
(after it is closed),
while cp -p calls utimes on opened filehandle
using /proc/self/fd/n (then handle n is closed)

-- Additional comment from jlayton at redhat.com on 2007-11-19 20:16 EST --
This works for me on F8, so I assume that something has changed upstream to fix
this. Can you restest on a more recent kernel (preferably something 2.6.23-ish)
and let me know if this still an issue?


-- Additional comment from jlayton at redhat.com on 2008-01-15 06:28 EST --
No response. Closing as CURRENTRELEASE since my testing indicates that this is
no longer a bug. Please reopen if you're still able to reproduce this.


-- Additional comment from wpilorz at gmail.com on 2008-01-24 17:40 EST --
I still get this problem on Fedora 8 machine (i686 kernel, P4 CPU)
when using the following
cd /mnt/winshare/mydirectory
cp -vip existing_file new_file

Now new_file get mtime from the time the  cp is run, rather than
from existing_file.

The mounted share is exported from a Windows server (Windows 2000 or 2003
Advanced Server, I am not sure at the moment)

-- Additional comment from fedora-triage-list at redhat.com on 2008-04-04 03:35 EST --
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
http://fedoraproject.org/wiki/LifeCycle/EOL

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers

-- Additional comment from wpilorz at gmail.com on 2008-04-04 17:05 EST --
Last time I have checked on Fedora8 system it still did have the problem.
See my Comment#3

-- Additional comment from jlayton at redhat.com on 2008-04-18 15:59 EST --
I've been able to reproduce this against windows:

  6   0.008533 10.11.231.229 -> 10.11.231.44 SMB NT Create AndX Request, Path:
\p1\p2\p3\svc-recv-error.patch
  7   0.009599 10.11.231.44 -> 10.11.231.229 SMB NT Create AndX Response, FID:
0xc00f

...file is created...

  8   0.011168 10.11.231.229 -> 10.11.231.44 SMB Write AndX Request, FID:
0xc00f, 827 bytes at offset 0
  9   0.012117 10.11.231.44 -> 10.11.231.229 SMB Write AndX Response, FID:
0xc00f, 827 bytes

...write some data to it...

 10   0.013129 10.11.231.229 -> 10.11.231.44 SMB Trans2 Request, SET_PATH_INFO,
Path: \p1\p2\p3\svc-recv-error.patch
 11   0.014082 10.11.231.44 -> 10.11.231.229 SMB Trans2 Response, SET_PATH_INFO

...here we set the "last write" and "last access" times to the timestamp of the
source file. Server returns success....


 12   0.015010 10.11.231.229 -> 10.11.231.44 SMB Close Request, FID: 0xc00f
 13   0.015803 10.11.231.44 -> 10.11.231.229 SMB Close Response, FID: 0xc00f

...we close the file...

 15   5.823131 10.11.231.229 -> 10.11.231.44 SMB Trans2 Request,
QUERY_PATH_INFO, Query File All Info, Path: \p1\p2\p3\svc-recv-error.patch
 16   5.824217 10.11.231.44 -> 10.11.231.229 SMB Trans2 Response, QUERY_PATH_INFO

...now QUERY_PATH_INFO (I did a stat against the file on the client). This info
has the "last write" time set to the current time -- *not* what was set in the
SET_PATH_INFO call above. Apparently the CLOSE call is affecting the "last
write" time somehow.

I suspect that the server is buffering the write until the close call comes in
and then that is clobbering the time we're setting. We may be able to mitigate
this by forcing it to flush the data before the SET_PATH_INFO call, but I'll
need to research it a bit...

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the fedora-triage-list mailing list