After having set a file's timestamp on a samba-share using SetFileTime(), FindFirstFile() still returns the old timestamp (GetFileTime() seems to work fine).
Created attachment 778 [details] Small test app (c++) I've attached the source code of small test application (c++) that demonstrates the problem.
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.
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.... Jeremy.
Created attachment 801 [details] Applied patch.
I think I've fixed this now - there is still a race condition but it should work most of the time. Jeremy.
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 ?
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.