Bug 4076 - vim timestamp issues on CIFS mounted shares
vim timestamp issues on CIFS mounted shares
Status: RESOLVED FIXED
Product: CifsVFS
Classification: Unclassified
Component: kernel fs
2.6
x86 Linux
: P3 normal
: ---
Assigned To: Steve French
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-01 13:11 UTC by Chris Elston
Modified: 2007-05-08 13:09 UTC (History)
6 users (show)

See Also:


Attachments
strace output while vim'ing a local file (102.24 KB, text/plain)
2006-09-05 10:12 UTC, Chris Elston
no flags Details
strace output while vim'ing a nfs mounted file (103.61 KB, text/plain)
2006-09-05 10:12 UTC, Chris Elston
no flags Details
strace output while vim'ing a cifs mounted file (105.67 KB, text/plain)
2006-09-05 10:13 UTC, Chris Elston
no flags Details
wireshark trace while vim'ing a cifs mounted file (868.44 KB, application/octet-stream)
2006-09-05 10:20 UTC, Chris Elston
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Elston 2006-09-01 13:11:32 UTC
This may be related to some other timestamp issues I've seen in other bug reports but I figured it couldn't hurt to offer up my problem.

I recently had to make the move from SMBFS to CIFS when I upgraded from
Fedora 4 to 5.  Changing settings in my /etc/fstab was easy and no
errors come up but now I'm having an issue very similar to post I found
on your list that got no response back in April:

http://lists.samba.org/archive/samba/2006-April/119813.html

Just as he describes in his second point, while editing a file from a
CIFS mounted share, something is confusing vim as to the timestamp of
the file and it thinks that the file has changed since my last writing.
My first write always works without a warning but all subsequent writes
produce the warning.  I can guarantee that I am in fact the only person
editing this file 

This occurs regardless of what OS owns the share.  I'm experiencing the
same situation on mounted shares from a Windows 2003 server as well
another Linux server running Fedora 5 as well.  This leads me to believe
it's more a client-side issue than improperly configured shares.  To a
further point, I attempted to alter the date/time on the Windows 2003
server to both before and after the date/time on my client machine w/ no
change in situation.  I've encountered some Vim
discussions/documentation alluding to an issue on Windows relating to
daylight savings but, again, since this appears to be happening
regardless of server OS, I've again weeded that out as a cause.

This issue never occurred while using SMBFS so I can only attribute it
to the new, forced, use of CIFS.  Likewise, I'm hesitant to blame vim as
I'm not having this problem on local files or files mounted through NFS
or other means.  Here's a run-down of my specs if it helps:

OS:  Fedora Core 5 Linux
Kernel version: 2.6.17 (from 2.6.17-1.2174_FC5 RPM)
Samba version: 3.0.23b (from samba.org provided RPMs)

/etc/fstab:
//SERVER/SHARE /PATHTO/MOUNTPOINT cifs
auto,setuids,user=XXX,password=XXX,gid=celston,uid=celston,dir_mode=0775,file_mode=0664        0 0
Comment 1 Matt Seitz 2006-09-02 19:19:31 UTC
I suggest running "wireshark", "tshark", "dumpcap", or "tcpdump" on your client and capturing a network trace while running VIM.  You can then attach the network capture file here.
Comment 2 Matt Seitz 2006-09-02 19:43:03 UTC
It might also be useful to run an "strace -o <file> vim", with VIM accessing a local file, a file on an NFS mount, and a file on a CIFS mount.
Comment 3 Chris Elston 2006-09-05 10:12:05 UTC
Created attachment 2122 [details]
strace output while vim'ing a local file
Comment 4 Chris Elston 2006-09-05 10:12:47 UTC
Created attachment 2123 [details]
strace output while vim'ing a nfs mounted file
Comment 5 Chris Elston 2006-09-05 10:13:19 UTC
Created attachment 2124 [details]
strace output while vim'ing a cifs mounted file
Comment 6 Chris Elston 2006-09-05 10:20:36 UTC
Created attachment 2125 [details]
wireshark trace while vim'ing a cifs mounted file

I filtered by the "smb" protocol
Comment 7 Chris Elston 2006-09-05 10:28:41 UTC
I've uploaded 4 files.  The first 3 are output of strace while editing the same file in 3 different scenarios: local, NFS mounted and CIFS mounted.  I also attached a filtered set of output from wireshark while vim'ing the cifs mounted file.  In each case I opened the file, wrote it (despite no changes), added a line, wrote again (in the case of the CIFS scenario, said "yes" to the prompt) and then quit vim.

This was my first time using wireshark so if you'd like me to try again w/ a specific set of instructions I can do that.
Comment 8 Felix Miata 2006-09-07 05:24:39 UTC
When I cifs mount OS/2 shares, all timestamps on all files and dirs are last epoch.
Comment 9 Chris Elston 2006-09-19 14:28:41 UTC
I have recently updated one of the Linux servers I often CIFS mount.  That server is running Fedora Core 4 and I installed Samba 3.0.23c from the source RPM provided at samba.org.  This seems to the fix problem I experience in vim.  The problem still exists on shares CIFS mounted from Windows 2003 servers.

This begs the questions: 1) What changed between 3.0.23a and 3.0.23c server-wise that fixed this? 2) What can I possibly do to my Windows served shares or the server itself to remedy my remaining problems?
Comment 10 Ricardo Gladwell 2006-10-03 15:43:41 UTC
I'm seeing similar problems using Fedora Eclipse over a cifs mount. I repeatedly get "update conflict" and "file changed" error messages in the course of just editing and opening files on the mount. It seems to be a repeat of this issue:

https://bugzilla.samba.org/show_bug.cgi?id=1729

As originally reported in this Eclipse bug report:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=16280
Comment 11 Adam Kunicki 2006-12-12 10:38:26 UTC
I experience a similar issue when attempting to "tail -f <file>" on a cifs mount.  tail does not receive any notification of file updates.  I did notice, tail will update if you "ls -l" in the directory/mount where the file is contained, thus forcing a timestamp update.

This is on Fedora Core 6 using 2.6.18 and 3.0.23c
Comment 12 Steve French 2007-03-14 17:17:33 UTC
Should be working now on current kernels and in cifs-backport-for-old kernels tree (in both kernel.org and in Samba svn).

cifs version 1.48
Comment 13 Matt LeClair 2007-03-28 14:37:36 UTC
I still have the same problem with Ubuntu 6.10 Edgy, kernel 2.6.17 and 2.6.20.  I
tried applying cifs 1.48 to my 2.6.17 kernel as described, but it would not compile.  I upgraded to kernel 2.6.20 which i believe includes cifs 1.48, but I continue to have the same issue which I've described here (https://bugzilla.samba.org/show_bug.cgi?id=3775)
Comment 14 Chris Elston 2007-03-30 09:44:40 UTC
I was able to confirm that this is resolved using a 2.6.20.4 kernel source and CIFS source from SVN.  I also had compile issues but was able to get around them.  I had to remove "export.o" from the Makefile and I got many warnings in the process.  Where best should I report my findings?
Comment 15 pasholy2001 2007-05-08 13:09:54 UTC
Yeah I had the same problem with 2.6.20-15, latest ubuntu right now. The cifs version with `modinfo cifs` is 1.47. I was able to fix this by compiling an external module cifs 1.48a that I got from http://us1.samba.org/samba/ftp/cifs-cvs/.