Ignore:
Timestamp:
Mar 1, 2010, 3:05:48 PM (15 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3.x to 3.3.11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/docs/htmldocs/Samba3-HOWTO/locking.html

    r368 r411  
    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.75.2"><link rel="home" href="index.html" title="The Official Samba 3.3.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" title="Chapter 17. File and Record Locking"><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="surname">Allison</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>&gt;</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="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</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="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>&gt;</code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Eric</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">&lt;<a class="email" href="mailto:eric.roseme@hp.com">eric.roseme@hp.com</a>&gt;</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#id2621671">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="locking.html#id2621768">Discussion</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2622026">Opportunistic Locking Overview</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2623031">Samba Oplocks Control</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2623125">Example Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2623539">MS Windows Oplocks and Caching Controls</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2623726">Workstation Service Entries</a></span></dt><dt><span class="sect2"><a href="locking.html#id2623748">Server Service Entries</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2623814">Persistent Data Corruption</a></span></dt><dt><span class="sect1"><a href="locking.html#id2623839">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2623907">locking.tdb Error Messages</a></span></dt><dt><span class="sect2"><a href="locking.html#id2623937">Problems Saving Files in MS Office on Windows XP</a></span></dt><dt><span class="sect2"><a href="locking.html#id2623962">Long Delays Deleting Files over Network with XP SP1</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2623993">Additional Reading</a></span></dt></dl></div><p>
    2 <a class="indexterm" name="id2621660"></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.3.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">&lt;<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:eric.roseme@hp.com">eric.roseme@hp.com</a>&gt;</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#id2616945">Samba Oplocks Control</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617040">Example Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617453">MS Windows Oplocks and Caching Controls</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617640">Workstation Service Entries</a></span></dt><dt><span class="sect2"><a href="locking.html#id2617662">Server Service Entries</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617728">Persistent Data Corruption</a></span></dt><dt><span class="sect1"><a href="locking.html#id2617754">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="locking.html#id2617821">locking.tdb Error Messages</a></span></dt><dt><span class="sect2"><a href="locking.html#id2617852">Problems Saving Files in MS Office on Windows XP</a></span></dt><dt><span class="sect2"><a href="locking.html#id2617876">Long Delays Deleting Files over Network with XP SP1</a></span></dt></dl></dd><dt><span class="sect1"><a href="locking.html#id2617908">Additional Reading</a></span></dt></dl></div><p>
     2<a class="indexterm" name="id2615574"></a>
    33One area that causes trouble for many network administrators is locking.
    44The extent of the problem is readily evident from searches over the Internet.
    5 </p><div class="sect1" title="Features and Benefits"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621671"></a>Features and Benefits</h2></div></div></div><p>
    6 <a class="indexterm" name="id2621679"></a>
     5</p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2615585"></a>Features and Benefits</h2></div></div></div><p>
     6<a class="indexterm" name="id2615593"></a>
    77Samba provides all the same locking semantics that MS Windows clients expect
    88and that MS Windows NT4/200x servers also provide.
    99</p><p>
    10 <a class="indexterm" name="id2621691"></a>
     10<a class="indexterm" name="id2615605"></a>
    1111The term <span class="emphasis"><em>locking</em></span> has exceptionally broad meaning and covers
    1212a range of functions that are all categorized under this one term.
    1313</p><p>
    14 <a class="indexterm" name="id2621707"></a>
    15 <a class="indexterm" name="id2621714"></a>
    16 <a class="indexterm" name="id2621721"></a>
     14<a class="indexterm" name="id2615621"></a>
     15<a class="indexterm" name="id2615628"></a>
     16<a class="indexterm" name="id2615635"></a>
    1717Opportunistic locking is a desirable feature when it can enhance the
    1818perceived performance of applications on a networked client. However, the
     
    2424it is intended to provide.
    2525</p><p>
    26 <a class="indexterm" name="id2621740"></a>
     26<a class="indexterm" name="id2615654"></a>
    2727The MS Windows network administrator needs to be aware that file and record
    2828locking semantics (behavior) can be controlled either in Samba or by way of registry
    2929settings on the MS Windows client.
    30 </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
    31 <a class="indexterm" name="id2621755"></a>
     30</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
     31<a class="indexterm" name="id2615670"></a>
    3232Sometimes it is necessary to disable locking control settings on the Samba
    3333server as well as on each MS Windows client!
    34 </p></div></div><div class="sect1" title="Discussion"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621768"></a>Discussion</h2></div></div></div><p>
    35 <a class="indexterm" name="id2621775"></a>
    36 <a class="indexterm" name="id2621782"></a>
     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<a class="indexterm" name="id2615690"></a>
     36<a class="indexterm" name="id2615696"></a>
    3737There are two types of locking that need to be performed by an SMB server.
    3838The first is <span class="emphasis"><em>record locking</em></span> that allows a client to lock
     
    4040that are specified when a file is open.
    4141</p><p>
    42 <a class="indexterm" name="id2621803"></a>
    43 <a class="indexterm" name="id2621810"></a>
    44 <a class="indexterm" name="id2621817"></a>
    45 <a class="indexterm" name="id2621824"></a>
    46 <a class="indexterm" name="id2621831"></a>
     42<a class="indexterm" name="id2615717"></a>
     43<a class="indexterm" name="id2615724"></a>
     44<a class="indexterm" name="id2615731"></a>
     45<a class="indexterm" name="id2615738"></a>
     46<a class="indexterm" name="id2615745"></a>
    4747Record locking semantics under UNIX are very different from record locking under
    4848Windows. Versions of Samba before 2.2 have tried to use the native fcntl() UNIX
     
    5454many more differences, too many to be listed here.
    5555</p><p>
    56 <a class="indexterm" name="id2621851"></a>
    57 <a class="indexterm" name="id2621858"></a>
     56<a class="indexterm" name="id2615765"></a>
     57<a class="indexterm" name="id2615772"></a>
    5858Samba 2.2 and above implement record locking completely independently of the
    5959underlying UNIX system. If a byte-range lock that the client requests happens
     
    6161No other locks can be seen by UNIX, anyway.
    6262</p><p>
    63 <a class="indexterm" name="id2621873"></a>
    64 <a class="indexterm" name="id2621880"></a>
     63<a class="indexterm" name="id2615787"></a>
     64<a class="indexterm" name="id2615794"></a>
    6565Strictly speaking, an SMB server should check for locks before every read and write call on
    6666a file. Unfortunately, with the way fcntl() works, this can be slow and may overstress
     
    7171will make lock checking calls on <span class="emphasis"><em>every</em></span> read and write call.
    7272</p><p>
    73 <a class="indexterm" name="id2621921"></a>
     73<a class="indexterm" name="id2615836"></a>
    7474You can also disable byte-range locking completely by using
    7575<a class="link" href="smb.conf.5.html#LOCKING" target="_top">locking = no</a>.
     
    7878tell clients that everything is okay.
    7979</p><p>
    80 <a class="indexterm" name="id2621949"></a>
    81 <a class="indexterm" name="id2621955"></a>
    82 <a class="indexterm" name="id2621962"></a>
    83 <a class="indexterm" name="id2621969"></a>
    84 <a class="indexterm" name="id2621975"></a>
    85 <a class="indexterm" name="id2621982"></a>
    86 <a class="indexterm" name="id2621989"></a>
     80<a class="indexterm" name="id2615863"></a>
     81<a class="indexterm" name="id2615869"></a>
     82<a class="indexterm" name="id2615876"></a>
     83<a class="indexterm" name="id2615883"></a>
     84<a class="indexterm" name="id2615890"></a>
     85<a class="indexterm" name="id2615896"></a>
     86<a class="indexterm" name="id2615903"></a>
    8787The second class of locking is the <span class="emphasis"><em>deny modes</em></span>. These
    8888are set by an application when it opens a file to determine what types of
     
    9191<code class="constant">DENY_WRITE</code>, or <code class="constant">DENY_ALL</code>. There are also special compatibility
    9292modes called <code class="constant">DENY_FCB</code> and <code class="constant">DENY_DOS</code>.
    93 </p><div class="sect2" title="Opportunistic Locking Overview"><div class="titlepage"><div><div><h3 class="title"><a name="id2622026"></a>Opportunistic Locking Overview</h3></div></div></div><p>
    94 <a class="indexterm" name="id2622034"></a>
    95 <a class="indexterm" name="id2622041"></a>
    96 <a class="indexterm" name="id2622048"></a>
     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<a class="indexterm" name="id2615948"></a>
     95<a class="indexterm" name="id2615955"></a>
     96<a class="indexterm" name="id2615962"></a>
    9797Opportunistic locking (oplocks) is invoked by the Windows file system
    9898(as opposed to an API) via registry entries (on the server and the client)
     
    101101locally on the client that allows the following:
    102102</p><div class="variablelist"><dl><dt><span class="term">Read-ahead:</span></dt><dd><p>
    103 <a class="indexterm" name="id2622071"></a>
     103<a class="indexterm" name="id2615986"></a>
    104104                The client reads the local copy of the file, eliminating network latency.
    105105                </p></dd><dt><span class="term">Write caching:</span></dt><dd><p>
    106 <a class="indexterm" name="id2622090"></a>
     106<a class="indexterm" name="id2616004"></a>
    107107                The client writes to the local copy of the file, eliminating network latency.
    108108                </p></dd><dt><span class="term">Lock caching:</span></dt><dd><p>
    109 <a class="indexterm" name="id2622108"></a>
     109<a class="indexterm" name="id2616022"></a>
    110110                The client caches application locks locally, eliminating network latency.
    111111                </p></dd></dl></div><p>
    112 <a class="indexterm" name="id2622122"></a>
    113 <a class="indexterm" name="id2622129"></a>
    114 <a class="indexterm" name="id2622136"></a>
     112<a class="indexterm" name="id2616036"></a>
     113<a class="indexterm" name="id2616043"></a>
     114<a class="indexterm" name="id2616050"></a>
    115115The performance enhancement of oplocks is due to the opportunity of
    116116exclusive access to the file  even if it is opened with deny-none
    117117because Windows monitors the file's status for concurrent access from
    118118other processes.
    119 </p><div class="variablelist" title="Windows Defines Four Kinds of Oplocks:"><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="id2622167"></a>
    121 <a class="indexterm" name="id2622173"></a>
    122 <a class="indexterm" name="id2622180"></a>
    123 <a class="indexterm" name="id2622187"></a>
     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="id2616081"></a>
     121<a class="indexterm" name="id2616088"></a>
     122<a class="indexterm" name="id2616094"></a>
     123<a class="indexterm" name="id2616101"></a>
    124124                        The redirector sees that the file was opened with deny
    125125                        none (allowing concurrent access), verifies that no
     
    129129                        operations on the cached local file.
    130130                        </p><p>
    131 <a class="indexterm" name="id2622203"></a>
    132 <a class="indexterm" name="id2622210"></a>
    133 <a class="indexterm" name="id2622217"></a>
    134 <a class="indexterm" name="id2622224"></a>
     131<a class="indexterm" name="id2616117"></a>
     132<a class="indexterm" name="id2616124"></a>
     133<a class="indexterm" name="id2616131"></a>
     134<a class="indexterm" name="id2616138"></a>
    135135                        If a second process attempts to open the file, the open
    136136                        is deferred while the redirector "breaks" the original
     
    146146                        the oplock break.
    147147                        </p></dd><dt><span class="term">Level2 Oplock</span></dt><dd><p>
    148 <a class="indexterm" name="id2622262"></a>
    149 <a class="indexterm" name="id2622269"></a>
    150 <a class="indexterm" name="id2622276"></a>
     148<a class="indexterm" name="id2616177"></a>
     149<a class="indexterm" name="id2616184"></a>
     150<a class="indexterm" name="id2616190"></a>
    151151                                Performs like a Level1 oplock, except caching is only
    152152                operative for reads. All other operations are performed
    153153                on the server disk copy of the file.
    154154                </p></dd><dt><span class="term">Filter Oplock</span></dt><dd><p>
    155 <a class="indexterm" name="id2622296"></a>
     155<a class="indexterm" name="id2616211"></a>
    156156                                Does not allow write or delete file access.
    157157                </p></dd><dt><span class="term">Batch Oplock</span></dt><dd><p>
    158 <a class="indexterm" name="id2622315"></a>
     158<a class="indexterm" name="id2616229"></a>
    159159                                Manipulates file openings and closings and allows caching
    160160                of file attributes.
    161161                </p></dd></dl></div><p>
    162 <a class="indexterm" name="id2622329"></a>
     162<a class="indexterm" name="id2616243"></a>
    163163An important detail is that oplocks are invoked by the file system, not
    164164an application API. Therefore, an application can close an oplocked
     
    167167preparation for the subsequent open by the second process.
    168168</p><p>
    169 <a class="indexterm" name="id2622345"></a>
    170 <a class="indexterm" name="id2622352"></a>
    171 <a class="indexterm" name="id2622359"></a>
    172 <a class="indexterm" name="id2622366"></a>
     169<a class="indexterm" name="id2616259"></a>
     170<a class="indexterm" name="id2616266"></a>
     171<a class="indexterm" name="id2616273"></a>
     172<a class="indexterm" name="id2616280"></a>
    173173<span class="emphasis"><em>Opportunistic locking</em></span> is actually an improper name for this feature.
    174174The true benefit of this feature is client-side data caching, and
     
    180180client-side caching benefit is negated.
    181181</p><p>
    182 <a class="indexterm" name="id2622388"></a>
     182<a class="indexterm" name="id2616302"></a>
    183183The actual decision that a user or administrator should consider is
    184184whether it is sensible to share among multiple users data that will
     
    186186Deciding when to cache or not cache data is the real question, and thus
    187187oplocks should be treated as a toggle for client-side
    188 caching. Turn it <span class="quote">&#8220;<span class="quote">on</span>&#8221;</span> when client-side caching is desirable and
    189 reliable. Turn it <span class="quote">&#8220;<span class="quote">off</span>&#8221;</span> when client-side caching is redundant,
     188caching. Turn it &#8220;<span class="quote">on</span>&#8221; when client-side caching is desirable and
     189reliable. Turn it &#8220;<span class="quote">off</span>&#8221; when client-side caching is redundant,
    190190unreliable, or counterproductive.
    191191</p><p>
    192 <a class="indexterm" name="id2622413"></a>
    193 Oplocks is by default set to <span class="quote">&#8220;<span class="quote">on</span>&#8221;</span> by Samba on all
     192<a class="indexterm" name="id2616327"></a>
     193Oplocks is by default set to &#8220;<span class="quote">on</span>&#8221; by Samba on all
    194194configured shares, so careful attention should be given to each case to
    195195determine if the potential benefit is worth the potential for delays.
     
    197197where oplocks may be effectively configured.
    198198</p><p>
    199 <a class="indexterm" name="id2622431"></a>
    200 <a class="indexterm" name="id2622438"></a>
     199<a class="indexterm" name="id2616346"></a>
     200<a class="indexterm" name="id2616352"></a>
    201201Windows oplocks is a lightweight performance-enhancing
    202202feature. It is not a robust and reliable protocol. Every
     
    209209storm. This configuration will likely encounter problems with oplocks.
    210210</p><p>
    211 <a class="indexterm" name="id2622458"></a>
     211<a class="indexterm" name="id2616372"></a>
    212212Oplocks can be beneficial to perceived client performance when treated
    213213as a configuration toggle for client-side data caching. If the data
     
    223223continuous data availability.
    224224</p><p>
    225 <a class="indexterm" name="id2622480"></a>
    226 <a class="indexterm" name="id2622487"></a>
     225<a class="indexterm" name="id2616395"></a>
     226<a class="indexterm" name="id2616402"></a>
    227227Windows client failover behavior is more at risk of application
    228228interruption than other platforms because it is dependent upon an
     
    234234require restarting.
    235235</p><p>
    236 <a class="indexterm" name="id2622515"></a>
    237 <a class="indexterm" name="id2622521"></a>
    238 <a class="indexterm" name="id2622528"></a>
     236<a class="indexterm" name="id2616429"></a>
     237<a class="indexterm" name="id2616435"></a>
     238<a class="indexterm" name="id2616442"></a>
    239239If a client session has been caching writes and reads locally due to
    240240oplocks, it is likely that the data will be lost when the
     
    251251testing should be done with all affected applications with oplocks
    252252enabled and disabled.
    253 </p><div class="sect3" title="Exclusively Accessed Shares"><div class="titlepage"><div><div><h4 class="title"><a name="id2622552"></a>Exclusively Accessed Shares</h4></div></div></div><p>
     253</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616466"></a>Exclusively Accessed Shares</h4></div></div></div><p>
    254254Oplocks is most effective when it is confined to shares
    255255that are exclusively accessed by a single user, or by only one user at
     
    260260Home directories are the most obvious examples of where the performance
    261261benefit of oplocks can be safely realized.
    262 </p></div><div class="sect3" title="Multiple-Accessed Shares or Files"><div class="titlepage"><div><div><h4 class="title"><a name="id2622572"></a>Multiple-Accessed Shares or Files</h4></div></div></div><p>
     262</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616487"></a>Multiple-Accessed Shares or Files</h4></div></div></div><p>
    263263As each additional user accesses a file in a share with oplocks
    264264enabled, the potential for delays and resulting perceived poor
     
    272272the potential performance improvement is negated and eventually results
    273273in a performance bottleneck.
    274 </p></div><div class="sect3" title="UNIX or NFS Client-Accessed Files"><div class="titlepage"><div><div><h4 class="title"><a name="id2622603"></a>UNIX or NFS Client-Accessed Files</h4></div></div></div><p>
    275 <a class="indexterm" name="id2622611"></a>
    276 <a class="indexterm" name="id2622618"></a>
     274</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616518"></a>UNIX or NFS Client-Accessed Files</h4></div></div></div><p>
     275<a class="indexterm" name="id2616526"></a>
     276<a class="indexterm" name="id2616532"></a>
    277277Local UNIX and NFS clients access files without a mandatory
    278278file-locking mechanism. Thus, these client platforms are incapable of
     
    284284If files are shared between Windows clients and either local UNIX
    285285or NFS users, turn oplocks off.
    286 </p></div><div class="sect3" title="Slow and/or Unreliable Networks"><div class="titlepage"><div><div><h4 class="title"><a name="id2622639"></a>Slow and/or Unreliable Networks</h4></div></div></div><p>
    287 <a class="indexterm" name="id2622647"></a>
    288 <a class="indexterm" name="id2622654"></a>
    289 <a class="indexterm" name="id2622660"></a>
     286</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616553"></a>Slow and/or Unreliable Networks</h4></div></div></div><p>
     287<a class="indexterm" name="id2616561"></a>
     288<a class="indexterm" name="id2616568"></a>
     289<a class="indexterm" name="id2616575"></a>
    290290The biggest potential performance improvement for oplocks
    291291occurs when the client-side caching of reads and writes delivers the
     
    302302oplocks if there is any chance of multiple users
    303303regularly opening the same file.
    304 </p></div><div class="sect3" title="Multiuser Databases"><div class="titlepage"><div><div><h4 class="title"><a name="id2622686"></a>Multiuser Databases</h4></div></div></div><p>
    305 <a class="indexterm" name="id2622694"></a>
    306 <a class="indexterm" name="id2622701"></a>
    307 <a class="indexterm" name="id2622708"></a>
     304</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616601"></a>Multiuser Databases</h4></div></div></div><p>
     305<a class="indexterm" name="id2616608"></a>
     306<a class="indexterm" name="id2616615"></a>
     307<a class="indexterm" name="id2616622"></a>
    308308Multiuser databases clearly pose a risk due to their very nature  they are typically heavily
    309309accessed by numerous users at random intervals. Placing a multiuser database on a share with oplocks enabled
    310310will likely result in a locking management bottleneck on the Samba server. Whether the database application is
    311311developed in-house or a commercially available product, ensure that the share has oplocks disabled.
    312 </p></div><div class="sect3" title="PDM Data Shares"><div class="titlepage"><div><div><h4 class="title"><a name="id2622728"></a>PDM Data Shares</h4></div></div></div><p>
    313 <a class="indexterm" name="id2622735"></a>
    314 <a class="indexterm" name="id2622742"></a>
    315 <a class="indexterm" name="id2622749"></a>
    316 <a class="indexterm" name="id2622756"></a>
    317 <a class="indexterm" name="id2622763"></a>
     312</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616642"></a>PDM Data Shares</h4></div></div></div><p>
     313<a class="indexterm" name="id2616649"></a>
     314<a class="indexterm" name="id2616656"></a>
     315<a class="indexterm" name="id2616663"></a>
     316<a class="indexterm" name="id2616670"></a>
     317<a class="indexterm" name="id2616677"></a>
    318318Process data management (PDM) applications such as IMAN, Enovia, and Clearcase are increasing in usage with
    319319Windows client platforms and therefore with SMB datastores. PDM applications manage multiuser environments for
     
    323323application and PDM server to negotiate and maintain. It is appropriate to eliminate the client OS from any
    324324caching tasks, and the server from any oplocks management, by disabling oplocks on the share.
    325 </p></div><div class="sect3" title="Beware of Force User"><div class="titlepage"><div><div><h4 class="title"><a name="id2622797"></a>Beware of Force User</h4></div></div></div><p>
    326 <a class="indexterm" name="id2622805"></a>
     325</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616711"></a>Beware of Force User</h4></div></div></div><p>
     326<a class="indexterm" name="id2616719"></a>
    327327Samba includes an <code class="filename">smb.conf</code> parameter called <a class="link" href="smb.conf.5.html#FORCEUSER" target="_top">force user</a> that changes the user
    328328accessing a share from the incoming user to whatever user is defined by the <code class="filename">smb.conf</code> variable. If oplocks is
     
    333333</p><p>
    334334Avoid the combination of the following:
    335 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
     335</p><div class="itemizedlist"><ul type="disc"><li><p>
    336336        <a class="link" href="smb.conf.5.html#FORCEUSER" target="_top">force user</a> in the <code class="filename">smb.conf</code> share configuration.
    337         </p></li><li class="listitem"><p>
     337        </p></li><li><p>
    338338        Slow or unreliable networks.
    339         </p></li><li class="listitem"><p>
     339        </p></li><li><p>
    340340        Oplocks enabled.
    341         </p></li></ul></div></div><div class="sect3" title="Advanced Samba Oplocks Parameters"><div class="titlepage"><div><div><h4 class="title"><a name="id2622885"></a>Advanced Samba Oplocks Parameters</h4></div></div></div><p>
    342 <a class="indexterm" name="id2622893"></a>
    343 <a class="indexterm" name="id2622900"></a>
    344 <a class="indexterm" name="id2622907"></a>
     341        </p></li></ul></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616799"></a>Advanced Samba Oplocks Parameters</h4></div></div></div><p>
     342<a class="indexterm" name="id2616807"></a>
     343<a class="indexterm" name="id2616814"></a>
     344<a class="indexterm" name="id2616821"></a>
    345345Samba provides oplock parameters that allow the
    346346administrator to adjust various properties of the oplock mechanism to
     
    351351<a class="link" href="smb.conf.5.html#OPLOCKCONTENTIONLIMIT" target="_top">oplock contention limit</a>.
    352352</p><p>
    353 <a class="indexterm" name="id2622947"></a>
     353<a class="indexterm" name="id2616861"></a>
    354354For most users, administrators, and environments, if these parameters
    355355are required, then the better option is simply to turn oplocks off.
    356 The Samba SWAT help text for both parameters reads: <span class="quote">&#8220;<span class="quote">Do not change
    357 this parameter unless you have read and understood the Samba oplock code.</span>&#8221;</span>
     356The Samba SWAT help text for both parameters reads: &#8220;<span class="quote">Do not change
     357this parameter unless you have read and understood the Samba oplock code.</span>&#8221;
    358358This is good advice.
    359 </p></div><div class="sect3" title="Mission-Critical, High-Availability"><div class="titlepage"><div><div><h4 class="title"><a name="id2622964"></a>Mission-Critical, High-Availability</h4></div></div></div><p>
     359</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2616878"></a>Mission-Critical, High-Availability</h4></div></div></div><p>
    360360In mission-critical, high-availability environments, data integrity is
    361361often a priority. Complex and expensive configurations are implemented
     
    387387testing should be done with all affected applications with oplocks
    388388enabled and disabled.
    389 </p></div></div></div><div class="sect1" title="Samba Oplocks Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2623031"></a>Samba Oplocks Control</h2></div></div></div><p>
     389</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2616945"></a>Samba Oplocks Control</h2></div></div></div><p>
    390390Oplocks is a unique Windows file locking feature. It is
    391391not really file locking, but is included in most discussions of Windows
     
    409409synchronizing the contents of the entire file back to the server for a single change.
    410410</p><p>
    411 Level1 Oplocks (also known as just plain <span class="quote">&#8220;<span class="quote">oplocks</span>&#8221;</span>) is another term for opportunistic locking.
     411Level1 Oplocks (also known as just plain &#8220;<span class="quote">oplocks</span>&#8221;) is another term for opportunistic locking.
    412412</p><p>
    413413Level2 Oplocks provides opportunistic locking for a file that will be treated as
     
    437437Another factor to consider is the perceived performance of file access. If oplocks provide no
    438438measurable speed benefit on your network, it might not be worth the hassle of dealing with them.
    439 </p><div class="sect2" title="Example Configuration"><div class="titlepage"><div><div><h3 class="title"><a name="id2623125"></a>Example Configuration</h3></div></div></div><p>
     439</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2617040"></a>Example Configuration</h3></div></div></div><p>
    440440In the following section we examine two distinct aspects of Samba locking controls.
    441 </p><div class="sect3" title="Disabling Oplocks"><div class="titlepage"><div><div><h4 class="title"><a name="id2623136"></a>Disabling Oplocks</h4></div></div></div><p>
     441</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2617050"></a>Disabling Oplocks</h4></div></div></div><p>
    442442You can disable oplocks on a per-share basis with the following:
    443443</p><p>
    444 </p><table border="0" summary="Simple list" class="simplelist"><tr><td> </td></tr><tr><td><em class="parameter"><code>[acctdata]</code></em></td></tr><tr><td><a class="indexterm" name="id2623163"></a><em class="parameter"><code>oplocks = False</code></em></td></tr><tr><td><a class="indexterm" name="id2623174"></a><em class="parameter"><code>level2 oplocks = False</code></em></td></tr></table><p>
     444</p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[acctdata]</code></em></td></tr><tr><td><a class="indexterm" name="id2617077"></a><em class="parameter"><code>oplocks = False</code></em></td></tr><tr><td><a class="indexterm" name="id2617089"></a><em class="parameter"><code>level2 oplocks = False</code></em></td></tr></table><p>
    445445</p><p>
    446446The default oplock type is Level1. Level2 oplocks are enabled on a per-share basis
     
    449449Alternately, you could disable oplocks on a per-file basis within the share:
    450450</p><p>
    451         </p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2623210"></a><em class="parameter"><code>veto oplock files = /*.mdb/*.MDB/*.dbf/*.DBF/</code></em></td></tr></table><p>
     451        </p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2617125"></a><em class="parameter"><code>veto oplock files = /*.mdb/*.MDB/*.dbf/*.DBF/</code></em></td></tr></table><p>
    452452</p><p>
    453453If you are experiencing problems with oplocks, as apparent from Samba's log entries,
    454454you may want to play it safe and disable oplocks and Level2 oplocks.
    455 </p></div><div class="sect3" title="Disabling Kernel Oplocks"><div class="titlepage"><div><div><h4 class="title"><a name="id2623231"></a>Disabling Kernel Oplocks</h4></div></div></div><p>
     455</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2617145"></a>Disabling Kernel Oplocks</h4></div></div></div><p>
    456456Kernel oplocks is an <code class="filename">smb.conf</code> parameter that notifies Samba (if
    457457the UNIX kernel has the capability to send a Windows client an oplock
     
    466466basis in the <code class="filename">smb.conf</code> file.
    467467</p><p>
    468 </p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2623271"></a><em class="parameter"><code>kernel oplocks = yes</code></em></td></tr></table><p>
     468</p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2617185"></a><em class="parameter"><code>kernel oplocks = yes</code></em></td></tr></table><p>
    469469The default is no.
    470470</p><p>
     
    481481<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">&#8220;Share with Some Files Oplocked&#8221;</a>.
    482482</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 border="0" summary="Simple list" class="simplelist"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2623347"></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="id2623368"></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="id2617262"></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="id2617283"></a><em class="parameter"><code>veto oplock files = /*.exe/filename.ext/</code></em></td></tr></table></div></div><p><br class="example-break">
    484484</p><p>
    485485<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
    486486that adjusts the time interval for Samba to reply to an oplock break request. Samba recommends:
    487 <span class="quote">&#8220;<span class="quote">Do not change this parameter unless you have read and understood the Samba oplock code.</span>&#8221;</span>
     487&#8220;<span class="quote">Do not change this parameter unless you have read and understood the Samba oplock code.</span>&#8221;
    488488Oplock break wait time can only be configured globally in the <code class="filename">smb.conf</code> file as shown:
    489489</p><p>
    490         </p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2623426"></a><em class="parameter"><code>oplock break wait time =  0 (default)</code></em></td></tr></table><p>
     490        </p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2617340"></a><em class="parameter"><code>oplock break wait time =  0 (default)</code></em></td></tr></table><p>
    491491</p><p>
    492492<span class="emphasis"><em>Oplock break contention limit</em></span> is an <code class="filename">smb.conf</code> parameter that limits the
    493493response of the Samba server to grant an oplock if the configured
    494494number of contending clients reaches the limit specified by the parameter. Samba recommends
    495 <span class="quote">&#8220;<span class="quote">Do not change this parameter unless you have read and understood the Samba oplock code.</span>&#8221;</span>
     495&#8220;<span class="quote">Do not change this parameter unless you have read and understood the Samba oplock code.</span>&#8221;
    496496Oplock break contention limit can be enabled on a per-share basis, or globally for
    497497the entire server, in the <code class="filename">smb.conf</code> file as shown in <a class="link" href="locking.html#far3" title="Example 17.2. Configuration with Oplock Break Contention Limit">&#8220;Configuration with Oplock Break Contention Limit&#8221;</a>.
    498498</p><p>
    499 </p><div class="example"><a name="far3"></a><p class="title"><b>Example 17.2. Configuration with Oplock Break Contention Limit</b></p><div class="example-contents"><table border="0" summary="Simple list" class="simplelist"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2623500"></a><em class="parameter"><code>oplock break contention limit =  2 (default)</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="id2623521"></a><em class="parameter"><code>oplock break contention limit =  2 (default)</code></em></td></tr></table></div></div><p><br class="example-break">
    500 </p></div></div></div><div class="sect1" title="MS Windows Oplocks and Caching Controls"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2623539"></a>MS Windows Oplocks and Caching Controls</h2></div></div></div><p>
     499</p><div class="example"><a name="far3"></a><p class="title"><b>Example 17.2. Configuration with Oplock Break Contention Limit</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="id2617414"></a><em class="parameter"><code>oplock break contention limit =  2 (default)</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="id2617435"></a><em class="parameter"><code>oplock break contention limit =  2 (default)</code></em></td></tr></table></div></div><p><br class="example-break">
     500</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2617453"></a>MS Windows Oplocks and Caching Controls</h2></div></div></div><p>
    501501There is a known issue when running applications (like Norton Antivirus) on a Windows 2000/ XP
    502502workstation computer that can affect any application attempting to access shared database files
     
    506506the Windows 2000/XP operating system will attempt to increase performance by locking the
    507507files and caching information locally. When this occurs, the application is unable to
    508 properly function, which results in an <span class="quote">&#8220;<span class="quote">Access Denied</span>&#8221;</span>
     508properly function, which results in an &#8220;<span class="quote">Access Denied</span>&#8221;
    509509 error message being displayed during network operations.
    510510</p><p>
     
    513513have oplocks disabled in order to minimize the risk of data file corruption.
    514514This includes Windows 9x/Me, Windows NT, Windows 200x, and Windows XP.
    515 <sup>[<a name="id2623571" href="#ftn.id2623571" class="footnote">5</a>]</sup>
     515<sup>[<a name="id2617485" href="#ftn.id2617485" class="footnote">5</a>]</sup>
    516516</p><p>
    517517If you are using a Windows NT family workstation in place of a server, you must also
     
    531531The location of the client registry entry for oplocks has changed in
    532532Windows 2000 from the earlier location in Microsoft Windows NT.
    533 </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
     533</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
    534534Windows 2000 will still respect the EnableOplocks registry value used to disable oplocks
    535535in earlier versions of Windows.
     
    544544                Default: 0 (not disabled)
    545545</pre><p>
    546 </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
     546</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
    547547The OplocksDisabled registry value configures Windows clients to either request or not
    548548request oplocks on a remote file. To disable oplocks, the value of
     
    559559                Default: 0 (Disabled by Default)
    560560</pre><p>
    561 </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
     561</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
    562562The EnableOplocks value configures Windows-based servers (including Workstations sharing
    563563files) to allow or deny oplocks on local files.
     
    566566</p><p>
    567567An illustration of how Level2 oplocks work follows:
    568 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
     568</p><div class="itemizedlist"><ul type="disc"><li><p>
    569569        Station 1 opens the file requesting oplock.
    570         </p></li><li class="listitem"><p>
     570        </p></li><li><p>
    571571        Since no other station has the file open, the server grants station 1 exclusive oplock.
    572         </p></li><li class="listitem"><p>
     572        </p></li><li><p>
    573573        Station 2 opens the file requesting oplock.
    574         </p></li><li class="listitem"><p>
     574        </p></li><li><p>
    575575        Since station 1 has not yet written to the file, the server asks station 1 to break
    576576        to Level2 oplock.
    577         </p></li><li class="listitem"><p>
     577        </p></li><li><p>
    578578        Station 1 complies by flushing locally buffered lock information to the server.
    579         </p></li><li class="listitem"><p>
     579        </p></li><li><p>
    580580        Station 1 informs the server that it has broken to level2 Oplock (alternately,
    581581        station 1 could have closed the file).
    582         </p></li><li class="listitem"><p>
     582        </p></li><li><p>
    583583        The server responds to station 2's open request, granting it Level2 oplock.
    584584        Other stations can likewise open the file and obtain Level2 oplock.
    585         </p></li><li class="listitem"><p>
     585        </p></li><li><p>
    586586        Station 2 (or any station that has the file open) sends a write request SMB.
    587587        The server returns the write response.
    588         </p></li><li class="listitem"><p>
     588        </p></li><li><p>
    589589        The server asks all stations that have the file open to break to none, meaning no
    590590        station holds any oplock on the file. Because the workstations can have no cached
    591591        writes or locks at this point, they need not respond to the break-to-none advisory;
    592592        all they need do is invalidate locally cashed read-ahead data.
    593         </p></li></ul></div><div class="sect2" title="Workstation Service Entries"><div class="titlepage"><div><div><h3 class="title"><a name="id2623726"></a>Workstation Service Entries</h3></div></div></div><pre class="programlisting">
     593        </p></li></ul></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2617640"></a>Workstation Service Entries</h3></div></div></div><pre class="programlisting">
    594594        \HKEY_LOCAL_MACHINE\System\
    595595                CurrentControlSet\Services\LanmanWorkstation\Parameters
     
    600600This indicates whether the redirector should use oplocks performance
    601601enhancement. This parameter should be disabled only to isolate problems.
    602 </p></div><div class="sect2" title="Server Service Entries"><div class="titlepage"><div><div><h3 class="title"><a name="id2623748"></a>Server Service Entries</h3></div></div></div><pre class="programlisting">
     602</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2617662"></a>Server Service Entries</h3></div></div></div><pre class="programlisting">
    603603        \HKEY_LOCAL_MACHINE\System\
    604604                CurrentControlSet\Services\LanmanServer\Parameters
     
    629629request. Smaller values can allow detection of crashed clients more quickly but can
    630630potentially cause loss of cached data.
    631 </p></div></div><div class="sect1" title="Persistent Data Corruption"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2623814"></a>Persistent Data Corruption</h2></div></div></div><p>
     631</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2617728"></a>Persistent Data Corruption</h2></div></div></div><p>
    632632If you have applied all of the settings discussed in this chapter but data corruption problems
    633633and other symptoms persist, here are some additional things to check out.
     
    640640to the new one. There are several known methods for doing this that can be found in
    641641our knowledge base.
    642 </p></div><div class="sect1" title="Common Errors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2623839"></a>Common Errors</h2></div></div></div><p>
     642</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2617754"></a>Common Errors</h2></div></div></div><p>
    643643In some sites locking problems surface as soon as a server is installed; in other sites
    644644locking problems may not surface for a long time. Almost without exception, when a locking
     
    648648that have claimed that Samba caused data corruption. Three causes have been identified
    649649so far:
    650 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
     650</p><div class="itemizedlist"><ul type="disc"><li><p>
    651651        Incorrect configuration of oplocks (incompatible with the application
    652652        being used). This is a common problem even where MS Windows NT4 or MS Windows
     
    655655        disable oplocks on both the server and the client. Disabling of all forms of file
    656656        caching on the MS Windows client may be necessary also.
    657         </p></li><li class="listitem"><p>
     657        </p></li><li><p>
    658658        Defective network cards, cables, or hubs/switches. This is generally a more
    659659        prevalent factor with low-cost networking hardware, although occasionally there
    660660        have also been problems with incompatibilities in more up-market hardware.
    661         </p></li><li class="listitem"><p>
     661        </p></li><li><p>
    662662        There have been some random reports of Samba log files being written over data
    663663        files. This has been reported by very few sites (about five in the past 3 years)
     
    670670        Make sure that you give as much information as you possibly can to help isolate the
    671671        cause and to allow replication of the problem (an essential step in problem isolation and correction).
    672         </p></li></ul></div><div class="sect2" title="locking.tdb Error Messages"><div class="titlepage"><div><div><h3 class="title"><a name="id2623907"></a>locking.tdb Error Messages</h3></div></div></div><p>
    673                 <span class="quote">&#8220;<span class="quote">
     672        </p></li></ul></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2617821"></a>locking.tdb Error Messages</h3></div></div></div><p>
     673                &#8220;<span class="quote">
    674674                        We are seeing lots of errors in the Samba logs, like:
    675                 </span>&#8221;</span>
     675                </span>&#8221;
    676676</p><pre class="programlisting">
    677677tdb(/usr/local/samba_2.2.7/var/locks/locking.tdb): rec_read bad magic
     
    679679</pre><p>
    680680
    681                 <span class="quote">&#8220;<span class="quote">
     681                &#8220;<span class="quote">
    682682                        What do these mean?
    683                 </span>&#8221;</span>
     683                </span>&#8221;
    684684        </p><p>
    685685        This error indicates a corrupted tdb. Stop all instances of smbd, delete locking.tdb, and restart smbd.
    686         </p></div><div class="sect2" title="Problems Saving Files in MS Office on Windows XP"><div class="titlepage"><div><div><h3 class="title"><a name="id2623937"></a>Problems Saving Files in MS Office on Windows XP</h3></div></div></div><a class="indexterm" name="id2623944"></a><p>This is a bug in Windows XP. More information can be
     686        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2617852"></a>Problems Saving Files in MS Office on Windows XP</h3></div></div></div><a class="indexterm" name="id2617858"></a><p>This is a bug in Windows XP. More information can be
    687687                found in <a class="ulink" href="http://support.microsoft.com/?id=812937" target="_top">Microsoft Knowledge Base article 812937</a></p>.
    688688
    689         </div><div class="sect2" title="Long Delays Deleting Files over Network with XP SP1"><div class="titlepage"><div><div><h3 class="title"><a name="id2623962"></a>Long Delays Deleting Files over Network with XP SP1</h3></div></div></div><p><span class="quote">&#8220;<span class="quote">It sometimes takes approximately 35 seconds to delete files over the network after XP SP1 has been applied.</span>&#8221;</span></p><a class="indexterm" name="id2623974"></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="id2617876"></a>Long Delays Deleting Files over Network with XP SP1</h3></div></div></div><p>&#8220;<span class="quote">It sometimes takes approximately 35 seconds to delete files over the network after XP SP1 has been applied.</span>&#8221;</p><a class="indexterm" name="id2617888"></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">
    690690                                Microsoft Knowledge Base article 811492</a></p>.
    691         </div></div><div class="sect1" title="Additional Reading"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2623993"></a>Additional Reading</h2></div></div></div><p>
     691        </div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2617908"></a>Additional Reading</h2></div></div></div><p>
    692692You may want to check for an updated documentation regarding file and record locking issues on the Microsoft
    693693<a class="ulink" href="http://support.microsoft.com/" target="_top">Support</a> web site. Additionally, search for the word
     
    696696Section of the Microsoft MSDN Library on opportunistic locking:
    697697</p><p>
    698 <a class="indexterm" name="id2624030"></a>
    699 Microsoft Knowledge Base, <span class="quote">&#8220;<span class="quote">Maintaining Transactional Integrity with OPLOCKS</span>&#8221;</span>,
     698<a class="indexterm" name="id2617944"></a>
     699Microsoft Knowledge Base, &#8220;<span class="quote">Maintaining Transactional Integrity with OPLOCKS</span>&#8221;,
    700700Microsoft Corporation, April 1999, <a class="ulink" href="http://support.microsoft.com/?id=224992" target="_top">Microsoft
    701701KB Article 224992</a>.
    702702</p><p>
    703 <a class="indexterm" name="id2624054"></a>
    704 Microsoft Knowledge Base, <span class="quote">&#8220;<span class="quote">Configuring Opportunistic Locking in Windows 2000</span>&#8221;</span>,
     703<a class="indexterm" name="id2617968"></a>
     704Microsoft Knowledge Base, &#8220;<span class="quote">Configuring Opportunistic Locking in Windows 2000</span>&#8221;,
    705705Microsoft Corporation, April 2001 <a class="ulink" href="http://support.microsoft.com/?id=296264" target="_top">Microsoft KB Article 296264</a>.
    706706</p><p>
    707 <a class="indexterm" name="id2624078"></a>
    708 Microsoft Knowledge Base, <span class="quote">&#8220;<span class="quote">PC Ext: Explanation of Opportunistic Locking on Windows NT</span>&#8221;</span>,
     707<a class="indexterm" name="id2617992"></a>
     708Microsoft Knowledge Base, &#8220;<span class="quote">PC Ext: Explanation of Opportunistic Locking on Windows NT</span>&#8221;,
    709709Microsoft Corporation, April 1995 <a class="ulink" href="http://support.microsoft.com/?id=129202" target="_top">Microsoft
    710710KB Article 129202</a>.
    711 </p></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2623571" href="#id2623571" class="para">5</a>] </sup>Microsoft has documented this in Knowledge Base article 300216.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="AccessControls.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="securing-samba.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 16. File, Directory, and Share Access Controls </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 18. Securing Samba</td></tr></table></div></body></html>
     711</p></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2617485" href="#id2617485" class="para">5</a>] </sup>Microsoft has documented this in Knowledge Base article 300216.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="AccessControls.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="securing-samba.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 16. File, Directory, and Share Access Controls </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 18. Securing Samba</td></tr></table></div></body></html>
Note: See TracChangeset for help on using the changeset viewer.