Samba vs. Windows : significant difference in timestamp handling ?

F

Frank Pospischil

Hi there,

i still have a weird problem with Powerpoint an Excel files stored on a
Samba share.

Only read on if you
-use a samba share as MULTI-user file repository (no force_user etc.)
-where multiple, different users share files in common directories
-the modification time of a file is of any relevance to you.
(seems like lots of folks don´t bother access rights or keep their
information strictly user-wise organised ...)

Please look at the following example (Powerpoint 2000 and 2003 on
Terminalserver and Standalone)

Timestamp history (on Samba share, 2.2.8a RedHat Linux 9 with XFS
2.4.20-9SGI_XFS_1.2.0)
File is initially created :
Test.ppt mtime->12:40:05, ctime->12:40:05, atime->12:40:05
File is then "viewed" (open in Powerpoint and exit without changing/saving
anything) by same user:
after file is opened:
Test.ppt mtime->12:40:05, ctime->12:40:05, atime->12:45:59
after file is closed:
Test.ppt mtime->12:40:05, ctime->12:40:05, atime->12:45:59

Hmm, looks o.k. !

Now a different user "views" the file. (Different means, his username on the
Options-dialog in any Office-Application is different.)
Can be faked by simply changing username in options-dialog in Word e.g in
the same session.

while file is open:
Test.ppt mtime->12:49:16, ctime->12:49:16, atime->12:49:16

oooops, looks like a new file ...

after file is closed:
Test.ppt mtime->12:49:16, ctime->12:49:16, atime->12:49:16

.... still looks new to me !

Now the same procedure again,
same environment except the file is stored on a Windows2000 Workstation
(with NT file system tunneling disabled)

file create:
size on disk: 8.192 bytes
created 15:48:36
modified 15:48:36
accessed 15:48:36

"viewing" by the same "user"
while file is open:
size on disk: 8.192 bytes
created 15:48:36
modified 15:48:36
accessed 15:48:36

file closed:
size on disk: 8.192 bytes
created 15:48:36
modified 15:48:36
accessed 15:48:36

O.K. that´s almost the same behavior that samba shows. (Except that on
windows, the file doesn´t even look accessed)

Now change the Office-options to a different user and open the file:
While open:
size on disk: 12.288 bytes
created 15:48:36
modified 15:48:36
accessed 15:50:30

WOW! the file is bigger though it was not modified and is still the one
created 15:48:36

Now exit Powerpoint:
size on disk: 12.288 bytes
created 15:48:36
modified 15:48:36
accessed 15:50:30

.... still the same.

So on windows, the file seems now to be still the same version. (created
15:48:36 last modified 15:48:36).
This is not true as Bits and Bytes are concerned but reflects the semantic
of "open a file and exit without changing anything".

On the Samba share, the file looks like "brand new information".

I think that this makes a BIG difference on a shared filesystem where the
modification time of a file serves as an indicator for the relevance of
information.
(Would you bother a file named "Hot_News" that was last modified 2 Years ago
? And would you like this file to become "really actual" by open it with the
associated application and exit without saving/changing anything ?)

I think, Powerpoint (and Excel at least) store the initial timestamp and
explicitly change them after the file is closed without "relevant" changes.
I suspect, the current user is written to the file so Powerpoint can
announce: "File is currently opened by XYZ. Open it read-only?" or sth. like
that.
The application tries to hide this change by doing some "magic" on the
timestamps.

Question 1:
Can somebody please confirm this behavior ?

Question 2:
a) Does anybody know how the timestamp is changed (File system API, System
API, magic spell ...) and why this mechanism fails on Linux/Samba/XFS ?
(dos_filetimes parameter already set to yes)
b) How can this be debugged efficiently in Samba ? (Log level 3 delivers
tons of data, sth. like NT_STATUS not supported ... What is the meaning of
the errors ? How to isolate the relevant entries ?where to begin ?)

Question 3:
Is it possible to adjust samba to show the same behavior as NTFS ?

