- Timestamp:
- Sep 24, 2009, 9:15:13 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/docs/htmldocs/Samba3-HOWTO/locking.html
r272 r335 1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 17. File and Record Locking</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="The Official Samba 3.2.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="AccessControls.html" title="Chapter 16. File, Directory, and Share Access Controls"><link rel="next" href="securing-samba.html" title="Chapter 18. Securing Samba"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. File and Record Locking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="AccessControls.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="securing-samba.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="locking"></a>Chapter 17. File and Record Locking</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jeremy</span> <span class="orgname">Samba Team</span> <span class="surname">Allison</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="orgname">The Samba Team</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="orgname">Samba Team</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Eric</span> <span class="orgname">HP Oplocks Usage Recommendations Whitepaper</span> <span class="surname">Roseme</span></h3><div class="affiliation"><span class="orgname">HP Oplocks Usage Recommendations Whitepaper<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:eric.roseme@hp.com">eric.roseme@hp.com</a>></code></p></div></div></div></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="locking.html#id2615585">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="locking.html#id2615682">Discussion</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2615940">Opportunistic Locking Overview</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2616938">Samba Oplocks Control</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617033">Example Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617446">MS Windows Oplocks and Caching Controls</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617633">Workstation Service Entries</a></span></dt><dt><span class="sect2"><a href="locking.html#id2617655">Server Service Entries</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617721">Persistent Data Corruption</a></span></dt><dt><span class="sect1"><a href="locking.html#id2617747">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617814">locking.tdb Error Messages</a></span></dt><dt><span class="sect2"><a href="locking.html#id261784 4">Problems Saving Files in MS Office on Windows XP</a></span></dt><dt><span class="sect2"><a href="locking.html#id2617869">Long Delays Deleting Files over Network with XP SP1</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617901">Additional Reading</a></span></dt></dl></div><p>2 <a class="indexterm" name="id261557 4"></a>1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 17. File and Record Locking</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="The Official Samba 3.2.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="AccessControls.html" title="Chapter 16. File, Directory, and Share Access Controls"><link rel="next" href="securing-samba.html" title="Chapter 18. Securing Samba"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. File and Record Locking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="AccessControls.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="securing-samba.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="locking"></a>Chapter 17. File and Record Locking</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jeremy</span> <span class="orgname">Samba Team</span> <span class="surname">Allison</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="orgname">The Samba Team</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="orgname">Samba Team</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Eric</span> <span class="orgname">HP Oplocks Usage Recommendations Whitepaper</span> <span class="surname">Roseme</span></h3><div class="affiliation"><span class="orgname">HP Oplocks Usage Recommendations Whitepaper<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:eric.roseme@hp.com">eric.roseme@hp.com</a>></code></p></div></div></div></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="locking.html#id2615585">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="locking.html#id2615682">Discussion</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2615940">Opportunistic Locking Overview</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2616938">Samba Oplocks Control</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617033">Example Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617446">MS Windows Oplocks and Caching Controls</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617633">Workstation Service Entries</a></span></dt><dt><span class="sect2"><a href="locking.html#id2617655">Server Service Entries</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617721">Persistent Data Corruption</a></span></dt><dt><span class="sect1"><a href="locking.html#id2617747">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617814">locking.tdb Error Messages</a></span></dt><dt><span class="sect2"><a href="locking.html#id2617845">Problems Saving Files in MS Office on Windows XP</a></span></dt><dt><span class="sect2"><a href="locking.html#id2617869">Long Delays Deleting Files over Network with XP SP1</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617901">Additional Reading</a></span></dt></dl></div><p> 2 <a class="indexterm" name="id2615575"></a> 3 3 One area that causes trouble for many network administrators is locking. 4 4 The extent of the problem is readily evident from searches over the Internet. … … 8 8 and that MS Windows NT4/200x servers also provide. 9 9 </p><p> 10 <a class="indexterm" name="id261560 5"></a>10 <a class="indexterm" name="id2615606"></a> 11 11 The term <span class="emphasis"><em>locking</em></span> has exceptionally broad meaning and covers 12 12 a range of functions that are all categorized under this one term. … … 34 34 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2615682"></a>Discussion</h2></div></div></div><p> 35 35 <a class="indexterm" name="id2615690"></a> 36 <a class="indexterm" name="id261569 6"></a>36 <a class="indexterm" name="id2615697"></a> 37 37 There are two types of locking that need to be performed by an SMB server. 38 38 The first is <span class="emphasis"><em>record locking</em></span> that allows a client to lock … … 40 40 that are specified when a file is open. 41 41 </p><p> 42 <a class="indexterm" name="id261571 7"></a>42 <a class="indexterm" name="id2615718"></a> 43 43 <a class="indexterm" name="id2615724"></a> 44 44 <a class="indexterm" name="id2615731"></a> … … 83 83 <a class="indexterm" name="id2615883"></a> 84 84 <a class="indexterm" name="id2615890"></a> 85 <a class="indexterm" name="id261589 6"></a>85 <a class="indexterm" name="id2615897"></a> 86 86 <a class="indexterm" name="id2615903"></a> 87 87 The second class of locking is the <span class="emphasis"><em>deny modes</em></span>. These … … 93 93 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2615940"></a>Opportunistic Locking Overview</h3></div></div></div><p> 94 94 <a class="indexterm" name="id2615948"></a> 95 <a class="indexterm" name="id261595 5"></a>95 <a class="indexterm" name="id2615956"></a> 96 96 <a class="indexterm" name="id2615962"></a> 97 97 Opportunistic locking (oplocks) is invoked by the Windows file system … … 118 118 other processes. 119 119 </p><div class="variablelist"><p class="title"><b>Windows Defines Four Kinds of Oplocks:</b></p><dl><dt><span class="term">Level1 Oplock</span></dt><dd><p> 120 <a class="indexterm" name="id261608 1"></a>120 <a class="indexterm" name="id2616082"></a> 121 121 <a class="indexterm" name="id2616088"></a> 122 <a class="indexterm" name="id261609 4"></a>123 <a class="indexterm" name="id261610 1"></a>122 <a class="indexterm" name="id2616095"></a> 123 <a class="indexterm" name="id2616102"></a> 124 124 The redirector sees that the file was opened with deny 125 125 none (allowing concurrent access), verifies that no … … 148 148 <a class="indexterm" name="id2616177"></a> 149 149 <a class="indexterm" name="id2616184"></a> 150 <a class="indexterm" name="id261619 0"></a>150 <a class="indexterm" name="id2616191"></a> 151 151 Performs like a Level1 oplock, except caching is only 152 152 operative for reads. All other operations are performed … … 198 198 </p><p> 199 199 <a class="indexterm" name="id2616346"></a> 200 <a class="indexterm" name="id261635 2"></a>200 <a class="indexterm" name="id2616353"></a> 201 201 Windows oplocks is a lightweight performance-enhancing 202 202 feature. It is not a robust and reliable protocol. Every … … 272 272 the potential performance improvement is negated and eventually results 273 273 in a performance bottleneck. 274 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id261651 0"></a>UNIX or NFS Client-Accessed Files</h4></div></div></div><p>274 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616511"></a>UNIX or NFS Client-Accessed Files</h4></div></div></div><p> 275 275 <a class="indexterm" name="id2616519"></a> 276 <a class="indexterm" name="id261652 5"></a>276 <a class="indexterm" name="id2616526"></a> 277 277 Local UNIX and NFS clients access files without a mandatory 278 278 file-locking mechanism. Thus, these client platforms are incapable of … … 303 303 regularly opening the same file. 304 304 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616594"></a>Multiuser Databases</h4></div></div></div><p> 305 <a class="indexterm" name="id261660 1"></a>305 <a class="indexterm" name="id2616602"></a> 306 306 <a class="indexterm" name="id2616608"></a> 307 <a class="indexterm" name="id261661 5"></a>307 <a class="indexterm" name="id2616616"></a> 308 308 Multiuser databases clearly pose a risk due to their very nature they are typically heavily 309 309 accessed by numerous users at random intervals. Placing a multiuser database on a share with oplocks enabled … … 481 481 <code class="filename">smb.conf</code> file as shown in <a class="link" href="locking.html#far1" title="Example 17.1. Share with Some Files Oplocked">“Share with Some Files Oplocked”</a>. 482 482 </p><p> 483 </p><div class="example"><a name="far1"></a><p class="title"><b>Example 17.1. Share with Some Files Oplocked</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id261725 4"></a><em class="parameter"><code>veto oplock files = /filename.htm/*.txt/</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[share_name]</code></em></td></tr><tr><td><a class="indexterm" name="id2617276"></a><em class="parameter"><code>veto oplock files = /*.exe/filename.ext/</code></em></td></tr></table></div></div><p><br class="example-break">483 </p><div class="example"><a name="far1"></a><p class="title"><b>Example 17.1. Share with Some Files Oplocked</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2617255"></a><em class="parameter"><code>veto oplock files = /filename.htm/*.txt/</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[share_name]</code></em></td></tr><tr><td><a class="indexterm" name="id2617276"></a><em class="parameter"><code>veto oplock files = /*.exe/filename.ext/</code></em></td></tr></table></div></div><p><br class="example-break"> 484 484 </p><p> 485 485 <a class="link" href="smb.conf.5.html#OPLOCKBREAKWAITTIME" target="_top">oplock break wait time</a> is an <code class="filename">smb.conf</code> parameter … … 684 684 </p><p> 685 685 This error indicates a corrupted tdb. Stop all instances of smbd, delete locking.tdb, and restart smbd. 686 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id261784 4"></a>Problems Saving Files in MS Office on Windows XP</h3></div></div></div><a class="indexterm" name="id2617851"></a><p>This is a bug in Windows XP. More information can be686 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2617845"></a>Problems Saving Files in MS Office on Windows XP</h3></div></div></div><a class="indexterm" name="id2617851"></a><p>This is a bug in Windows XP. More information can be 687 687 found in <a class="ulink" href="http://support.microsoft.com/?id=812937" target="_top">Microsoft Knowledge Base article 812937</a></p>. 688 688 689 </div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2617869"></a>Long Delays Deleting Files over Network with XP SP1</h3></div></div></div><p>“<span class="quote">It sometimes takes approximately 35 seconds to delete files over the network after XP SP1 has been applied.</span>”</p><a class="indexterm" name="id261788 1"></a><p>This is a bug in Windows XP. More information can be found in <a class="ulink" href="http://support.microsoft.com/?id=811492" target="_top">689 </div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2617869"></a>Long Delays Deleting Files over Network with XP SP1</h3></div></div></div><p>“<span class="quote">It sometimes takes approximately 35 seconds to delete files over the network after XP SP1 has been applied.</span>”</p><a class="indexterm" name="id2617882"></a><p>This is a bug in Windows XP. More information can be found in <a class="ulink" href="http://support.microsoft.com/?id=811492" target="_top"> 690 690 Microsoft Knowledge Base article 811492</a></p>. 691 691 </div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2617901"></a>Additional Reading</h2></div></div></div><p>
Note:
See TracChangeset
for help on using the changeset viewer.