Fix starvation of pending writes in CTDB queues
[Samba.git] / docs-xml / manpages / vfs_fileid.8.xml
blobed4d43470112df8a4ca0ed5cac7dde8280a79ff1
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="vfs_fileid.8">
5 <refmeta>
6         <refentrytitle>vfs_fileid</refentrytitle>
7         <manvolnum>8</manvolnum>
8         <refmiscinfo class="source">Samba</refmiscinfo>
9         <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10         <refmiscinfo class="version">&doc.version;</refmiscinfo>
11 </refmeta>
14 <refnamediv>
15         <refname>vfs_fileid</refname>
16         <refpurpose>Generates file_id structs with unique device id values for
17         cluster setups. It also adds ways to deliberately break lock coherency for specific inodes</refpurpose>
18 </refnamediv>
20 <refsynopsisdiv>
21         <cmdsynopsis>
22                 <command>vfs objects = fileid</command>
23         </cmdsynopsis>
24 </refsynopsisdiv>
26 <refsect1>
27         <title>DESCRIPTION</title>
29         <para>This VFS module is part of the
30         <citerefentry><refentrytitle>samba</refentrytitle>
31         <manvolnum>7</manvolnum></citerefentry>
32         suite.</para>
34         <para>Samba uses file_id structs to uniquely identify files
35         for locking purpose. By default the file_id contains the device
36         and inode number returned by the <command>stat()</command> system call.
37         As the file_id is a unique identifier of a file, it must be the same
38         on all nodes in a cluster setup. This module overloads the
39         <command>SMB_VFS_FILE_ID_CREATE()</command> operation and
40         generates the device number based on the configured algorithm
41         (see the "fileid:algorithm" option).
42         </para>
44         <para>When using the fsname or fsid algorithm a
45         <command>stat()</command> and <command>statfs()</command> call is
46         required for all mounted file systems to generate the file_id. If e.g.
47         an NFS file system is unresponsive such a call might block and the smbd
48         process will become unresponsive. Use the "fileid:fstype deny",
49         "fileid:fstype allow", "fileid:mntdir deny", or "fileid:mntdir allow"
50         options to ignore potentially unresponsive file systems.
51         </para>
52 </refsect1>
55 <refsect1>
56         <title>OPTIONS</title>
58         <variablelist>
60                 <varlistentry>
61                 <term>fileid:algorithm = ALGORITHM</term>
62                 <listitem>
63                 <para>Available algorithms are <command>fsname</command>,
64                 <command>fsid</command>, <command>next_module</command>. The default value is
65                 <command>fsname</command>. As well as the following legacy
66                 algorithms: <command>fsname_nodirs</command>, <command>fsname_norootdir</command>,
67                 <command>fsname_norootdir_ext</command> and <command>hostname</command>.
68                 </para>
70                 <para>The <command>fsname</command> algorithm generates
71                 device id by hashing the kernel device name.
72                 </para>
74                 <para>The <command>fsid</command> algorithm generates
75                 the device id from the <command>f_fsid</command> returned
76                 from the <command>statfs()</command> syscall.
77                 </para>
79                 <para>The <command>next_module</command> algorithm lets the next vfs module
80                 in the module chain generate the id. This is mainly used in combination
81                 with the various 'nolock' features the fileid module provides.
82                 </para>
84                 <para>The legacy <command>hostname</command> algorithm generates unique
85                 devid by hashing the hostname and low level device id.
86                 It also implies <command>fileid:nolock_all_inodes=yes</command>.
87                 This can be used to deliberately break lock coherency in a cluster
88                 and with <command>fileid:nolock_max_slots</command> also between local processes
89                 within a node. NOTE: Do not use this without knowing what you are doing!
90                 It breaks SMB semantics and it can lead to data corruption!
91                 This implies <command>fileid:nolock_all_inodes=yes</command>.
92                 </para>
94                 <para>The legacy <command>fsname_nodirs</command> algorithm is an alias
95                 for using the <command>fsname</command> algorithm together with
96                 <command>fileid:nolock_all_dirs=yes</command>.
97                 NOTE: Do not use this without knowing what you are doing!
98                 It breaks SMB semantics!
99                 See <command>fileid:nolock_paths</command> for a more fine grained
100                 approach.
101                 </para>
103                 <para>The legacy <command>fsname_norootdir</command> algorithm is an alias
104                 for using the <command>fsname</command> algorithm together with
105                 <command>fileid:nolock_paths= <quote>.</quote> </command>. It means
106                 this can be used to deliberately break lock coherency
107                 in a cluster for the root directory of a share.
108                 </para>
110                 <para>The legacy <command>fsname_norootdir_ext</command> algorithm is an alias
111                 for using the <command>fsname</command> algorithm together with
112                 <command>fileid:nolock_paths= <quote>.</quote></command> and
113                 <command>fileid:nolock_max_slots = 18446744073709551615</command>.
114                 It means this can be used to deliberately break lock coherency
115                 completely for the root directory of a share. Even local processes
116                 are no longer lock coherent.
117                 </para>
119                 </listitem>
120                 </varlistentry>
122                 <varlistentry>
123                 <term>fileid:mapping = ALGORITHM</term>
124                 <listitem>
125                 <para>This option is the legacy version of the
126                 <command>fileid:algorithm</command> option, which was used in earlier
127                 versions of fileid mapping feature in custom Samba 3.0 versions.
128                 </para>
129                 </listitem>
130                 </varlistentry>
132                 <varlistentry>
133                 <term>fileid:fstype deny = LIST</term>
134                 <listitem>
135                 <para>List of file system types to be ignored for file_id
136                 generation.
137                 </para>
138                 </listitem>
139                 </varlistentry>
141                 <varlistentry>
142                 <term>fileid:fstype allow = LIST</term>
143                 <listitem>
144                 <para>List of file system types to be allowed for file_id
145                 generation. If this option is set, file system types not listed
146                 here are ignored.
147                 </para>
148                 </listitem>
149                 </varlistentry>
151                 <varlistentry>
152                 <term>fileid:mntdir deny = LIST</term>
153                 <listitem>
154                 <para>List of file system mount points to be ignored for
155                 file_id generation.
156                 </para>
157                 </listitem>
158                 </varlistentry>
160                 <varlistentry>
161                 <term>fileid:mntdir allow = LIST</term>
162                 <listitem>
163                 <para>List of file system mount points to be allowed for file_id
164                 generation. If this option is set, file system mount points
165                 not listed here are ignored.
166                 </para>
167                 </listitem>
168                 </varlistentry>
170                 <varlistentry>
171                 <term>fileid:nolock_max_slots = NUMBER(1-18446744073709551615)</term>
172                 <listitem>
173                 <para>This option alters the behavior of the <command>nolock</command> algorithm
174                 in a way that it also breaks the lock coherency between individual processes
175                 on the same host. The default is to have just 1 concurrent slot available per host.
176                 By increasing the number of slots you can specify how many concurrent processes
177                 can work on a given inode without contention, the number should typically be larger
178                 than the number of logical cpus, maybe 2 times num_cpus.
179                 </para>
180                 </listitem>
181                 </varlistentry>
183                 <varlistentry>
184                 <term>fileid:nolock_all_dirs = BOOL</term>
185                 <listitem>
186                 <para>This option triggers the use of the fileid nolock behavior
187                 for all directory inodes, which can be used to deliberately break
188                 the lock coherency for all directories.
189                 NOTE: Do not use this without knowing what you are doing!
190                 It breaks SMB semantics!
191                 See <command>fileid:nolock_paths</command> for a more fine grained
192                 approach.
193                 </para>
194                 </listitem>
195                 </varlistentry>
197                 <varlistentry>
198                 <term>fileid:nolock_all_inodes = BOOL</term>
199                 <listitem>
200                 <para>This option triggers the use of the fileid nolock algorithm
201                 for all directoriy inode, which can be used to deliberately break
202                 the lock coherency for all directories.
203                 NOTE: Do not use this without knowing what you are doing!
204                 It breaks SMB semantics and it can lead to data corruption!
205                 See <command>fileid:nolock_paths</command> for a more fine grained
206                 approach.
207                 </para>
208                 </listitem>
209                 </varlistentry>
211                 <varlistentry>
212                 <term>fileid:nolock_paths = LIST</term>
213                 <listitem>
214                 <para>This option specifies a path list referring to files and/or directories,
215                 which should use fileid nolock algorithm in order to deliberately break
216                 the lock coherency for them. The specified paths can be relative to
217                 the share root directory or absolute. The names are case sensitive unix pathnames!
218                 Note all paths are only evaluated at tree connect time, when the share is being connected, from there on
219                 only the related device and inode numbers from the stat() syscall are compared.
220                 Non existing paths will generate a log level 0 message.
221                 NOTE: This option should be used with care as it breaks SMB semantics!
222                 But it may help in situation where a specific (commonly read-only) inode is highly contended.
223                 </para>
224                 </listitem>
225                 </varlistentry>
227                 <varlistentry>
228                 <term>fileid:nolockinode = NUMBER</term>
229                 <listitem>
230                 <para>This legacy option triggers use of the fileid nolock behavior
231                 for the configured inode, while ignoring and device id. This can be used to deliberately break
232                 lock coherency for the corresponding file or directory in a
233                 cluster. Using the <command>fileid:nolock_paths</command> option is much more flexible and simpler to use.
234                 </para>
235                 </listitem>
236                 </varlistentry>
237         </variablelist>
238 </refsect1>
240 <refsect1>
241         <title>EXAMPLES</title>
243         <para>Usage of the <command>fileid</command> module with the
244         <command>fsid</command> algorithm:</para>
246 <programlisting>
247         <smbconfsection name="[global]"/>
248         <smbconfoption name="vfs objects">fileid</smbconfoption>
249         <smbconfoption name="fileid:algorithm">fsid</smbconfoption>
250 </programlisting>
252         <para>Usage of the <command>fileid</command> module in order
253         avoid load on heavily contended (most likely read-only) inodes.</para>
255 <programlisting>
256         <smbconfsection name="[global]"/>
257         <smbconfoption name="vfs objects">fileid</smbconfoption>
258         <smbconfoption name="fileid:algorithm">next_module</smbconfoption>
259         <smbconfoption name="fileid:nolock_paths">. ContendedFolder1 /path/to/contended.exe</smbconfoption>
260         <smbconfoption name="fileid:nolock_max_slots">256</smbconfoption>
261 </programlisting>
263 </refsect1>
265 <refsect1>
266         <title>VERSION</title>
268         <para>This man page is part of version &doc.version; of the Samba suite.
269         </para>
270 </refsect1>
272 <refsect1>
273         <title>AUTHOR</title>
275         <para>The original Samba software and related utilities
276         were created by Andrew Tridgell. Samba is now developed
277         by the Samba Team as an Open Source project similar
278         to the way the Linux kernel is developed.</para>
280 </refsect1>
282 </refentry>