Any help concerning this nasty "bug" is really appreciated.
After some months of preparation for the "big move" from Windows to Samba
fileserver, this effect is a real show-stopper as most of the users rely on
the modification time for syncing information with Laptops, handhelds,
project-lists and between each other.

Frank Pospischil
Leiter IT
Telenet AG Rhein-Main

Marburger Straße 14
64289 Darmstadt
Germany

Tel.: +49 6151 733-353
Fax.: +49 6151 733-325
Web: http://www.telenet-ag.de

P.S.: Leser der deutschen Newsgroup de.comp.os.... mögen mir bitte die
englische Variante verzeihen. Ist doch ein bisschen aufwändig das nochmal in
deutsch zu schreiben ...
 
M

Michael D. Ober

I think that this makes a BIG difference on a shared filesystem where the
modification time of a file serves as an indicator for the relevance of
information.
(Would you bother a file named "Hot_News" that was last modified 2 Years ago
? And would you like this file to become "really actual" by open it with the
associated application and exit without saving/changing anything ?)

I think, Powerpoint (and Excel at least) store the initial timestamp and
explicitly change them after the file is closed without "relevant" changes.
I suspect, the current user is written to the file so Powerpoint can
announce: "File is currently opened by XYZ. Open it read-only?" or sth. like
that.
The application tries to hide this change by doing some "magic" on the
timestamps.

Question 1:
Can somebody please confirm this behavior ?

Question 2:
a) Does anybody know how the timestamp is changed (File system API, System
API, magic spell ...) and why this mechanism fails on Linux/Samba/XFS ?
(dos_filetimes parameter already set to yes)
b) How can this be debugged efficiently in Samba ? (Log level 3 delivers
tons of data, sth. like NT_STATUS not supported ... What is the meaning of
the errors ? How to isolate the relevant entries ?where to begin ?)

Question 3:
Is it possible to adjust samba to show the same behavior as NTFS ?

Any help concerning this nasty "bug" is really appreciated.
After some months of preparation for the "big move" from Windows to Samba
fileserver, this effect is a real show-stopper as most of the users rely on
the modification time for syncing information with Laptops, handhelds,
project-lists and between each other.

Frank Pospischil
Leiter IT
Telenet AG Rhein-Main

1) I have seen this behavior as well in GuardianOS (Snap Appliance), which
is based on Linux.

2) There is a function call

SetFileTime(OpenFileHandle,
CreationTime,
LastAccessedTime,
LastWriteTime)

in the Win32 API that allows you to set the date/time of the creation time,
last accessed time, and last modification on a file. The windows default is
to call this whenever a file is closed with updated time fields as required.
Programs souch as "touch" use this call (actually, it's unix equivalent), so
I know that Unix and it's derivitaves have a similar call.

3) Samba Team???

Mike Ober.
 
I

imbsysop

Frank Pospischil said:
Hi there,

i still have a weird problem with Powerpoint an Excel files stored on a
Samba share.

Only read on if you
-use a samba share as MULTI-user file repository (no force_user etc.)
-where multiple, different users share files in common directories
-the modification time of a file is of any relevance to you.
(seems like lots of folks don´t bother access rights or keep their
information strictly user-wise organised ...)

do you synch time at user logon as per documentation ?

timer server = yes in global sectio of smb.conf

then a "net time ..something" in the logon.bat file ..
Is that not doing the trick ?

FWIW
 
F

Frank Pospischil

....
do you synch time at user logon as per documentation ?

timer server = yes in global sectio of smb.conf

then a "net time ..something" in the logon.bat file ..
Is that not doing the trick ?

FWIW
Hi FWIW ;-)
Excerpt from the samba doc:
time server (G)

This parameter determines if nmbd(8) advertises itself as a time server to
Windows clients.

Why should this change anything in file system behavior ?

BTW: All users use the same time as they use the same workstation (Terminal
services).
The fileserver is in sync with the Terminalserver.

I think this problem is not a Time-offset problem.

