[Samba] Weird behaviour when using "kernel oplocks = yes" leading to "corrupt" files - bug in samba?

Jeremy Allison jra at samba.org
Fri Jun 1 22:54:10 GMT 2007


On Fri, Jun 01, 2007 at 11:44:29PM +0200, Matthias Merz wrote:
> Hi folks,
> 
> Today I noticed some strange behaviour when accessing a samba server
> (samba 3.0.25a) from windows: On our Debian fileserver I prepared a
> file testfile.txt being owned by user usera and group dpt-a. Then I
> "setfacl -m g:admins:rwx testfile.txt". User userb who is only in
> group admins, but not in dpt-a is thus permitted to access and change
> this file by its POSIX-ACL, which works flawlessly from linux.
> 
> $ getfacl testfile.txt
> # file: testfile.txt
> # owner: usera
> # group: dpt-a
> user::rwx
> group::r--
> group:admins:rwx
> mask::rwx
> other::r--
> 
> 
> Then I did some changes to that file from a windows machine via
> notepad.exe and noticed, that notepad seemed to "succeed" in saving,
> but the changes were *not* written to that file! Very strange IMHO.
> 
> 
> So I did some more digging with strace, since I didn't find a clue in
> the logs.
> 
> "strace -e open,close,write -f smbd -D" yielded:
> [pid 17704] open("foo/testfile.txt", O_RDWR|O_CREAT|O_NOFOLLOW, 0744) = 29
>   [some write()s to FD 24]
> [pid 17704] open("foo/testfile.txt", O_WRONLY|O_NOFOLLOW) = -1 EAGAIN (Resource temporarily unavailable)
> [pid 17704] --- SIGIO (I/O possible) @ 0 (0) ---
> [pid 17704] +++ killed by SIGIO +++
> [pid 17478] --- SIGCHLD (Child exited) @ 0 (0) ---

This actually looks like an old kernel bug that
has been fixed - sorry I can't remember the
version.

The kernel shouldn't be sending a SIGIO for an
oplock break, it should be sending a POSIX RT
signal #define RT_SIGNAL_LEASE (SIGRTMIN+1) in
the Samba source.

I recall this as a kernel bug that got fixed
a few months or so ago.

This isn't a Samba bug IMHO.

Jeremy.


More information about the samba mailing list