CIFS bug report / tailing a file breaks

Yaron Minsky yminsky at gmail.com
Sun Jul 3 12:31:31 GMT 2005


I've found what appears to be a fairly serious and fairly easy to replicate 
bug in CIFS. Basically, tailing a file as it changes doesn't work. The same 
stuff basically does work in smbfs, but fails with cifs.

Here's how to replicate it. Basically, mount a remote CIFS share. Start tail 
running on a given file, and then start appending to that file from the 
remote side (I've tried this with the remote side being both a windows 
machine and a linux machine.) The side mounting the CIFS share won't keep up 
with the changes, and even worse, if you then look at the file in less, 
you'll see that the end of the file has been filled with zeros. If you then 
unmount and remount the file system, the file will look OK again.

So, for example, the original file (after being appended to) looks like 
this:

[primusl at pendor ~]$ cat foo
snoo
snoo
foobar
foobar
foobar
foobar
foobar
foobar
snoo
snoo
snoo
snoo
snoo
snoo
snoo
snoo
snoo
snoo
snoo


The tail on the mounting side looks like this:

tehanu: win # cat foo
snoo
snoo
foobar
foobar
foobar
foobar
foobar

And less-ing the mounting-side file I get this:

snoo
snoo
foobar
foobar
foobar
foobar
foobar
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
foo lines 1-8/8 (END)

Here's the output of /proc/version:

Linux version 2.6.11-1.1369_FC4 (bhcompile at decompose.build.redhat.com) (gcc 
version 4.0.0 20050525 (Red Hat 4.0.0-9)) #1 Thu Jun 2 22:55:56 EDT 2005

I've replicated this on multiple platforms with multiple kernel versions and 
different hardware, so I don't think it's hard to replicate. If anyone has 
problems replicating it, I can come up with a tighter description of the 
platforms I've tried.


More information about the samba-technical mailing list