diff options
author | Christian Ambach <ambi@samba.org> | 2012-03-30 16:11:08 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-04-11 22:45:21 +0200 |
commit | 2927ca36706bf2e9b2b0458bbb1dfb493ea8e208 (patch) | |
tree | d60428385a73c126e8befa512d17ab5bbd7c2c77 /source3/smbd | |
parent | fbfbc6a252d3ab4e61d85abb7bc25e08f7b519eb (diff) | |
download | samba-2927ca36706bf2e9b2b0458bbb1dfb493ea8e208.tar.gz samba-2927ca36706bf2e9b2b0458bbb1dfb493ea8e208.tar.bz2 samba-2927ca36706bf2e9b2b0458bbb1dfb493ea8e208.zip |
s3:smbd only care about missing level2 support if kernel oplocks are enabled
if kernel oplocks are not enabled for that share, we can grant level2 oplocks
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Apr 11 22:45:21 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/oplock.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index c619edc5b9..b181fb79ba 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -62,8 +62,11 @@ void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp) bool set_file_oplock(files_struct *fsp, int oplock_type) { + + bool use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) && koplocks; + if (fsp->oplock_type == LEVEL_II_OPLOCK) { - if (koplocks && + if (use_kernel && !(koplocks->flags & KOPLOCKS_LEVEL2_SUPPORTED)) { DEBUG(10, ("Refusing level2 oplock, kernel oplocks " "don't support them\n")); @@ -73,7 +76,7 @@ bool set_file_oplock(files_struct *fsp, int oplock_type) if ((fsp->oplock_type != NO_OPLOCK) && (fsp->oplock_type != FAKE_LEVEL_II_OPLOCK) && - koplocks && + use_kernel && !koplocks->ops->set_oplock(koplocks, fsp, oplock_type)) { return False; } @@ -484,6 +487,7 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx, struct share_mode_entry msg; files_struct *fsp; bool break_to_level2 = False; + bool use_kernel; struct smbd_server_connection *sconn = talloc_get_type_abort(private_data, struct smbd_server_connection); @@ -543,9 +547,11 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx, return; } - if ((global_client_caps & CAP_LEVEL_II_OPLOCKS) && + use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) && koplocks; + + if ((global_client_caps & CAP_LEVEL_II_OPLOCKS) && !(msg.op_type & FORCE_OPLOCK_BREAK_TO_NONE) && - !(koplocks && !(koplocks->flags & KOPLOCKS_LEVEL2_SUPPORTED)) && + !(use_kernel && !(koplocks->flags & KOPLOCKS_LEVEL2_SUPPORTED)) && lp_level2_oplocks(SNUM(fsp->conn))) { break_to_level2 = True; } |