Debian Codegraph @

upstream/opensuse-tumbleweed/man8/vfs_fileid.8

raw
1 '\" t
2 .\" Title: vfs_fileid
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\" Date: 05/26/2026
6 .\" Manual: System Administration tools
7 .\" Source: Samba 4.23.8-git.477.f78166bceedSUSE-oS16.9-x86_64
8 .\" Language: English
9 .\"
10 .TH "VFS_FILEID" "8" "05/26/2026" "Samba 4\&.23\&.8\-git\&.477\&.f78166bcee" "System Administration tools"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 vfs_fileid \- Generates file_id structs with unique device id values for cluster setups\&. It also adds ways to deliberately break lock coherency for specific inodes
32 .SH "SYNOPSIS"
33 .HP \w'\ 'u
34 vfs objects = fileid
35 .SH "DESCRIPTION"
36 .PP
37 This VFS module is part of the
38 \fBsamba\fR(7)
39 suite\&.
40 .PP
41 Samba uses file_id structs to uniquely identify files for locking purpose\&. By default the file_id contains the device and inode number returned by the
42 stat()
43 system call\&. As the file_id is a unique identifier of a file, it must be the same on all nodes in a cluster setup\&. This module overloads the
44 SMB_VFS_FILE_ID_CREATE()
45 operation and generates the device number based on the configured algorithm (see the "fileid:algorithm" option)\&.
46 .PP
47 When using the fsname or fsid algorithm a
48 stat()
49 and
50 statfs()
51 call is required for all mounted file systems to generate the file_id\&. If e\&.g\&. an NFS file system is unresponsive such a call might block and the smbd process will become unresponsive\&. Use the "fileid:fstype deny", "fileid:fstype allow", "fileid:mntdir deny", or "fileid:mntdir allow" options to ignore potentially unresponsive file systems\&.
52 .SH "OPTIONS"
53 .PP
54 fileid:algorithm = ALGORITHM
55 .RS 4
56 Available algorithms are
57 fsname,
58 fsid,
59 next_module\&. The default value is
60 fsname\&. As well as the following legacy algorithms:
61 fsname_nodirs,
62 fsname_norootdir,
63 fsname_norootdir_ext
64 and
65 hostname\&.
66 .sp
67 The
68 fsname
69 algorithm generates device id by hashing the kernel device name\&.
70 .sp
71 The
72 fsid
73 algorithm generates the device id from the
74 f_fsid
75 returned from the
76 statfs()
77 syscall\&.
78 .sp
79 The
80 next_module
81 algorithm lets the next vfs module in the module chain generate the id\&. This is mainly used in combination with the various \*(Aqnolock\*(Aq features the fileid module provides\&.
82 .sp
83 The legacy
84 hostname
85 algorithm generates unique devid by hashing the hostname and low level device id\&. It also implies
86 fileid:nolock_all_inodes=yes\&. This can be used to deliberately break lock coherency in a cluster and with
87 fileid:nolock_max_slots
88 also between local processes within a node\&. NOTE: Do not use this without knowing what you are doing! It breaks SMB semantics and it can lead to data corruption! This implies
89 fileid:nolock_all_inodes=yes\&.
90 .sp
91 The legacy
92 fsname_nodirs
93 algorithm is an alias for using the
94 fsname
95 algorithm together with
96 fileid:nolock_all_dirs=yes\&. NOTE: Do not use this without knowing what you are doing! It breaks SMB semantics! See
97 fileid:nolock_paths
98 for a more fine grained approach\&.
99 .sp
100 The legacy
101 fsname_norootdir
102 algorithm is an alias for using the
103 fsname
104 algorithm together with
105 fileid:nolock_paths= \(lq\&.\(rq\&. It means this can be used to deliberately break lock coherency in a cluster for the root directory of a share\&.
106 .sp
107 The legacy
108 fsname_norootdir_ext
109 algorithm is an alias for using the
110 fsname
111 algorithm together with
112 fileid:nolock_paths= \(lq\&.\(rq
113 and
114 fileid:nolock_max_slots = 18446744073709551615\&. It means this can be used to deliberately break lock coherency completely for the root directory of a share\&. Even local processes are no longer lock coherent\&.
115 .RE
116 .PP
117 fileid:mapping = ALGORITHM
118 .RS 4
119 This option is the legacy version of the
120 fileid:algorithm
121 option, which was used in earlier versions of fileid mapping feature in custom Samba 3\&.0 versions\&.
122 .RE
123 .PP
124 fileid:fstype deny = LIST
125 .RS 4
126 List of file system types to be ignored for file_id generation\&.
127 .RE
128 .PP
129 fileid:fstype allow = LIST
130 .RS 4
131 List of file system types to be allowed for file_id generation\&. If this option is set, file system types not listed here are ignored\&.
132 .RE
133 .PP
134 fileid:mntdir deny = LIST
135 .RS 4
136 List of file system mount points to be ignored for file_id generation\&.
137 .RE
138 .PP
139 fileid:mntdir allow = LIST
140 .RS 4
141 List of file system mount points to be allowed for file_id generation\&. If this option is set, file system mount points not listed here are ignored\&.
142 .RE
143 .PP
144 fileid:nolock_max_slots = NUMBER(1\-18446744073709551615)
145 .RS 4
146 This option alters the behavior of the
147 nolock
148 algorithm in a way that it also breaks the lock coherency between individual processes on the same host\&. The default is to have just 1 concurrent slot available per host\&. By increasing the number of slots you can specify how many concurrent processes can work on a given inode without contention, the number should typically be larger than the number of logical cpus, maybe 2 times num_cpus\&.
149 .RE
150 .PP
151 fileid:nolock_all_dirs = BOOL
152 .RS 4
153 This option triggers the use of the fileid nolock behavior for all directory inodes, which can be used to deliberately break the lock coherency for all directories\&. NOTE: Do not use this without knowing what you are doing! It breaks SMB semantics! See
154 fileid:nolock_paths
155 for a more fine grained approach\&.
156 .RE
157 .PP
158 fileid:nolock_all_inodes = BOOL
159 .RS 4
160 This option triggers the use of the fileid nolock algorithm for all directoriy inode, which can be used to deliberately break the lock coherency for all directories\&. NOTE: Do not use this without knowing what you are doing! It breaks SMB semantics and it can lead to data corruption! See
161 fileid:nolock_paths
162 for a more fine grained approach\&.
163 .RE
164 .PP
165 fileid:nolock_paths = LIST
166 .RS 4
167 This option specifies a path list referring to files and/or directories, which should use fileid nolock algorithm in order to deliberately break the lock coherency for them\&. The specified paths can be relative to the share root directory or absolute\&. The names are case sensitive unix pathnames! Note all paths are only evaluated at tree connect time, when the share is being connected, from there on only the related device and inode numbers from the stat() syscall are compared\&. Non existing paths will generate a log level 0 message\&. NOTE: This option should be used with care as it breaks SMB semantics! But it may help in situation where a specific (commonly read\-only) inode is highly contended\&.
168 .RE
169 .PP
170 fileid:nolockinode = NUMBER
171 .RS 4
172 This legacy option triggers use of the fileid nolock behavior for the configured inode, while ignoring and device id\&. This can be used to deliberately break lock coherency for the corresponding file or directory in a cluster\&. Using the
173 fileid:nolock_paths
174 option is much more flexible and simpler to use\&.
175 .RE
176 .SH "EXAMPLES"
177 .PP
178 Usage of the
179 fileid
180 module with the
181 fsid
182 algorithm:
183 .sp
184 .if n \{\
185 .RS 4
186 .\}
187 .nf
188 \fI[global]\fR
189 \m[blue]\fBvfs objects = fileid\fR\m[]
190 \m[blue]\fBfileid:algorithm = fsid\fR\m[]
191 .fi
192 .if n \{\
193 .RE
194 .\}
195 .PP
196 Usage of the
197 fileid
198 module in order avoid load on heavily contended (most likely read\-only) inodes\&.
199 .sp
200 .if n \{\
201 .RS 4
202 .\}
203 .nf
204 \fI[global]\fR
205 \m[blue]\fBvfs objects = fileid\fR\m[]
206 \m[blue]\fBfileid:algorithm = next_module\fR\m[]
207 \m[blue]\fBfileid:nolock_paths = \&. ContendedFolder1 /path/to/contended\&.exe\fR\m[]
208 \m[blue]\fBfileid:nolock_max_slots = 256\fR\m[]
209 .fi
210 .if n \{\
211 .RE
212 .\}
213 .SH "VERSION"
214 .PP
215 This man page is part of version 4\&.23\&.8\-git\&.477\&.f78166bceedSUSE\-oS16\&.9\-x86_64 of the Samba suite\&.
216 .SH "AUTHOR"
217 .PP
218 The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.