CIFS mount does not update file size for opened (for read) files

Bug #25031 reported by Radu Cornea
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Hi,

I encountered this bug with cifs under Ubuntu 5.10: if I mount a filesystem
using cifs and then modify a file on the server machine, the client side does
not update the filesize (or access time) for any opened file (for reading).
Here is a scenario (server is the machine providing the cifs share, client and
client1 are two terminals on the client machine which mounts the share):

server> ls -al test
-rw------- 1 user user 1780 Nov 4 16:09 test

client> mount //server/share /mnt/test -t cifs -o username=user
client> ls -al test
-rw------- 1 radu user 1780 2005-11-04 16:09 test

client1> tail -f test

server> echo "1234567890" >> mail/test
server> ls -al mail/test
-rw------- 1 radu user 1791 Nov 4 16:14 mail/test

client> ls -al test
-rw------- 1 radu user 1780 2005-11-04 16:09 test

As you can see, the filesize and access time are not updated for client, and
nothing shows up in the second terminal client1 (which runs tail -f test).
If ther test file is not opened (with tail -f or other program), the size and
time are updated fine. The size and time are also updated fine if the share is
mounted as smbfs, regardless if the file is opened for reading or not.
So, this is a problem of cifs only.

Thanks,

--
Radu

Matt Zimmerman (mdz)
Changed in samba:
assignee: nobody → adconrad
Revision history for this message
Corey Burger (corey.burger) wrote :

Radu, are you still seeing this issue with 6.06 or 6.10?

Changed in samba:
status: Unconfirmed → Needs Info
Revision history for this message
Radu Cornea (raduc) wrote :

Yes, I still see this in 6.06.
One correction for the steps above: 'mail/test' should be just 'test'.
Basically, as long as a file is opened for reading on the client machine, its content and attributes are not updated, even if it changes on the server.
This happens for cifs only.

Revision history for this message
Radu Cornea (raduc) wrote :

I just tested this on 6.10 and the problem is still there.

William Grant (wgrant)
Changed in samba:
status: Needs Info → Unconfirmed
Revision history for this message
Matthijs De Smedt (matthijs--) wrote :

Tested this in 7.04, still a problem.
I have spoken to people on the #samba channel, apparently this is a known problem and a fix is in the works. No idea when it would migrate into the kernel though.

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

Is it this bug perhaps https://bugzilla.samba.org/show_bug.cgi?id=4525 ? Seems to still be a problem in the 2.6.20 kernels. Could someone who has experienced this try with gutsy which has 2.6.22?

Changed in samba:
status: New → Incomplete
Changed in samba:
assignee: adconrad → ubuntu-kernel-server
Revision history for this message
Chuck Short (zulcss) wrote :

Is this still a problem with you in hardy?

Thanks
chuck

Revision history for this message
Pablo Castellano (pablocastellano) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in samba:
status: Incomplete → Invalid
Revision history for this message
hooby (michael-netkey) wrote :

I'm having that problem too.

I'm using Ubuntu 9.10 - Karmic Koala, all updated.

I do mount a samba share with this line in /etc/fstab:
//192.168.0.17/www /media/svn cifs auto,iocharset=utf8,uid=xxx,gid=users,credentials=/root/.cifscredentials,file_mode=0775,dir_mode=0775 0 0

version of mount:
$ mount -V
mount from util-linux-ng 2.16 (with libblkid and selinux support)

I'm editing files with SciTE Version 1.76
Scite does control if a file has changed by regularly checking the "last changed" date. If all changes are saved and the file has changed, scite reloads ist. If the buffer is dirty (unsaved changes) scite asks if i wanna reload the file. This works perfectly on lokal drives.

If working on the mount point mentioned above, scite does neither automatically reload clean buffers, nor ask me if i want to reload dirty buffers.

If you need any additional information, just let me know.

Changed in samba (Ubuntu):
status: Invalid → New
Revision history for this message
Thierry Carrez (ttx) wrote :

Switching to kernel since this is a CIFS issue.

affects: samba (Ubuntu) → linux (Ubuntu)
Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

Hi Radu,

Please be sure to confirm this issue exists with the latest development release of Ubuntu. ISO CD images are available from http://cdimage.ubuntu.com/releases/lucid . If the issue remains, please run the following command from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux 25031

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

[This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: needs-kernel-logs
tags: added: needs-upstream-testing
tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
oli z (oliver-z) wrote :

try adding the "directio" option to your fstab or your mount commandline (eg mount -t cifs -o username=xyz,password=abc,directio)

Revision history for this message
Michael Kiefer (kiefer-mpp) wrote :

I have the same problem here with several Lucid machines acessing one share. It does not seem to be reproduceable, happens only sometimes.

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for reporting this bug.

Does this occur in Maverick?

Changed in linux (Ubuntu):
assignee: Ubuntu Kernel Server Team (ubuntu-kernel-server) → nobody
Revision history for this message
dino99 (9d9) wrote :

This version has expired

Changed in linux (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.