Bug 2045 - File timestamps inconsistent
File timestamps inconsistent
Product: Samba 3.0
Classification: Unclassified
Component: File Services
x86 Windows 2000
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2004-11-17 07:31 UTC by Hartmut Honisch
Modified: 2007-11-15 08:06 UTC (History)
1 user (show)

See Also:

Small test app (c++) (1.82 KB, text/plain)
2004-11-17 07:34 UTC, Hartmut Honisch
no flags Details
Applied patch. (2.38 KB, patch)
2004-11-20 14:22 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hartmut Honisch 2004-11-17 07:31:08 UTC
After having set a file's timestamp on a samba-share using SetFileTime(), 
FindFirstFile() still returns the old timestamp (GetFileTime() seems to work 
Comment 1 Hartmut Honisch 2004-11-17 07:34:23 UTC
Created attachment 778 [details]
Small test app (c++)

I've attached the source code of small test application (c++) that demonstrates
the problem.
Comment 2 Hartmut Honisch 2004-11-17 07:37:49 UTC
Comment on attachment 778 [details]
Small test app (c++)

I've attached the source code of small test application (c++) that demonstrates
the problem. Copy it on a samba share and launch it - it will create a test
file "testfile.tmp" in its current directory, set and retrive its timestamp and
print the results.
Comment 3 Jeremy Allison 2004-11-18 18:26:31 UTC
Ok, I think I know how to fix this but it may be computationally expensive. I'm
going to have to think about this some more....
Comment 4 Jeremy Allison 2004-11-20 14:22:11 UTC
Created attachment 801 [details]
Applied patch.
Comment 5 Jeremy Allison 2004-11-20 14:25:09 UTC
I think I've fixed this now - there is still a race condition but
it should work most of the time.
Comment 6 yuval yeret 2005-05-09 06:47:31 UTC
It seems like the fix induces many utime() calls when copying large files in
Windows Explorer. 

I'm trying to understand whether the fix requires setting the time (utime) on
EVERY SMBwrite, or just the first/last one ? The test case here is an empty
file, so its not an issue. 

But if the fix requires setting the time just on the first SMBWrite it might be
better to remember whether we already set the pending_modtime and skip doing it
when the pending_modtime is the one already used on this file ? Any oppinions ? 
Comment 7 Gerald (Jerry) Carter 2005-08-24 10:15:55 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.