Frank
 
I

imbsysop

Frank Pospischil said:
...
Hi FWIW ;-)
Excerpt from the samba doc:
time server (G)

This parameter determines if nmbd(8) advertises itself as a time server to
Windows clients.

Why should this change anything in file system behavior ?

probably .. because if you correctly issue the "net time" command in the
logon.bat file of the users, every windows workstation gets a timesync with
the server at logon. I assume that you are not developping yr powerpoint
files on a samba server do you ? :) So at least the timestamp of yr files
will be in sync with the time chronology on the server ...
 
F

Frank Pospischil

....
... I assume that you are not developping yr powerpoint
files on a samba server do you ? :)

I assume that we are talking about a fileserver.
Whereelse should a shared Powerpointfile reside ???

Is it uncommon to place Office-Files in public places to work together on
them ?

Frank
 
I

imbsysop

Frank Pospischil said:
...

I assume that we are talking about a fileserver.
Whereelse should a shared Powerpointfile reside ???

Is it uncommon to place Office-Files in public places to work together on
them ?

so what is the problem that you are not doing a time sync at user logon as
documented in the setup docs of samba scatered all over the internet ? the
purpose is just to avoid discrepancies in file timestamp creation.
 
F

Frank Pospischil

imbsysop said:
so what is the problem that you are not doing a time sync at user logon as
documented in the setup docs of samba scatered all over the internet ? the
purpose is just to avoid discrepancies in file timestamp creation.
Be assured, all servers and clients have the same time.
We do this by using NTP.

BTW: Doing it in a login script would not work, because a Domain-User has no
right to change the Terminal server´s time.
(And that´s good the way it is)

Thank you for your time and efforts.

Frank
 
I

imbsysop

Frank Pospischil said:
Be assured, all servers and clients have the same time.
We do this by using NTP.

BTW: Doing it in a login script would not work, because a Domain-User has no
right to change the Terminal server´s time.
(And that´s good the way it is)

you are not following what I'm saying ... it is not a matter of setting time
through NTP but a matter of (absolute) time sync between server and
workstation ..

... and your logon.bat script will not change the time on the server ie the
user does not need rights on the server for anything, but it will sync the
time on the workstation.
open a dos window on yr XP machines and at the prompt type <net time /?>
 
F

Frank Pospischil

imbsysop said:
time
through NTP but a matter of (absolute) time sync between server and
workstation ..

.. and your logon.bat script will not change the time on the server ie the
user does not need rights on the server for anything, but it will sync the
time on the workstation.
open a dos window on yr XP machines and at the prompt type <net time /?>

Have you ever heard of Microsoft terminal services?
The worksation you keep on talking about is the Terminalserver.
Each and every user uses this very same "Workstation".
Same Workstation, same time ! Changed time = changed time for all users =
changed Terminalservertime !
Absolute time sync exist only 1 millisecond after the sync on logon. After 2
hours, the timedifference between client and fileserver is > 0.
By periodically updating the "workstation" time and fileservertime via ntp
the matching is much closer than by syncing only once per day.
The XP-Clients you mentioned do not exist. The Windows session is displayed
on a Linux X-Server.The protocol used is ICA.

Do you still insist on time-syncing ?

Frank
 
I

imbsysop

Frank Pospischil said:
/?>

Have you ever heard of Microsoft terminal services?
The worksation you keep on talking about is the Terminalserver.
Each and every user uses this very same "Workstation".
Same Workstation, same time ! Changed time = changed time for all users =
changed Terminalservertime !
Absolute time sync exist only 1 millisecond after the sync on logon. After 2
hours, the timedifference between client and fileserver is > 0.
By periodically updating the "workstation" time and fileservertime via ntp
the matching is much closer than by syncing only once per day.
The XP-Clients you mentioned do not exist. The Windows session is displayed
on a Linux X-Server.The protocol used is ICA.

Do you still insist on time-syncing ?

I rest my case .. !! Time will tell (pun intended)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top