s3:smbd: document the interaction between "smb2 leases" and "write cache size"
authorStefan Metzmacher <metze@samba.org>
Sat, 8 Nov 2014 08:45:59 +0000 (09:45 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 4 Dec 2014 04:45:10 +0000 (05:45 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
docs-xml/smbdotconf/locking/smb2leases.xml
docs-xml/smbdotconf/tuning/writecachesize.xml
source3/smbd/fileio.c

index 0a734ec8e9f5a267c594f44acee136d62358735a..9241bc823e63dcbe6ac1b388a298fa31125cddbe 100644 (file)
@@ -16,6 +16,8 @@
        and <smbconfoption name="kernel oplocks">no</smbconfoption>.
        </para>
 
+       <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>
@@ -24,5 +26,6 @@
 <related>oplocks</related>
 <related>kernel oplocks</related>
 <related>level2 oplocks</related>
+<related>write cache size</related>
 <value type="default">no</value>
 </samba:parameter>
index 12965b40487962cc7e685c6ccd6d18897aafc755..d7e2cc56c4e8c9c3a7201420d2abd9bd47571739 100644 (file)
 
     <para>The integer parameter specifies the size of this cache 
                (per oplocked file) in bytes.</para>
+
+    <para>Note that the write cache won't be used for file handles with a smb2 write lease.</para>
 </description>
 
+<related>smb2 leases</related>
 <value type="default">0</value>
 <value type="example">262144<comment> for a 256k cache size per file</comment></value>
 </samba:parameter>
index 9f3cc1a960d49fa744177c05f5791fd7d3208d39..2fe04324ee1bd7b69293544c25fcee4b668dfd3f 100644 (file)
@@ -339,6 +339,11 @@ ssize_t write_file(struct smb_request *req,
        if (!fsp->modified &&
            EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type) &&
            (wcp == NULL)) {
+               /*
+                * Note: no write cache with leases!
+                * as the handles would have to share the write cache
+                * that's possible but an improvement for another day...
+                */
                setup_write_cache(fsp, fsp->fsp_name->st.st_ex_size);
                wcp = fsp->wcp;
        }