s3:smbd/oplock obey kernel oplock setting when releasing oplocks
authorChristian Ambach <ambi@samba.org>
Mon, 4 Jan 2016 22:12:25 +0000 (23:12 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 6 Jan 2016 07:58:56 +0000 (08:58 +0100)
otherwise smbd asks the kernel to release an oplock that was never requested

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11400

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan  6 08:58:56 CET 2016 on sn-devel-144

source3/smbd/oplock.c

index 4d84347924ecf6f04ef30833543c64c208dc5ee7..4f108d9545e6da750b39427cf974dfa42929f06c 100644 (file)
@@ -96,9 +96,10 @@ static void release_file_oplock(files_struct *fsp)
 {
        struct smbd_server_connection *sconn = fsp->conn->sconn;
        struct kernel_oplocks *koplocks = sconn->oplocks.kernel_ops;
+       bool use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) && koplocks;
 
        if ((fsp->oplock_type != NO_OPLOCK) &&
-           koplocks) {
+           use_kernel) {
                koplocks->ops->release_oplock(koplocks, fsp, NO_OPLOCK);
        }