[SCM] SAMBA-CTDB repository - branch v3-2-ctdb updated -
build_3.2.11_ctdb.60-8-g2aa0d5e
Michael Adam
obnox at samba.org
Mon May 18 15:21:49 GMT 2009
The branch, v3-2-ctdb has been updated
via 2aa0d5e360e3a7366d28dd0828c6840d8611ff62 (commit)
from 5239011c4938fe99c62169a740323c97f1424f59 (commit)
http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-2-ctdb
- Log -----------------------------------------------------------------
commit 2aa0d5e360e3a7366d28dd0828c6840d8611ff62
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 8 08:29:23 2009 +0200
We have to deny a level 2 oplock if kernel oplocks are enabled
The second r/o opener of a file is supposed to get a level2 oplock. The first
opener due to the protection in process_oplock_break_message() has been forced
to break to no oplock. The second opener according to locking.tdb gets a level2
oplock. Further down in open_file_ntcreate we try to set this level2 oplock in
the kernel, and the non-clustered Linux kernel disallows this. The rules for
the kernel leases are a bit baroque, but the attempt to do the SETLEASE
correctly fails and we end up with no oplock for any client.
In the clustered case however the linux kernel on the second opening node has
not seen the open fd of the first node, it is only the cluster fs that has this
information. If the cluster fs does not have the very same notion of leases as
the local kernel has, we can end up with a WRLCK style kernel lease for the
second opener where locking.tdb only indicates a level2 oplock. Getting a
kernel oplock break signal with just a level2 oplock in locking.tdb is
something smbd is not prepared for. For example after sending out the break in
response to the kernel signal we set a timeout, waiting for a reply.
More work needs to be done to make level2 kernel oplocks real for us. This
patch addresses a real problem we have right now without them.
-----------------------------------------------------------------------
Summary of changes:
source/smbd/oplock.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/smbd/oplock.c b/source/smbd/oplock.c
index 261d8fd..7ab8f25 100644
--- a/source/smbd/oplock.c
+++ b/source/smbd/oplock.c
@@ -104,6 +104,10 @@ void process_kernel_oplocks(struct messaging_context *msg_ctx, fd_set *pfds)
bool set_file_oplock(files_struct *fsp, int oplock_type)
{
+ if ((fsp->oplock_type == LEVEL_II_OPLOCK) && koplocks) {
+ return false;
+ }
+
if ((fsp->oplock_type != NO_OPLOCK) &&
(fsp->oplock_type != FAKE_LEVEL_II_OPLOCK) &&
koplocks &&
--
SAMBA-CTDB repository
More information about the samba-cvs
mailing list