Bug 5599 - cp -p localfile to a winnt, w2k0, winxp server - and legacy servers like win98SE and OS/2 - does _not_ succeed
Summary: cp -p localfile to a winnt, w2k0, winxp server - and legacy servers like win9...
Status: RESOLVED FIXED
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: Other Linux
: P3 normal
Target Milestone: ---
Assignee: Steve French
QA Contact:
URL:
Keywords:
: 5600 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-08 23:13 UTC by Guenter Kukkukk
Modified: 2016-02-26 02:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guenter Kukkukk 2008-07-08 23:13:08 UTC
Again and again there are posts to many mailing lists,
that cifs vfs is handling timestamps improperly.
Regarding legacy servers, special copy operations just fail.
(the todays smbfs vs. cifs legacy problem)

Test environment:
 - latest git cifs vfs is mounted against
    - winNT
    - WinXP
    - OS/2
    - Win98SE

Unfortunately, this one cannot be simply explained in 3 words ...
----------------------------

To make it as clear as possible - the mount commands:
*****************************************************
WinNT server:
=============
mount -t cifs //wrkgk/test /mnt/winnt -o cred=/root/sec/sec_gk,dir_mode=0775,file_mode=0764,uid=gk,gid=users

WinXP server:
=============
mount -t cifs //cboyer/gk /mnt/winxp -o cred=/root/sec/sec_gk,dir_mode=0775,file_mode=0764,uid=gk,gid=users

OS/2 server:
============
mount -t cifs //server01/CIFS /mnt/server -o cred=/root/sec/sec_gk,sec=lanman,servern=SERVER01,port=139,dir_mode=0775,file_mode=0764,uid=gk,gid=users

Win98SE:
========
mount -t cifs //win98/CIFS /mnt/win9x -o cred=/root/sec/sec_gk,servern=WIN98,dir_mode=0775,file_mode=0764,uid=gk,gid=users

------------------------------------------------------

The results of "cp -p local_file /mnt/some_server":
***************************************************
NOTE:
   cp -p src dst 
the '-p' option should preserve time stamps - at least the
last modification time!

WinNT:
======
gk@linux700:~/cifstest> stat dummy.tst && cp -p dummy.tst /mnt/winnt/ && sleep 1 && stat /mnt/winnt/dummy.tst
  File: `dummy.tst'
  Size: 51078           Blocks: 104        IO Block: 4096   regular file
Device: 306h/774d       Inode: 1054939     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/      gk)   Gid: (  100/   users)
Access: 2008-07-09 04:32:26.000000000 +0200
Modify: 2007-05-07 21:52:40.000000000 +0200
Change: 2008-07-09 04:32:24.000000000 +0200
  File: `/mnt/winnt/dummy.tst'
  Size: 51078           Blocks: 104        IO Block: 16384  regular file
Device: 10h/16d Inode: 11749       Links: 1
Access: (0764/-rwxrw-r--)  Uid: ( 1000/      gk)   Gid: (  100/   users)
Access: 2008-07-09 04:35:06.854217400 +0200   !!!!!!!!!!!!!!!!!!!!!
Modify: 2008-07-09 04:35:06.794122600 +0200   !!!!!!!!!!!!!!!!!!!!!
Change: 2008-07-09 04:35:06.794122600 +0200   !!!!!!!!!!!!!!!!!!!!!

WinXP:
======
gk@linux700:~/cifstest> stat dummy.tst && cp -p dummy.tst /mnt/winxp/ && sleep 1 && stat /mnt/winxp/dummy.tst
  File: `dummy.tst'
  Size: 51078           Blocks: 104        IO Block: 4096   regular file
Device: 306h/774d       Inode: 1054939     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/      gk)   Gid: (  100/   users)
Access: 2008-07-09 04:32:24.000000000 +0200  !!!!!!!!!!!!!!!!!!!!!!!!
Modify: 2007-05-07 21:52:40.000000000 +0200  !!!!!!!!!!!!!!!!!!!!!!!!
Change: 2008-07-09 04:32:24.000000000 +0200  !!!!!!!!!!!!!!!!!!!!!!!!
  File: `/mnt/winxp/dummy.tst'
  Size: 51078           Blocks: 104        IO Block: 16384  regular file
Device: 11h/17d Inode: 11484       Links: 1
Access: (0764/-rwxrw-r--)  Uid: ( 1000/      gk)   Gid: (  100/   users)
Access: 2008-07-09 04:31:31.012852800 +0200
Modify: 2008-07-09 04:31:31.012852800 +0200
Change: 2008-07-09 04:31:31.012852800 +0200

OS/2:
=====
gk@linux700:~/cifstest> stat dummy.tst && cp -p dummy.tst /mnt/server/ && sleep 1 && stat /mnt/server/dummy.tst
  File: `dummy.tst'
  Size: 51078           Blocks: 104        IO Block: 4096   regular file
Device: 306h/774d       Inode: 1054939     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/      gk)   Gid: (  100/   users)
Access: 2008-07-09 04:46:16.000000000 +0200
Modify: 2007-05-07 21:52:40.000000000 +0200
Change: 2008-07-09 04:32:24.000000000 +0200
cp: preserving times for `/mnt/server/dummy.tst': Invalid argument

Win98SE:
========
gk@linux700:~/cifstest> stat dummy.tst && cp -p dummy.tst /mnt/win9x/ && sleep 1 && stat /mnt/win9x/dummy.tst
  File: `dummy.tst'
  Size: 51078           Blocks: 104        IO Block: 4096   regular file
Device: 306h/774d       Inode: 1054939     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/      gk)   Gid: (  100/   users)
Access: 2008-07-09 04:36:04.000000000 +0200
Modify: 2007-05-07 21:52:40.000000000 +0200
Change: 2008-07-09 04:32:24.000000000 +0200
cp: preserving times for `/mnt/win9x/dummy.tst': Invalid argument
-----------------------------------------------------------------

Conclusion:
===========
WinNT and WinXP just _silently_ FAIL!
OS/2 and Win98SE just fail with an error msg!

All this is "a known cifs failure" for weeks now - Jeff Layton
has prepared a (large) patch to "cleanup the cifs_setattr()"
stuff - and I'm waiting to post more legacy functionality.

... but nothing happens ...

A really sad situation, when realizing that even the samba
smbfs helpers smbmount, smbmnt and smbumount have now been
removed in 3.2.x.

Cheers, Günter
Comment 1 Guenter Kukkukk 2008-07-08 23:39:09 UTC
*** Bug 5600 has been marked as a duplicate of this bug. ***
Comment 2 Steve French 2008-08-26 15:32:44 UTC
The version of this fix for reasonably current Windows servers has been reviewed, tested and integrated into 2.6.27 kernel (and some of the cifs backports to older kernels will likely include this although it is a big change with some of the changes to rewrite setattr that went with this).

Windows95 and OS/2 would need additional changes to support this.
Comment 3 Steve French 2016-02-26 02:17:03 UTC
Please reopen or create new one if narrower problem found - but this has been fixed for multiple years now.