[linux-cifs-client] tail -f /mounted/share/filename is not working

Günter Kukkukk linux at kukkukk.com
Thu Mar 19 03:59:14 GMT 2009


Hi Steve, Jeff,

this one is on my todo list for more than a year now.

Btw - when using the mount option "directio", all _seems_ to be fine.

The inner "tail" operations might look very simple. Cause they are not, i've written
a test applet "statgk" (which mimics some tail stuff), so this code might
be better readable. (to be used on the client side)
In addition to 'tail', statgk reports the changing file size (!) and also writes the
hex representation of the latest "newly read in" bytes to stdout.

Also wrote a test applet wrt.c (to be used on the server side)

How to test:
  server side: use "./wrt filename" or "./wrt -s 100 filename"
               to start writing/appending to a file on a (samba) exported share
               (regarding the '-s' option, I though writing large data would/could
                trigger some cifs "re-read server" internals (page dirty...))
  cifs client side: (one might use 'tail -f /mnt/xyz/filename' as well)
                    use ./statgk /mnt/xyz/filename

On the cifs client side "statgk" uses fstat() to get possible _updated_
file info from the server (filesize, times, ...) - cifs *realizes* (!) the size (times) change,
but no "read additional data" from the server is done.

Cheers, Günter

I append the sources of "wrt.c" and "statgk.c"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrt.c
Type: text/x-csrc
Size: 1591 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux-cifs-client/attachments/20090319/a1365aef/wrt.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: statgk.c
Type: text/x-csrc
Size: 3747 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux-cifs-client/attachments/20090319/a1365aef/statgk.bin


More information about the linux-cifs-client mailing list