We're running into an offline file sync conflict using Excel from Office 2003 on a Windows Vista machine. Steps to reproduce are: 1) From Windows, set the directory (in your Samba share) to make files always available offline. 2) Copy an Excel spreadsheet into the directory, and sync. 3) Modify the spreadsheet and save it. 4) Click the Sync button in Windows Explorer. Windows reports a conflict, and gives the reason as the file was changed on both the computer and the server while the computer was offline. From what I've seen, this only appears to happen with Office 2003 -- Office 2007 works fine for me.
Created attachment 4390 [details] Wireshark capture of the attempted sync transaction
Juston, ping me @ work to discuss and get this fixed. Thanks, Jeremy
Info from Microsoft. Jeremy, After much of testing and debugging, it seems that we are getting the cause why Windows takes the file offline and the timestamp update only goes to local store. When Windows close one particular handle through which the file had been modified, it queries the timestamps using FIND_FIRST2 on the file after receiving the close response. Those timestamps are then saved in CSC cache. We can see that the LastWriteTime value returned from the create response does not match the value returned from FIND_FRIST2 query. The mismatch of LastWriteTime causes Windows to declare the version conflict between server copy and local cache and thus takes it offline. Here are the details shown in the traces you sent us.. Office2003-opnclose-samba-bad.cap: Opening file, the current time stamp is written to the excel file Frame 175 10.20.0.111 10.20.0.66 SMB Trans2 Response, FIND_FIRST2, Files: excel test.xls Last Write: Jul 8, 2009 15:10:06.000000000 Frame 185 10.20.0.111 10.20.0.66 SMB NT Create AndX Response, FID: 0x13ff Last Write: Jul 8, 2009 15:10:06.000000000 Frame 214 10.20.0.66 10.20.0.111 SMB Trans2 Request, SET_FILE_INFO, FID: 0x13ff So far so good.. Closing file, the original time stamp is supposed to be restored to the excel file Frame 574 10.20.0.111 10.20.0.66 SMB Trans2 Response, FIND_FIRST2, Files: excel test.xls Last Write: Jul 8, 2009 19:36:12.294000000 Frame 587 10.20.0.111 10.20.0.66 SMB NT Create AndX Response, FID: 0x103e Last Write: Jul 8, 2009 19:36:12.000000000 Mismatch of time stamp is detected and remote file is closed and it is going offline. SET_FILEINFO will not sent to the server any update will only goes to local copy. Frame 588 10.20.0.66 10.20.0.111 SMB Close Request, FID: 0x103e From all the failed cases I got, I can see that only the millisecond part is different.
Created attachment 4587 [details] Wireshark trace referred to in the Microsoft email.
Created attachment 4588 [details] Patch for master. Need confirmation on ext4, but this should work. Jeremy.
Created attachment 4589 [details] Better patch for master, uses rounding instead of truncation.
Created attachment 4590 [details] git-am patch for 3.4.1.
Created attachment 4591 [details] git-am format patch for 3.3.x
Created attachment 4592 [details] git-am format patch for 3.2.x
Created attachment 4593 [details] Regular format patch for 3.0.x
Metze and Volker, please review. I think this needs to go into 3.4.1, but I'd like your thoughts on this. Thanks, Jeremy.
NB. Please postpone the review and addition for 3.4.1 - there are still some issues with this patch on a ext4 filesystem that I'm trying to track down. Jeremy.
Created attachment 4594 [details] Second part of the patch for master (applies on top of the other patch). From the reporter: ---------------------------------------------------------------------------- This patch also looks good with my test cases. I wan't able to make ext4 fail at all. I made ext3 fail a few times, but then it started working and never failed again on my next 50 sync attempts. So, I'm not really sure what was going on there, and I haven't been able to make it happen again. Maybe I'll play with it some more later this week. But this patch makes it behave the best I've seen so far. :) ---------------------------------------------------------------------------- Backports for the other branches to follow when I return from the UK on Sept. 5th. Jeremy.
Created attachment 4651 [details] Patch for 3.4.1 Ok, here's the fix for 3.4.x. It still needs testing when I get back in at work on the 8th, but this is what I'm planning for 3.4.x (maybe 3.4.1 ?). Jeremy.
Created attachment 4652 [details] Patch for 3.4.1 Grrr. Somehow selected the wrong file... This is the correct one. Jeremy.
Got confirmation from the reporter the 3.4.1 patch works on ext3/ext4. Jeremy.
Created attachment 4669 [details] Regular format patch for 3.0.x. Final patch for 3.0.x. Normal patch format. Jeremy.
Created attachment 4670 [details] git-am format patch for v3-4-test.
3.0 patch still needs some work. I have an idea as to the problem... Jeremy.
Created attachment 4684 [details] Regular format patch for 3.0.x. Works for me in my test env. on 3.0.x. Jeremy.
Created attachment 4685 [details] Regular format patch for 3.0.x. Needed a litte more of 3.4.x back-ported than I thought (need to stop setting mtime from clobbering atime). Works for me - waiting for input from the reporter. Jeremy.
Comment on attachment 4670 [details] git-am format patch for v3-4-test. I think this patch looks good
Customer confirms 3.0.x patch also. Karolin, please apply the git-am format patch for 3.4.2 in attachment #18 [details]. https://bugzilla.samba.org/attachment.cgi?id=4670&action=view Torture test to follow. Jeremy.
Created attachment 4692 [details] Torture test for master to ensure we don't regress.
Pushed to v3-4-test. I guess the 3.3 patch should be pushed also, right?
Hang on a minute Karolin, let me review and ensure the patches are identical and working first. It's been a while since I created the 3.3.x patch so I'd like to review first. Thanks for checking ! Jeremy.
Created attachment 4697 [details] git-am format patch for 3.4.2 (in addition to existing pushed fix). Karolin, here is a typo fix that would prevent the correct bugfix from working on a DARWIN (MacOSX) machine. Please push to 3.4.2 in addition to the existing fix to complete the patch. Jeremy.
Created attachment 4698 [details] git-am format patch for 3.3.x Here's the 3.3.x backport. Apply once I've confirmed in my test env. Thanks, Jeremy.
This somehow didn't make it to 3.3.x and 3.4.x (but it's fixed in 3.5.x and higher)