leases and F_NOTIFY in samba 3 & 4
tridge at samba.org
tridge at samba.org
Mon Apr 10 23:04:25 GMT 2006
> I understand that Samba uses F_SETLEASE, F_GETLEASE fcntls to implement
> oplocks in linux. Atleast in Samba3.
yes. These are used to supplement a user-space oplock implementation.
> Does Samba4 also use linux kernel leases?
Funny you should ask :-)
Samba4 does not have oplock support yet, but it just so happens that I
am working on it right now. I expect to have it working this week
(assuming other things don't get in the way).
> How much of a performance impact is it to run Samba with oplocks
that very much depends on the application. For some applications the
performance loss without oplocks is quite severe. For example, I
recently ran across an application used in the film industry that
opens each frame of a film while playing it anywhere between 8 and 12
times. With a batch oplock these extra opens are never sent on the
network so it performs quite well. Without an oplock the client will
do all those extra opens, which has a severe impact.
> I'm about to implement lease support for GFS, but at the outset, there
> seems to be a significant performance impact for the fs.
yes, for a clustered filesystem it will be quite expensive, but
hopefully it will be a lot less expensive than the extra round trips
from badly behaved applications.
> Also, can somebody comment on how the F_NOTIFY fcntl is used in Samba?
F_NOTIFY is part of dnotify, which is used in Samba3. In Samba4 we use
inotify instead of dnotify. The dnotify interface is not a good match
for the windows "change notify" functionality as it doesn't tell the
application what file has been changed/added/removed, so when using
dnotify Samba cannot get the change notify semantics right. I expect
that Samba3 will probably add support for inotify soon, as it is a
much better interface.
I'd suggest you work on inotify support rather than dnotify support
More information about the samba-technical