Skip to content

Commit

Permalink
smbd: Enable leases by default
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
  • Loading branch information
vlendec authored and slowfranklin committed Jul 22, 2016
1 parent 5e333b5 commit dd10c82
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
8 changes: 2 additions & 6 deletions docs-xml/smbdotconf/locking/smb2leases.xml
Expand Up @@ -7,8 +7,7 @@
This boolean option tells <command moreinfo="none">smbd</command> whether to
globally negotiate SMB2 leases on file open requests. Leasing is an SMB2-only
feature which allows clients to aggressively cache files locally above and
beyond the caching allowed by SMB1 oplocks. This (experimental) parameter is
set to off by default until the SMB2 leasing code is declared fully stable.
beyond the caching allowed by SMB1 oplocks.
</para>

<para>
Expand All @@ -18,14 +17,11 @@

<para>Note that the write cache won't be used for file handles with a smb2 write lease.</para>

<para>
The Samba implementation of leases is currently marked as experimental!
</para>
</description>

<related>oplocks</related>
<related>kernel oplocks</related>
<related>level2 oplocks</related>
<related>write cache size</related>
<value type="default">no</value>
<value type="default">yes</value>
</samba:parameter>
2 changes: 2 additions & 0 deletions lib/param/loadparm.c
Expand Up @@ -2898,6 +2898,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)

lpcfg_do_global_parameter(lp_ctx, "aio max threads", "100");

lpcfg_do_global_parameter(lp_ctx, "smb2 leases", "yes");

/* Allow modules to adjust defaults */
for (defaults_hook = defaults_hooks; defaults_hook;
defaults_hook = defaults_hook->next) {
Expand Down
1 change: 0 additions & 1 deletion selftest/target/Samba3.pm
Expand Up @@ -1411,7 +1411,6 @@ sub provision($$$$$$$$)
kernel oplocks = no
kernel change notify = no
smb2 leases = yes
logging = file
printing = bsd
Expand Down
1 change: 1 addition & 0 deletions selftest/target/Samba4.pm
Expand Up @@ -1652,6 +1652,7 @@ sub provision_ad_dc($$)
kernel oplocks = no
kernel change notify = no
smb2 leases = no
logging = file
printing = bsd
Expand Down
2 changes: 1 addition & 1 deletion source3/param/loadparm.c
Expand Up @@ -862,7 +862,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
Globals.smb2_max_write = DEFAULT_SMB2_MAX_WRITE;
Globals.smb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT;
Globals.smb2_max_credits = DEFAULT_SMB2_MAX_CREDITS;
Globals.smb2_leases = false;
Globals.smb2_leases = true;

lpcfg_string_set(Globals.ctx, &Globals.ncalrpc_dir,
get_dyn_NCALRPCDIR());
Expand Down

0 comments on commit dd10c82

Please sign in to comment.