The Samba-Bugzilla – Attachment 13877 Details for
Bug 13193
smbd tries to release not leased oplock during oplock II downgrade
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated raw patch for master.
look (text/plain), 2.15 KB, created by
Jeremy Allison
on 2017-12-19 22:48:15 UTC
(
hide
)
Description:
Updated raw patch for master.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2017-12-19 22:48:15 UTC
Size:
2.15 KB
patch
obsolete
>diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c >index 1b2a87b8d8a..ef1e9502cb7 100644 >--- a/source3/smbd/oplock.c >+++ b/source3/smbd/oplock.c >@@ -131,13 +131,14 @@ static void downgrade_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 (!EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) { > DEBUG(0, ("trying to downgrade an already-downgraded oplock!\n")); > return; > } > >- if (koplocks) { >+ if (use_kernel) { > koplocks->ops->release_oplock(koplocks, fsp, LEVEL_II_OPLOCK); > } > fsp->oplock_type = LEVEL_II_OPLOCK; >@@ -729,12 +730,13 @@ static void add_oplock_timeout_handler(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 kernel oplocks already notifies smbds when an oplock break times > * out, just return. > */ >- if (koplocks && >+ if (use_kernel && > (koplocks->flags & KOPLOCKS_TIMEOUT_NOTIFICATION)) { > return; > } >@@ -1255,8 +1257,9 @@ void smbd_contend_level2_oplocks_begin(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 (koplocks && koplocks->ops->contend_level2_oplocks_begin) { >+ if (use_kernel && koplocks->ops->contend_level2_oplocks_begin) { > koplocks->ops->contend_level2_oplocks_begin(fsp, type); > return; > } >@@ -1269,9 +1272,10 @@ void smbd_contend_level2_oplocks_end(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; > > /* Only kernel oplocks implement this so far */ >- if (koplocks && koplocks->ops->contend_level2_oplocks_end) { >+ if (use_kernel && koplocks->ops->contend_level2_oplocks_end) { > koplocks->ops->contend_level2_oplocks_end(fsp, type); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 13193
:
13876
|
13877
|
13892
|
13893