s3:smbd only initialize kernel oplocks if they are enabled for a share
[samba.git] / source3 / smbd / service.c
index c4d3486cdf6b662c816bed34e7bbc83345af8591..914cec86d8d87eca0e6d70b1417ba8ba0c449e5d 100644 (file)
@@ -709,6 +709,10 @@ static NTSTATUS make_connection_snum(struct smbd_server_connection *sconn,
                }
        }
 
+       if (lp_kernel_oplocks(snum)) {
+               init_kernel_oplocks(conn->sconn);
+       }
+
        /*
         * Fix compatibility issue pointed out by Volker.
         * We pass the conn->connectpath to the preexec