diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-06-12 13:52:43 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2019-06-14 16:21:04 -0400 |
commit | f0ba43774cea3fc14732bb9243ce7238ae8a3202 (patch) | |
tree | 5579b300bfc410ed14bb3112586cef02750d7eb0 | |
parent | 8ea618899b6b4fbe97c8462e7d769867307de011 (diff) |
docs: convert docs to ReST and rename to *.rst
The conversion is actually:
- add blank lines and indentation in order to identify paragraphs;
- fix tables markups;
- add some lists markups;
- mark literal blocks;
- adjust title markups.
At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | Documentation/device-mapper/cache-policies.rst (renamed from Documentation/device-mapper/cache-policies.txt) | 24 | ||||
-rw-r--r-- | Documentation/device-mapper/cache.rst (renamed from Documentation/device-mapper/cache.txt) | 214 | ||||
-rw-r--r-- | Documentation/device-mapper/delay.rst (renamed from Documentation/device-mapper/delay.txt) | 29 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-crypt.rst (renamed from Documentation/device-mapper/dm-crypt.txt) | 61 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-flakey.rst (renamed from Documentation/device-mapper/dm-flakey.txt) | 45 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-init.rst (renamed from Documentation/device-mapper/dm-init.txt) | 75 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-integrity.rst (renamed from Documentation/device-mapper/dm-integrity.txt) | 62 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-io.rst (renamed from Documentation/device-mapper/dm-io.txt) | 14 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-log.rst (renamed from Documentation/device-mapper/dm-log.txt) | 5 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-queue-length.rst (renamed from Documentation/device-mapper/dm-queue-length.txt) | 25 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-raid.rst (renamed from Documentation/device-mapper/dm-raid.txt) | 225 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-service-time.rst (renamed from Documentation/device-mapper/dm-service-time.txt) | 76 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-uevent.rst | 110 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-uevent.txt | 97 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-zoned.rst (renamed from Documentation/device-mapper/dm-zoned.txt) | 10 | ||||
-rw-r--r-- | Documentation/device-mapper/era.rst (renamed from Documentation/device-mapper/era.txt) | 36 | ||||
-rw-r--r-- | Documentation/device-mapper/index.rst | 44 | ||||
-rw-r--r-- | Documentation/device-mapper/kcopyd.rst (renamed from Documentation/device-mapper/kcopyd.txt) | 10 | ||||
-rw-r--r-- | Documentation/device-mapper/linear.rst | 63 | ||||
-rw-r--r-- | Documentation/device-mapper/linear.txt | 61 | ||||
-rw-r--r-- | Documentation/device-mapper/log-writes.rst (renamed from Documentation/device-mapper/log-writes.txt) | 105 | ||||
-rw-r--r-- | Documentation/device-mapper/persistent-data.rst (renamed from Documentation/device-mapper/persistent-data.txt) | 4 | ||||
-rw-r--r-- | Documentation/device-mapper/snapshot.rst (renamed from Documentation/device-mapper/snapshot.txt) | 116 | ||||
-rw-r--r-- | Documentation/device-mapper/statistics.rst (renamed from Documentation/device-mapper/statistics.txt) | 62 | ||||
-rw-r--r-- | Documentation/device-mapper/striped.rst | 61 | ||||
-rw-r--r-- | Documentation/device-mapper/striped.txt | 57 | ||||
-rw-r--r-- | Documentation/device-mapper/switch.rst (renamed from Documentation/device-mapper/switch.txt) | 47 | ||||
-rw-r--r-- | Documentation/device-mapper/thin-provisioning.rst (renamed from Documentation/device-mapper/thin-provisioning.txt) | 68 | ||||
-rw-r--r-- | Documentation/device-mapper/unstriped.rst (renamed from Documentation/device-mapper/unstriped.txt) | 93 | ||||
-rw-r--r-- | Documentation/device-mapper/verity.rst (renamed from Documentation/device-mapper/verity.txt) | 20 | ||||
-rw-r--r-- | Documentation/device-mapper/writecache.rst (renamed from Documentation/device-mapper/writecache.txt) | 13 | ||||
-rw-r--r-- | Documentation/device-mapper/zero.rst (renamed from Documentation/device-mapper/zero.txt) | 14 | ||||
-rw-r--r-- | Documentation/filesystems/ubifs-authentication.md | 4 | ||||
-rw-r--r-- | drivers/md/Kconfig | 2 | ||||
-rw-r--r-- | drivers/md/dm-init.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-raid.c | 2 |
36 files changed, 1142 insertions, 814 deletions
diff --git a/Documentation/device-mapper/cache-policies.txt b/Documentation/device-mapper/cache-policies.rst index 86786d87d9a8..b17fe352fc41 100644 --- a/Documentation/device-mapper/cache-policies.txt +++ b/Documentation/device-mapper/cache-policies.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============================= | ||
1 | Guidance for writing policies | 2 | Guidance for writing policies |
2 | ============================= | 3 | ============================= |
3 | 4 | ||
@@ -30,7 +31,7 @@ multiqueue (mq) | |||
30 | 31 | ||
31 | This policy is now an alias for smq (see below). | 32 | This policy is now an alias for smq (see below). |
32 | 33 | ||
33 | The following tunables are accepted, but have no effect: | 34 | The following tunables are accepted, but have no effect:: |
34 | 35 | ||
35 | 'sequential_threshold <#nr_sequential_ios>' | 36 | 'sequential_threshold <#nr_sequential_ios>' |
36 | 'random_threshold <#nr_random_ios>' | 37 | 'random_threshold <#nr_random_ios>' |
@@ -56,7 +57,9 @@ mq policy's hints to be dropped. Also, performance of the cache may | |||
56 | degrade slightly until smq recalculates the origin device's hotspots | 57 | degrade slightly until smq recalculates the origin device's hotspots |
57 | that should be cached. | 58 | that should be cached. |
58 | 59 | ||
59 | Memory usage: | 60 | Memory usage |
61 | ^^^^^^^^^^^^ | ||
62 | |||
60 | The mq policy used a lot of memory; 88 bytes per cache block on a 64 | 63 | The mq policy used a lot of memory; 88 bytes per cache block on a 64 |
61 | bit machine. | 64 | bit machine. |
62 | 65 | ||
@@ -69,7 +72,9 @@ cache block). | |||
69 | All this means smq uses ~25bytes per cache block. Still a lot of | 72 | All this means smq uses ~25bytes per cache block. Still a lot of |
70 | memory, but a substantial improvement nontheless. | 73 | memory, but a substantial improvement nontheless. |
71 | 74 | ||
72 | Level balancing: | 75 | Level balancing |
76 | ^^^^^^^^^^^^^^^ | ||
77 | |||
73 | mq placed entries in different levels of the multiqueue structures | 78 | mq placed entries in different levels of the multiqueue structures |
74 | based on their hit count (~ln(hit count)). This meant the bottom | 79 | based on their hit count (~ln(hit count)). This meant the bottom |
75 | levels generally had the most entries, and the top ones had very | 80 | levels generally had the most entries, and the top ones had very |
@@ -94,7 +99,9 @@ is used to decide which blocks to promote. If the hotspot queue is | |||
94 | performing badly then it starts moving entries more quickly between | 99 | performing badly then it starts moving entries more quickly between |
95 | levels. This lets it adapt to new IO patterns very quickly. | 100 | levels. This lets it adapt to new IO patterns very quickly. |
96 | 101 | ||
97 | Performance: | 102 | Performance |
103 | ^^^^^^^^^^^ | ||
104 | |||
98 | Testing smq shows substantially better performance than mq. | 105 | Testing smq shows substantially better performance than mq. |
99 | 106 | ||
100 | cleaner | 107 | cleaner |
@@ -105,16 +112,19 @@ The cleaner writes back all dirty blocks in a cache to decommission it. | |||
105 | Examples | 112 | Examples |
106 | ======== | 113 | ======== |
107 | 114 | ||
108 | The syntax for a table is: | 115 | The syntax for a table is:: |
116 | |||
109 | cache <metadata dev> <cache dev> <origin dev> <block size> | 117 | cache <metadata dev> <cache dev> <origin dev> <block size> |
110 | <#feature_args> [<feature arg>]* | 118 | <#feature_args> [<feature arg>]* |
111 | <policy> <#policy_args> [<policy arg>]* | 119 | <policy> <#policy_args> [<policy arg>]* |
112 | 120 | ||
113 | The syntax to send a message using the dmsetup command is: | 121 | The syntax to send a message using the dmsetup command is:: |
122 | |||
114 | dmsetup message <mapped device> 0 sequential_threshold 1024 | 123 | dmsetup message <mapped device> 0 sequential_threshold 1024 |
115 | dmsetup message <mapped device> 0 random_threshold 8 | 124 | dmsetup message <mapped device> 0 random_threshold 8 |
116 | 125 | ||
117 | Using dmsetup: | 126 | Using dmsetup:: |
127 | |||
118 | dmsetup create blah --table "0 268435456 cache /dev/sdb /dev/sdc \ | 128 | dmsetup create blah --table "0 268435456 cache /dev/sdb /dev/sdc \ |
119 | /dev/sdd 512 0 mq 4 sequential_threshold 1024 random_threshold 8" | 129 | /dev/sdd 512 0 mq 4 sequential_threshold 1024 random_threshold 8" |
120 | creates a 128GB large mapped device named 'blah' with the | 130 | creates a 128GB large mapped device named 'blah' with the |
diff --git a/Documentation/device-mapper/cache.txt b/Documentation/device-mapper/cache.rst index 8ae1cf8e94da..f15e5254d05b 100644 --- a/Documentation/device-mapper/cache.txt +++ b/Documentation/device-mapper/cache.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ===== | ||
2 | Cache | ||
3 | ===== | ||
4 | |||
1 | Introduction | 5 | Introduction |
2 | ============ | 6 | ============ |
3 | 7 | ||
@@ -24,10 +28,13 @@ scenarios (eg. a vm image server). | |||
24 | Glossary | 28 | Glossary |
25 | ======== | 29 | ======== |
26 | 30 | ||
27 | Migration - Movement of the primary copy of a logical block from one | 31 | Migration |
32 | Movement of the primary copy of a logical block from one | ||
28 | device to the other. | 33 | device to the other. |
29 | Promotion - Migration from slow device to fast device. | 34 | Promotion |
30 | Demotion - Migration from fast device to slow device. | 35 | Migration from slow device to fast device. |
36 | Demotion | ||
37 | Migration from fast device to slow device. | ||
31 | 38 | ||
32 | The origin device always contains a copy of the logical block, which | 39 | The origin device always contains a copy of the logical block, which |
33 | may be out of date or kept in sync with the copy on the cache device | 40 | may be out of date or kept in sync with the copy on the cache device |
@@ -169,45 +176,53 @@ Target interface | |||
169 | Constructor | 176 | Constructor |
170 | ----------- | 177 | ----------- |
171 | 178 | ||
172 | cache <metadata dev> <cache dev> <origin dev> <block size> | 179 | :: |
173 | <#feature args> [<feature arg>]* | 180 | |
174 | <policy> <#policy args> [policy args]* | 181 | cache <metadata dev> <cache dev> <origin dev> <block size> |
182 | <#feature args> [<feature arg>]* | ||
183 | <policy> <#policy args> [policy args]* | ||
175 | 184 | ||
176 | metadata dev : fast device holding the persistent metadata | 185 | ================ ======================================================= |
177 | cache dev : fast device holding cached data blocks | 186 | metadata dev fast device holding the persistent metadata |
178 | origin dev : slow device holding original data blocks | 187 | cache dev fast device holding cached data blocks |
179 | block size : cache unit size in sectors | 188 | origin dev slow device holding original data blocks |
189 | block size cache unit size in sectors | ||
180 | 190 | ||
181 | #feature args : number of feature arguments passed | 191 | #feature args number of feature arguments passed |
182 | feature args : writethrough or passthrough (The default is writeback.) | 192 | feature args writethrough or passthrough (The default is writeback.) |
183 | 193 | ||
184 | policy : the replacement policy to use | 194 | policy the replacement policy to use |
185 | #policy args : an even number of arguments corresponding to | 195 | #policy args an even number of arguments corresponding to |
186 | key/value pairs passed to the policy | 196 | key/value pairs passed to the policy |
187 | policy args : key/value pairs passed to the policy | 197 | policy args key/value pairs passed to the policy |
188 | E.g. 'sequential_threshold 1024' | 198 | E.g. 'sequential_threshold 1024' |
189 | See cache-policies.txt for details. | 199 | See cache-policies.txt for details. |
200 | ================ ======================================================= | ||
190 | 201 | ||
191 | Optional feature arguments are: | 202 | Optional feature arguments are: |
192 | writethrough : write through caching that prohibits cache block | 203 | |
193 | content from being different from origin block content. | 204 | |
194 | Without this argument, the default behaviour is to write | 205 | ==================== ======================================================== |
195 | back cache block contents later for performance reasons, | 206 | writethrough write through caching that prohibits cache block |
196 | so they may differ from the corresponding origin blocks. | 207 | content from being different from origin block content. |
197 | 208 | Without this argument, the default behaviour is to write | |
198 | passthrough : a degraded mode useful for various cache coherency | 209 | back cache block contents later for performance reasons, |
199 | situations (e.g., rolling back snapshots of | 210 | so they may differ from the corresponding origin blocks. |
200 | underlying storage). Reads and writes always go to | 211 | |
201 | the origin. If a write goes to a cached origin | 212 | passthrough a degraded mode useful for various cache coherency |
202 | block, then the cache block is invalidated. | 213 | situations (e.g., rolling back snapshots of |
203 | To enable passthrough mode the cache must be clean. | 214 | underlying storage). Reads and writes always go to |
204 | 215 | the origin. If a write goes to a cached origin | |
205 | metadata2 : use version 2 of the metadata. This stores the dirty bits | 216 | block, then the cache block is invalidated. |
206 | in a separate btree, which improves speed of shutting | 217 | To enable passthrough mode the cache must be clean. |
207 | down the cache. | 218 | |
208 | 219 | metadata2 use version 2 of the metadata. This stores the dirty | |
209 | no_discard_passdown : disable passing down discards from the cache | 220 | bits in a separate btree, which improves speed of |
210 | to the origin's data device. | 221 | shutting down the cache. |
222 | |||
223 | no_discard_passdown disable passing down discards from the cache | ||
224 | to the origin's data device. | ||
225 | ==================== ======================================================== | ||
211 | 226 | ||
212 | A policy called 'default' is always registered. This is an alias for | 227 | A policy called 'default' is always registered. This is an alias for |
213 | the policy we currently think is giving best all round performance. | 228 | the policy we currently think is giving best all round performance. |
@@ -218,54 +233,61 @@ the characteristics of a specific policy, always request it by name. | |||
218 | Status | 233 | Status |
219 | ------ | 234 | ------ |
220 | 235 | ||
221 | <metadata block size> <#used metadata blocks>/<#total metadata blocks> | 236 | :: |
222 | <cache block size> <#used cache blocks>/<#total cache blocks> | 237 | |
223 | <#read hits> <#read misses> <#write hits> <#write misses> | 238 | <metadata block size> <#used metadata blocks>/<#total metadata blocks> |
224 | <#demotions> <#promotions> <#dirty> <#features> <features>* | 239 | <cache block size> <#used cache blocks>/<#total cache blocks> |
225 | <#core args> <core args>* <policy name> <#policy args> <policy args>* | 240 | <#read hits> <#read misses> <#write hits> <#write misses> |
226 | <cache metadata mode> | 241 | <#demotions> <#promotions> <#dirty> <#features> <features>* |
227 | 242 | <#core args> <core args>* <policy name> <#policy args> <policy args>* | |
228 | metadata block size : Fixed block size for each metadata block in | 243 | <cache metadata mode> |
229 | sectors | 244 | |
230 | #used metadata blocks : Number of metadata blocks used | 245 | |
231 | #total metadata blocks : Total number of metadata blocks | 246 | ========================= ===================================================== |
232 | cache block size : Configurable block size for the cache device | 247 | metadata block size Fixed block size for each metadata block in |
233 | in sectors | 248 | sectors |
234 | #used cache blocks : Number of blocks resident in the cache | 249 | #used metadata blocks Number of metadata blocks used |
235 | #total cache blocks : Total number of cache blocks | 250 | #total metadata blocks Total number of metadata blocks |
236 | #read hits : Number of times a READ bio has been mapped | 251 | cache block size Configurable block size for the cache device |
237 | to the cache | 252 | in sectors |
238 | #read misses : Number of times a READ bio has been mapped | 253 | #used cache blocks Number of blocks resident in the cache |
239 | to the origin | 254 | #total cache blocks Total number of cache blocks |
240 | #write hits : Number of times a WRITE bio has been mapped | 255 | #read hits Number of times a READ bio has been mapped |
241 | to the cache | 256 | to the cache |
242 | #write misses : Number of times a WRITE bio has been | 257 | #read misses Number of times a READ bio has been mapped |
243 | mapped to the origin | 258 | to the origin |
244 | #demotions : Number of times a block has been removed | 259 | #write hits Number of times a WRITE bio has been mapped |
245 | from the cache | 260 | to the cache |
246 | #promotions : Number of times a block has been moved to | 261 | #write misses Number of times a WRITE bio has been |
247 | the cache | 262 | mapped to the origin |
248 | #dirty : Number of blocks in the cache that differ | 263 | #demotions Number of times a block has been removed |
249 | from the origin | 264 | from the cache |
250 | #feature args : Number of feature args to follow | 265 | #promotions Number of times a block has been moved to |
251 | feature args : 'writethrough' (optional) | 266 | the cache |
252 | #core args : Number of core arguments (must be even) | 267 | #dirty Number of blocks in the cache that differ |
253 | core args : Key/value pairs for tuning the core | 268 | from the origin |
254 | e.g. migration_threshold | 269 | #feature args Number of feature args to follow |
255 | policy name : Name of the policy | 270 | feature args 'writethrough' (optional) |
256 | #policy args : Number of policy arguments to follow (must be even) | 271 | #core args Number of core arguments (must be even) |
257 | policy args : Key/value pairs e.g. sequential_threshold | 272 | core args Key/value pairs for tuning the core |
258 | cache metadata mode : ro if read-only, rw if read-write | 273 | e.g. migration_threshold |
259 | In serious cases where even a read-only mode is deemed unsafe | 274 | policy name Name of the policy |
260 | no further I/O will be permitted and the status will just | 275 | #policy args Number of policy arguments to follow (must be even) |
261 | contain the string 'Fail'. The userspace recovery tools | 276 | policy args Key/value pairs e.g. sequential_threshold |
262 | should then be used. | 277 | cache metadata mode ro if read-only, rw if read-write |
263 | needs_check : 'needs_check' if set, '-' if not set | 278 | |
264 | A metadata operation has failed, resulting in the needs_check | 279 | In serious cases where even a read-only mode is |
265 | flag being set in the metadata's superblock. The metadata | 280 | deemed unsafe no further I/O will be permitted and |
266 | device must be deactivated and checked/repaired before the | 281 | the status will just contain the string 'Fail'. |
267 | cache can be made fully operational again. '-' indicates | 282 | The userspace recovery tools should then be used. |
268 | needs_check is not set. | 283 | needs_check 'needs_check' if set, '-' if not set |
284 | A metadata operation has failed, resulting in the | ||
285 | needs_check flag being set in the metadata's | ||
286 | superblock. The metadata device must be | ||
287 | deactivated and checked/repaired before the | ||
288 | cache can be made fully operational again. | ||
289 | '-' indicates needs_check is not set. | ||
290 | ========================= ===================================================== | ||
269 | 291 | ||
270 | Messages | 292 | Messages |
271 | -------- | 293 | -------- |
@@ -274,11 +296,12 @@ Policies will have different tunables, specific to each one, so we | |||
274 | need a generic way of getting and setting these. Device-mapper | 296 | need a generic way of getting and setting these. Device-mapper |
275 | messages are used. (A sysfs interface would also be possible.) | 297 | messages are used. (A sysfs interface would also be possible.) |
276 | 298 | ||
277 | The message format is: | 299 | The message format is:: |
278 | 300 | ||
279 | <key> <value> | 301 | <key> <value> |
280 | 302 | ||
281 | E.g. | 303 | E.g.:: |
304 | |||
282 | dmsetup message my_cache 0 sequential_threshold 1024 | 305 | dmsetup message my_cache 0 sequential_threshold 1024 |
283 | 306 | ||
284 | 307 | ||
@@ -290,11 +313,12 @@ of values from 5 to 9. Each cblock must be expressed as a decimal | |||
290 | value, in the future a variant message that takes cblock ranges | 313 | value, in the future a variant message that takes cblock ranges |
291 | expressed in hexadecimal may be needed to better support efficient | 314 | expressed in hexadecimal may be needed to better support efficient |
292 | invalidation of larger caches. The cache must be in passthrough mode | 315 | invalidation of larger caches. The cache must be in passthrough mode |
293 | when invalidate_cblocks is used. | 316 | when invalidate_cblocks is used:: |
294 | 317 | ||
295 | invalidate_cblocks [<cblock>|<cblock begin>-<cblock end>]* | 318 | invalidate_cblocks [<cblock>|<cblock begin>-<cblock end>]* |
296 | 319 | ||
297 | E.g. | 320 | E.g.:: |
321 | |||
298 | dmsetup message my_cache 0 invalidate_cblocks 2345 3456-4567 5678-6789 | 322 | dmsetup message my_cache 0 invalidate_cblocks 2345 3456-4567 5678-6789 |
299 | 323 | ||
300 | Examples | 324 | Examples |
@@ -304,8 +328,10 @@ The test suite can be found here: | |||
304 | 328 | ||
305 | https://github.com/jthornber/device-mapper-test-suite | 329 | https://github.com/jthornber/device-mapper-test-suite |
306 | 330 | ||
307 | dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ | 331 | :: |
308 | /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0' | 332 | |
309 | dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ | 333 | dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ |
310 | /dev/mapper/ssd /dev/mapper/origin 1024 1 writeback \ | 334 | /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0' |
311 | mq 4 sequential_threshold 1024 random_threshold 8' | 335 | dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ |
336 | /dev/mapper/ssd /dev/mapper/origin 1024 1 writeback \ | ||
337 | mq 4 sequential_threshold 1024 random_threshold 8' | ||
diff --git a/Documentation/device-mapper/delay.txt b/Documentation/device-mapper/delay.rst index 6426c45273cb..917ba8c33359 100644 --- a/Documentation/device-mapper/delay.txt +++ b/Documentation/device-mapper/delay.rst | |||
@@ -1,10 +1,12 @@ | |||
1 | ======== | ||
1 | dm-delay | 2 | dm-delay |
2 | ======== | 3 | ======== |
3 | 4 | ||
4 | Device-Mapper's "delay" target delays reads and/or writes | 5 | Device-Mapper's "delay" target delays reads and/or writes |
5 | and maps them to different devices. | 6 | and maps them to different devices. |
6 | 7 | ||
7 | Parameters: | 8 | Parameters:: |
9 | |||
8 | <device> <offset> <delay> [<write_device> <write_offset> <write_delay> | 10 | <device> <offset> <delay> [<write_device> <write_offset> <write_delay> |
9 | [<flush_device> <flush_offset> <flush_delay>]] | 11 | [<flush_device> <flush_offset> <flush_delay>]] |
10 | 12 | ||
@@ -14,15 +16,16 @@ Delays are specified in milliseconds. | |||
14 | 16 | ||
15 | Example scripts | 17 | Example scripts |
16 | =============== | 18 | =============== |
17 | [[ | 19 | |
18 | #!/bin/sh | 20 | :: |
19 | # Create device delaying rw operation for 500ms | 21 | |
20 | echo "0 `blockdev --getsz $1` delay $1 0 500" | dmsetup create delayed | 22 | #!/bin/sh |
21 | ]] | 23 | # Create device delaying rw operation for 500ms |
22 | 24 | echo "0 `blockdev --getsz $1` delay $1 0 500" | dmsetup create delayed | |
23 | [[ | 25 | |
24 | #!/bin/sh | 26 | :: |
25 | # Create device delaying only write operation for 500ms and | 27 | |
26 | # splitting reads and writes to different devices $1 $2 | 28 | #!/bin/sh |
27 | echo "0 `blockdev --getsz $1` delay $1 0 0 $2 0 500" | dmsetup create delayed | 29 | # Create device delaying only write operation for 500ms and |
28 | ]] | 30 | # splitting reads and writes to different devices $1 $2 |
31 | echo "0 `blockdev --getsz $1` delay $1 0 0 $2 0 500" | dmsetup create delayed | ||
diff --git a/Documentation/device-mapper/dm-crypt.txt b/Documentation/device-mapper/dm-crypt.rst index 3b3e1de21c9c..8f4a3f889d43 100644 --- a/Documentation/device-mapper/dm-crypt.txt +++ b/Documentation/device-mapper/dm-crypt.rst | |||
@@ -1,5 +1,6 @@ | |||
1 | ======== | ||
1 | dm-crypt | 2 | dm-crypt |
2 | ========= | 3 | ======== |
3 | 4 | ||
4 | Device-Mapper's "crypt" target provides transparent encryption of block devices | 5 | Device-Mapper's "crypt" target provides transparent encryption of block devices |
5 | using the kernel crypto API. | 6 | using the kernel crypto API. |
@@ -7,15 +8,20 @@ using the kernel crypto API. | |||
7 | For a more detailed description of supported parameters see: | 8 | For a more detailed description of supported parameters see: |
8 | https://gitlab.com/cryptsetup/cryptsetup/wikis/DMCrypt | 9 | https://gitlab.com/cryptsetup/cryptsetup/wikis/DMCrypt |
9 | 10 | ||
10 | Parameters: <cipher> <key> <iv_offset> <device path> \ | 11 | Parameters:: |
12 | |||
13 | <cipher> <key> <iv_offset> <device path> \ | ||
11 | <offset> [<#opt_params> <opt_params>] | 14 | <offset> [<#opt_params> <opt_params>] |
12 | 15 | ||
13 | <cipher> | 16 | <cipher> |
14 | Encryption cipher, encryption mode and Initial Vector (IV) generator. | 17 | Encryption cipher, encryption mode and Initial Vector (IV) generator. |
15 | 18 | ||
16 | The cipher specifications format is: | 19 | The cipher specifications format is:: |
20 | |||
17 | cipher[:keycount]-chainmode-ivmode[:ivopts] | 21 | cipher[:keycount]-chainmode-ivmode[:ivopts] |
18 | Examples: | 22 | |
23 | Examples:: | ||
24 | |||
19 | aes-cbc-essiv:sha256 | 25 | aes-cbc-essiv:sha256 |
20 | aes-xts-plain64 | 26 | aes-xts-plain64 |
21 | serpent-xts-plain64 | 27 | serpent-xts-plain64 |
@@ -25,12 +31,17 @@ Parameters: <cipher> <key> <iv_offset> <device path> \ | |||
25 | as for the first format type. | 31 | as for the first format type. |
26 | This format is mainly used for specification of authenticated modes. | 32 | This format is mainly used for specification of authenticated modes. |
27 | 33 | ||
28 | The crypto API cipher specifications format is: | 34 | The crypto API cipher specifications format is:: |
35 | |||
29 | capi:cipher_api_spec-ivmode[:ivopts] | 36 | capi:cipher_api_spec-ivmode[:ivopts] |
30 | Examples: | 37 | |
38 | Examples:: | ||
39 | |||
31 | capi:cbc(aes)-essiv:sha256 | 40 | capi:cbc(aes)-essiv:sha256 |
32 | capi:xts(aes)-plain64 | 41 | capi:xts(aes)-plain64 |
33 | Examples of authenticated modes: | 42 | |
43 | Examples of authenticated modes:: | ||
44 | |||
34 | capi:gcm(aes)-random | 45 | capi:gcm(aes)-random |
35 | capi:authenc(hmac(sha256),xts(aes))-random | 46 | capi:authenc(hmac(sha256),xts(aes))-random |
36 | capi:rfc7539(chacha20,poly1305)-random | 47 | capi:rfc7539(chacha20,poly1305)-random |
@@ -142,21 +153,21 @@ LUKS (Linux Unified Key Setup) is now the preferred way to set up disk | |||
142 | encryption with dm-crypt using the 'cryptsetup' utility, see | 153 | encryption with dm-crypt using the 'cryptsetup' utility, see |
143 | https://gitlab.com/cryptsetup/cryptsetup | 154 | https://gitlab.com/cryptsetup/cryptsetup |
144 | 155 | ||
145 | [[ | 156 | :: |
146 | #!/bin/sh | 157 | |
147 | # Create a crypt device using dmsetup | 158 | #!/bin/sh |
148 | dmsetup create crypt1 --table "0 `blockdev --getsz $1` crypt aes-cbc-essiv:sha256 babebabebabebabebabebabebabebabe 0 $1 0" | 159 | # Create a crypt device using dmsetup |
149 | ]] | 160 | dmsetup create crypt1 --table "0 `blockdev --getsz $1` crypt aes-cbc-essiv:sha256 babebabebabebabebabebabebabebabe 0 $1 0" |
150 | 161 | ||
151 | [[ | 162 | :: |
152 | #!/bin/sh | 163 | |
153 | # Create a crypt device using dmsetup when encryption key is stored in keyring service | 164 | #!/bin/sh |
154 | dmsetup create crypt2 --table "0 `blockdev --getsize $1` crypt aes-cbc-essiv:sha256 :32:logon:my_prefix:my_key 0 $1 0" | 165 | # Create a crypt device using dmsetup when encryption key is stored in keyring service |
155 | ]] | 166 | dmsetup create crypt2 --table "0 `blockdev --getsize $1` crypt aes-cbc-essiv:sha256 :32:logon:my_prefix:my_key 0 $1 0" |
156 | 167 | ||
157 | [[ | 168 | :: |
158 | #!/bin/sh | 169 | |
159 | # Create a crypt device using cryptsetup and LUKS header with default cipher | 170 | #!/bin/sh |
160 | cryptsetup luksFormat $1 | 171 | # Create a crypt device using cryptsetup and LUKS header with default cipher |
161 | cryptsetup luksOpen $1 crypt1 | 172 | cryptsetup luksFormat $1 |
162 | ]] | 173 | cryptsetup luksOpen $1 crypt1 |
diff --git a/Documentation/device-mapper/dm-flakey.txt b/Documentation/device-mapper/dm-flakey.rst index 9f0e247d0877..86138735879d 100644 --- a/Documentation/device-mapper/dm-flakey.txt +++ b/Documentation/device-mapper/dm-flakey.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ========= | ||
1 | dm-flakey | 2 | dm-flakey |
2 | ========= | 3 | ========= |
3 | 4 | ||
@@ -15,17 +16,26 @@ underlying devices. | |||
15 | 16 | ||
16 | Table parameters | 17 | Table parameters |
17 | ---------------- | 18 | ---------------- |
19 | |||
20 | :: | ||
21 | |||
18 | <dev path> <offset> <up interval> <down interval> \ | 22 | <dev path> <offset> <up interval> <down interval> \ |
19 | [<num_features> [<feature arguments>]] | 23 | [<num_features> [<feature arguments>]] |
20 | 24 | ||
21 | Mandatory parameters: | 25 | Mandatory parameters: |
22 | <dev path>: Full pathname to the underlying block-device, or a | 26 | |
23 | "major:minor" device-number. | 27 | <dev path>: |
24 | <offset>: Starting sector within the device. | 28 | Full pathname to the underlying block-device, or a |
25 | <up interval>: Number of seconds device is available. | 29 | "major:minor" device-number. |
26 | <down interval>: Number of seconds device returns errors. | 30 | <offset>: |
31 | Starting sector within the device. | ||
32 | <up interval>: | ||
33 | Number of seconds device is available. | ||
34 | <down interval>: | ||
35 | Number of seconds device returns errors. | ||
27 | 36 | ||
28 | Optional feature parameters: | 37 | Optional feature parameters: |
38 | |||
29 | If no feature parameters are present, during the periods of | 39 | If no feature parameters are present, during the periods of |
30 | unreliability, all I/O returns errors. | 40 | unreliability, all I/O returns errors. |
31 | 41 | ||
@@ -41,17 +51,24 @@ Optional feature parameters: | |||
41 | During <down interval>, replace <Nth_byte> of the data of | 51 | During <down interval>, replace <Nth_byte> of the data of |
42 | each matching bio with <value>. | 52 | each matching bio with <value>. |
43 | 53 | ||
44 | <Nth_byte>: The offset of the byte to replace. | 54 | <Nth_byte>: |
45 | Counting starts at 1, to replace the first byte. | 55 | The offset of the byte to replace. |
46 | <direction>: Either 'r' to corrupt reads or 'w' to corrupt writes. | 56 | Counting starts at 1, to replace the first byte. |
47 | 'w' is incompatible with drop_writes. | 57 | <direction>: |
48 | <value>: The value (from 0-255) to write. | 58 | Either 'r' to corrupt reads or 'w' to corrupt writes. |
49 | <flags>: Perform the replacement only if bio->bi_opf has all the | 59 | 'w' is incompatible with drop_writes. |
50 | selected flags set. | 60 | <value>: |
61 | The value (from 0-255) to write. | ||
62 | <flags>: | ||
63 | Perform the replacement only if bio->bi_opf has all the | ||
64 | selected flags set. | ||
51 | 65 | ||
52 | Examples: | 66 | Examples: |
67 | |||
68 | Replaces the 32nd byte of READ bios with the value 1:: | ||
69 | |||
53 | corrupt_bio_byte 32 r 1 0 | 70 | corrupt_bio_byte 32 r 1 0 |
54 | - replaces the 32nd byte of READ bios with the value 1 | 71 | |
72 | Replaces the 224th byte of REQ_META (=32) bios with the value 0:: | ||
55 | 73 | ||
56 | corrupt_bio_byte 224 w 0 32 | 74 | corrupt_bio_byte 224 w 0 32 |
57 | - replaces the 224th byte of REQ_META (=32) bios with the value 0 | ||
diff --git a/Documentation/device-mapper/dm-init.txt b/Documentation/device-mapper/dm-init.rst index 130b3c3679c5..e5242ff17e9b 100644 --- a/Documentation/device-mapper/dm-init.txt +++ b/Documentation/device-mapper/dm-init.rst | |||
@@ -1,5 +1,6 @@ | |||
1 | ================================ | ||
1 | Early creation of mapped devices | 2 | Early creation of mapped devices |
2 | ==================================== | 3 | ================================ |
3 | 4 | ||
4 | It is possible to configure a device-mapper device to act as the root device for | 5 | It is possible to configure a device-mapper device to act as the root device for |
5 | your system in two ways. | 6 | your system in two ways. |
@@ -12,15 +13,17 @@ The second is to create one or more device-mappers using the module parameter | |||
12 | 13 | ||
13 | The format is specified as a string of data separated by commas and optionally | 14 | The format is specified as a string of data separated by commas and optionally |
14 | semi-colons, where: | 15 | semi-colons, where: |
16 | |||
15 | - a comma is used to separate fields like name, uuid, flags and table | 17 | - a comma is used to separate fields like name, uuid, flags and table |
16 | (specifies one device) | 18 | (specifies one device) |
17 | - a semi-colon is used to separate devices. | 19 | - a semi-colon is used to separate devices. |
18 | 20 | ||
19 | So the format will look like this: | 21 | So the format will look like this:: |
20 | 22 | ||
21 | dm-mod.create=<name>,<uuid>,<minor>,<flags>,<table>[,<table>+][;<name>,<uuid>,<minor>,<flags>,<table>[,<table>+]+] | 23 | dm-mod.create=<name>,<uuid>,<minor>,<flags>,<table>[,<table>+][;<name>,<uuid>,<minor>,<flags>,<table>[,<table>+]+] |
22 | 24 | ||
23 | Where, | 25 | Where:: |
26 | |||
24 | <name> ::= The device name. | 27 | <name> ::= The device name. |
25 | <uuid> ::= xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | "" | 28 | <uuid> ::= xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | "" |
26 | <minor> ::= The device minor number | "" | 29 | <minor> ::= The device minor number | "" |
@@ -29,7 +32,7 @@ Where, | |||
29 | <target_type> ::= "verity" | "linear" | ... (see list below) | 32 | <target_type> ::= "verity" | "linear" | ... (see list below) |
30 | 33 | ||
31 | The dm line should be equivalent to the one used by the dmsetup tool with the | 34 | The dm line should be equivalent to the one used by the dmsetup tool with the |
32 | --concise argument. | 35 | `--concise` argument. |
33 | 36 | ||
34 | Target types | 37 | Target types |
35 | ============ | 38 | ============ |
@@ -38,32 +41,34 @@ Not all target types are available as there are serious risks in allowing | |||
38 | activation of certain DM targets without first using userspace tools to check | 41 | activation of certain DM targets without first using userspace tools to check |
39 | the validity of associated metadata. | 42 | the validity of associated metadata. |
40 | 43 | ||
41 | "cache": constrained, userspace should verify cache device | 44 | ======================= ======================================================= |
42 | "crypt": allowed | 45 | `cache` constrained, userspace should verify cache device |
43 | "delay": allowed | 46 | `crypt` allowed |
44 | "era": constrained, userspace should verify metadata device | 47 | `delay` allowed |
45 | "flakey": constrained, meant for test | 48 | `era` constrained, userspace should verify metadata device |
46 | "linear": allowed | 49 | `flakey` constrained, meant for test |
47 | "log-writes": constrained, userspace should verify metadata device | 50 | `linear` allowed |
48 | "mirror": constrained, userspace should verify main/mirror device | 51 | `log-writes` constrained, userspace should verify metadata device |
49 | "raid": constrained, userspace should verify metadata device | 52 | `mirror` constrained, userspace should verify main/mirror device |
50 | "snapshot": constrained, userspace should verify src/dst device | 53 | `raid` constrained, userspace should verify metadata device |
51 | "snapshot-origin": allowed | 54 | `snapshot` constrained, userspace should verify src/dst device |
52 | "snapshot-merge": constrained, userspace should verify src/dst device | 55 | `snapshot-origin` allowed |
53 | "striped": allowed | 56 | `snapshot-merge` constrained, userspace should verify src/dst device |
54 | "switch": constrained, userspace should verify dev path | 57 | `striped` allowed |
55 | "thin": constrained, requires dm target message from userspace | 58 | `switch` constrained, userspace should verify dev path |
56 | "thin-pool": constrained, requires dm target message from userspace | 59 | `thin` constrained, requires dm target message from userspace |
57 | "verity": allowed | 60 | `thin-pool` constrained, requires dm target message from userspace |
58 | "writecache": constrained, userspace should verify cache device | 61 | `verity` allowed |
59 | "zero": constrained, not meant for rootfs | 62 | `writecache` constrained, userspace should verify cache device |
63 | `zero` constrained, not meant for rootfs | ||
64 | ======================= ======================================================= | ||
60 | 65 | ||
61 | If the target is not listed above, it is constrained by default (not tested). | 66 | If the target is not listed above, it is constrained by default (not tested). |
62 | 67 | ||
63 | Examples | 68 | Examples |
64 | ======== | 69 | ======== |
65 | An example of booting to a linear array made up of user-mode linux block | 70 | An example of booting to a linear array made up of user-mode linux block |
66 | devices: | 71 | devices:: |
67 | 72 | ||
68 | dm-mod.create="lroot,,,rw, 0 4096 linear 98:16 0, 4096 4096 linear 98:32 0" root=/dev/dm-0 | 73 | dm-mod.create="lroot,,,rw, 0 4096 linear 98:16 0, 4096 4096 linear 98:32 0" root=/dev/dm-0 |
69 | 74 | ||
@@ -71,8 +76,8 @@ This will boot to a rw dm-linear target of 8192 sectors split across two block | |||
71 | devices identified by their major:minor numbers. After boot, udev will rename | 76 | devices identified by their major:minor numbers. After boot, udev will rename |
72 | this target to /dev/mapper/lroot (depending on the rules). No uuid was assigned. | 77 | this target to /dev/mapper/lroot (depending on the rules). No uuid was assigned. |
73 | 78 | ||
74 | An example of multiple device-mappers, with the dm-mod.create="..." contents is shown here | 79 | An example of multiple device-mappers, with the dm-mod.create="..." contents |
75 | split on multiple lines for readability: | 80 | is shown here split on multiple lines for readability:: |
76 | 81 | ||
77 | dm-linear,,1,rw, | 82 | dm-linear,,1,rw, |
78 | 0 32768 linear 8:1 0, | 83 | 0 32768 linear 8:1 0, |
@@ -84,30 +89,36 @@ split on multiple lines for readability: | |||
84 | 89 | ||
85 | Other examples (per target): | 90 | Other examples (per target): |
86 | 91 | ||
87 | "crypt": | 92 | "crypt":: |
93 | |||
88 | dm-crypt,,8,ro, | 94 | dm-crypt,,8,ro, |
89 | 0 1048576 crypt aes-xts-plain64 | 95 | 0 1048576 crypt aes-xts-plain64 |
90 | babebabebabebabebabebabebabebabebabebabebabebabebabebabebabebabe 0 | 96 | babebabebabebabebabebabebabebabebabebabebabebabebabebabebabebabe 0 |
91 | /dev/sda 0 1 allow_discards | 97 | /dev/sda 0 1 allow_discards |
92 | 98 | ||
93 | "delay": | 99 | "delay":: |
100 | |||
94 | dm-delay,,4,ro,0 409600 delay /dev/sda1 0 500 | 101 | dm-delay,,4,ro,0 409600 delay /dev/sda1 0 500 |
95 | 102 | ||
96 | "linear": | 103 | "linear":: |
104 | |||
97 | dm-linear,,,rw, | 105 | dm-linear,,,rw, |
98 | 0 32768 linear /dev/sda1 0, | 106 | 0 32768 linear /dev/sda1 0, |
99 | 32768 1024000 linear /dev/sda2 0, | 107 | 32768 1024000 linear /dev/sda2 0, |
100 | 1056768 204800 linear /dev/sda3 0, | 108 | 1056768 204800 linear /dev/sda3 0, |
101 | 1261568 512000 linear /dev/sda4 0 | 109 | 1261568 512000 linear /dev/sda4 0 |
102 | 110 | ||
103 | "snapshot-origin": | 111 | "snapshot-origin":: |
112 | |||
104 | dm-snap-orig,,4,ro,0 409600 snapshot-origin 8:2 | 113 | dm-snap-orig,,4,ro,0 409600 snapshot-origin 8:2 |
105 | 114 | ||
106 | "striped": | 115 | "striped":: |
116 | |||
107 | dm-striped,,4,ro,0 1638400 striped 4 4096 | 117 | dm-striped,,4,ro,0 1638400 striped 4 4096 |
108 | /dev/sda1 0 /dev/sda2 0 /dev/sda3 0 /dev/sda4 0 | 118 | /dev/sda1 0 /dev/sda2 0 /dev/sda3 0 /dev/sda4 0 |
109 | 119 | ||
110 | "verity": | 120 | "verity":: |
121 | |||
111 | dm-verity,,4,ro, | 122 | dm-verity,,4,ro, |
112 | 0 1638400 verity 1 8:1 8:2 4096 4096 204800 1 sha256 | 123 | 0 1638400 verity 1 8:1 8:2 4096 4096 204800 1 sha256 |
113 | fb1a5a0f00deb908d8b53cb270858975e76cf64105d412ce764225d53b8f3cfd | 124 | fb1a5a0f00deb908d8b53cb270858975e76cf64105d412ce764225d53b8f3cfd |
diff --git a/Documentation/device-mapper/dm-integrity.txt b/Documentation/device-mapper/dm-integrity.rst index d63d78ffeb73..a30aa91b5fbe 100644 --- a/Documentation/device-mapper/dm-integrity.txt +++ b/Documentation/device-mapper/dm-integrity.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ============ | ||
2 | dm-integrity | ||
3 | ============ | ||
4 | |||
1 | The dm-integrity target emulates a block device that has additional | 5 | The dm-integrity target emulates a block device that has additional |
2 | per-sector tags that can be used for storing integrity information. | 6 | per-sector tags that can be used for storing integrity information. |
3 | 7 | ||
@@ -35,15 +39,16 @@ zeroes. If the superblock is neither valid nor zeroed, the dm-integrity | |||
35 | target can't be loaded. | 39 | target can't be loaded. |
36 | 40 | ||
37 | To use the target for the first time: | 41 | To use the target for the first time: |
42 | |||
38 | 1. overwrite the superblock with zeroes | 43 | 1. overwrite the superblock with zeroes |
39 | 2. load the dm-integrity target with one-sector size, the kernel driver | 44 | 2. load the dm-integrity target with one-sector size, the kernel driver |
40 | will format the device | 45 | will format the device |
41 | 3. unload the dm-integrity target | 46 | 3. unload the dm-integrity target |
42 | 4. read the "provided_data_sectors" value from the superblock | 47 | 4. read the "provided_data_sectors" value from the superblock |
43 | 5. load the dm-integrity target with the the target size | 48 | 5. load the dm-integrity target with the the target size |
44 | "provided_data_sectors" | 49 | "provided_data_sectors" |
45 | 6. if you want to use dm-integrity with dm-crypt, load the dm-crypt target | 50 | 6. if you want to use dm-integrity with dm-crypt, load the dm-crypt target |
46 | with the size "provided_data_sectors" | 51 | with the size "provided_data_sectors" |
47 | 52 | ||
48 | 53 | ||
49 | Target arguments: | 54 | Target arguments: |
@@ -51,17 +56,20 @@ Target arguments: | |||
51 | 1. the underlying block device | 56 | 1. the underlying block device |
52 | 57 | ||
53 | 2. the number of reserved sector at the beginning of the device - the | 58 | 2. the number of reserved sector at the beginning of the device - the |
54 | dm-integrity won't read of write these sectors | 59 | dm-integrity won't read of write these sectors |
55 | 60 | ||
56 | 3. the size of the integrity tag (if "-" is used, the size is taken from | 61 | 3. the size of the integrity tag (if "-" is used, the size is taken from |
57 | the internal-hash algorithm) | 62 | the internal-hash algorithm) |
58 | 63 | ||
59 | 4. mode: | 64 | 4. mode: |
60 | D - direct writes (without journal) - in this mode, journaling is | 65 | |
66 | D - direct writes (without journal) | ||
67 | in this mode, journaling is | ||
61 | not used and data sectors and integrity tags are written | 68 | not used and data sectors and integrity tags are written |
62 | separately. In case of crash, it is possible that the data | 69 | separately. In case of crash, it is possible that the data |
63 | and integrity tag doesn't match. | 70 | and integrity tag doesn't match. |
64 | J - journaled writes - data and integrity tags are written to the | 71 | J - journaled writes |
72 | data and integrity tags are written to the | ||
65 | journal and atomicity is guaranteed. In case of crash, | 73 | journal and atomicity is guaranteed. In case of crash, |
66 | either both data and tag or none of them are written. The | 74 | either both data and tag or none of them are written. The |
67 | journaled mode degrades write throughput twice because the | 75 | journaled mode degrades write throughput twice because the |
@@ -178,9 +186,12 @@ and the reloaded target would be non-functional. | |||
178 | 186 | ||
179 | 187 | ||
180 | The layout of the formatted block device: | 188 | The layout of the formatted block device: |
181 | * reserved sectors (they are not used by this target, they can be used for | 189 | |
182 | storing LUKS metadata or for other purpose), the size of the reserved | 190 | * reserved sectors |
183 | area is specified in the target arguments | 191 | (they are not used by this target, they can be used for |
192 | storing LUKS metadata or for other purpose), the size of the reserved | ||
193 | area is specified in the target arguments | ||
194 | |||
184 | * superblock (4kiB) | 195 | * superblock (4kiB) |
185 | * magic string - identifies that the device was formatted | 196 | * magic string - identifies that the device was formatted |
186 | * version | 197 | * version |
@@ -192,40 +203,55 @@ The layout of the formatted block device: | |||
192 | metadata and padding). The user of this target should not send | 203 | metadata and padding). The user of this target should not send |
193 | bios that access data beyond the "provided data sectors" limit. | 204 | bios that access data beyond the "provided data sectors" limit. |
194 | * flags | 205 | * flags |
195 | SB_FLAG_HAVE_JOURNAL_MAC - a flag is set if journal_mac is used | 206 | SB_FLAG_HAVE_JOURNAL_MAC |
196 | SB_FLAG_RECALCULATING - recalculating is in progress | 207 | - a flag is set if journal_mac is used |
197 | SB_FLAG_DIRTY_BITMAP - journal area contains the bitmap of dirty | 208 | SB_FLAG_RECALCULATING |
198 | blocks | 209 | - recalculating is in progress |
210 | SB_FLAG_DIRTY_BITMAP | ||
211 | - journal area contains the bitmap of dirty | ||
212 | blocks | ||
199 | * log2(sectors per block) | 213 | * log2(sectors per block) |
200 | * a position where recalculating finished | 214 | * a position where recalculating finished |
201 | * journal | 215 | * journal |
202 | The journal is divided into sections, each section contains: | 216 | The journal is divided into sections, each section contains: |
217 | |||
203 | * metadata area (4kiB), it contains journal entries | 218 | * metadata area (4kiB), it contains journal entries |
204 | every journal entry contains: | 219 | |
220 | - every journal entry contains: | ||
221 | |||
205 | * logical sector (specifies where the data and tag should | 222 | * logical sector (specifies where the data and tag should |
206 | be written) | 223 | be written) |
207 | * last 8 bytes of data | 224 | * last 8 bytes of data |
208 | * integrity tag (the size is specified in the superblock) | 225 | * integrity tag (the size is specified in the superblock) |
209 | every metadata sector ends with | 226 | |
227 | - every metadata sector ends with | ||
228 | |||
210 | * mac (8-bytes), all the macs in 8 metadata sectors form a | 229 | * mac (8-bytes), all the macs in 8 metadata sectors form a |
211 | 64-byte value. It is used to store hmac of sector | 230 | 64-byte value. It is used to store hmac of sector |
212 | numbers in the journal section, to protect against a | 231 | numbers in the journal section, to protect against a |
213 | possibility that the attacker tampers with sector | 232 | possibility that the attacker tampers with sector |
214 | numbers in the journal. | 233 | numbers in the journal. |
215 | * commit id | 234 | * commit id |
235 | |||
216 | * data area (the size is variable; it depends on how many journal | 236 | * data area (the size is variable; it depends on how many journal |
217 | entries fit into the metadata area) | 237 | entries fit into the metadata area) |
218 | every sector in the data area contains: | 238 | |
239 | - every sector in the data area contains: | ||
240 | |||
219 | * data (504 bytes of data, the last 8 bytes are stored in | 241 | * data (504 bytes of data, the last 8 bytes are stored in |
220 | the journal entry) | 242 | the journal entry) |
221 | * commit id | 243 | * commit id |
244 | |||
222 | To test if the whole journal section was written correctly, every | 245 | To test if the whole journal section was written correctly, every |
223 | 512-byte sector of the journal ends with 8-byte commit id. If the | 246 | 512-byte sector of the journal ends with 8-byte commit id. If the |
224 | commit id matches on all sectors in a journal section, then it is | 247 | commit id matches on all sectors in a journal section, then it is |
225 | assumed that the section was written correctly. If the commit id | 248 | assumed that the section was written correctly. If the commit id |
226 | doesn't match, the section was written partially and it should not | 249 | doesn't match, the section was written partially and it should not |
227 | be replayed. | 250 | be replayed. |
228 | * one or more runs of interleaved tags and data. Each run contains: | 251 | |
252 | * one or more runs of interleaved tags and data. | ||
253 | Each run contains: | ||
254 | |||
229 | * tag area - it contains integrity tags. There is one tag for each | 255 | * tag area - it contains integrity tags. There is one tag for each |
230 | sector in the data area | 256 | sector in the data area |
231 | * data area - it contains data sectors. The number of data sectors | 257 | * data area - it contains data sectors. The number of data sectors |
diff --git a/Documentation/device-mapper/dm-io.txt b/Documentation/device-mapper/dm-io.rst index 3b5d9a52cdcf..d2492917a1f5 100644 --- a/Documentation/device-mapper/dm-io.txt +++ b/Documentation/device-mapper/dm-io.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ===== | ||
1 | dm-io | 2 | dm-io |
2 | ===== | 3 | ===== |
3 | 4 | ||
@@ -7,7 +8,7 @@ version. | |||
7 | 8 | ||
8 | The user must set up an io_region structure to describe the desired location | 9 | The user must set up an io_region structure to describe the desired location |
9 | of the I/O. Each io_region indicates a block-device along with the starting | 10 | of the I/O. Each io_region indicates a block-device along with the starting |
10 | sector and size of the region. | 11 | sector and size of the region:: |
11 | 12 | ||
12 | struct io_region { | 13 | struct io_region { |
13 | struct block_device *bdev; | 14 | struct block_device *bdev; |
@@ -19,7 +20,7 @@ Dm-io can read from one io_region or write to one or more io_regions. Writes | |||
19 | to multiple regions are specified by an array of io_region structures. | 20 | to multiple regions are specified by an array of io_region structures. |
20 | 21 | ||
21 | The first I/O service type takes a list of memory pages as the data buffer for | 22 | The first I/O service type takes a list of memory pages as the data buffer for |
22 | the I/O, along with an offset into the first page. | 23 | the I/O, along with an offset into the first page:: |
23 | 24 | ||
24 | struct page_list { | 25 | struct page_list { |
25 | struct page_list *next; | 26 | struct page_list *next; |
@@ -35,7 +36,7 @@ the I/O, along with an offset into the first page. | |||
35 | 36 | ||
36 | The second I/O service type takes an array of bio vectors as the data buffer | 37 | The second I/O service type takes an array of bio vectors as the data buffer |
37 | for the I/O. This service can be handy if the caller has a pre-assembled bio, | 38 | for the I/O. This service can be handy if the caller has a pre-assembled bio, |
38 | but wants to direct different portions of the bio to different devices. | 39 | but wants to direct different portions of the bio to different devices:: |
39 | 40 | ||
40 | int dm_io_sync_bvec(unsigned int num_regions, struct io_region *where, | 41 | int dm_io_sync_bvec(unsigned int num_regions, struct io_region *where, |
41 | int rw, struct bio_vec *bvec, | 42 | int rw, struct bio_vec *bvec, |
@@ -47,7 +48,7 @@ but wants to direct different portions of the bio to different devices. | |||
47 | The third I/O service type takes a pointer to a vmalloc'd memory buffer as the | 48 | The third I/O service type takes a pointer to a vmalloc'd memory buffer as the |
48 | data buffer for the I/O. This service can be handy if the caller needs to do | 49 | data buffer for the I/O. This service can be handy if the caller needs to do |
49 | I/O to a large region but doesn't want to allocate a large number of individual | 50 | I/O to a large region but doesn't want to allocate a large number of individual |
50 | memory pages. | 51 | memory pages:: |
51 | 52 | ||
52 | int dm_io_sync_vm(unsigned int num_regions, struct io_region *where, int rw, | 53 | int dm_io_sync_vm(unsigned int num_regions, struct io_region *where, int rw, |
53 | void *data, unsigned long *error_bits); | 54 | void *data, unsigned long *error_bits); |
@@ -55,11 +56,11 @@ memory pages. | |||
55 | void *data, io_notify_fn fn, void *context); | 56 | void *data, io_notify_fn fn, void *context); |
56 | 57 | ||
57 | Callers of the asynchronous I/O services must include the name of a completion | 58 | Callers of the asynchronous I/O services must include the name of a completion |
58 | callback routine and a pointer to some context data for the I/O. | 59 | callback routine and a pointer to some context data for the I/O:: |
59 | 60 | ||
60 | typedef void (*io_notify_fn)(unsigned long error, void *context); | 61 | typedef void (*io_notify_fn)(unsigned long error, void *context); |
61 | 62 | ||
62 | The "error" parameter in this callback, as well as the "*error" parameter in | 63 | The "error" parameter in this callback, as well as the `*error` parameter in |
63 | all of the synchronous versions, is a bitset (instead of a simple error value). | 64 | all of the synchronous versions, is a bitset (instead of a simple error value). |
64 | In the case of an write-I/O to multiple regions, this bitset allows dm-io to | 65 | In the case of an write-I/O to multiple regions, this bitset allows dm-io to |
65 | indicate success or failure on each individual region. | 66 | indicate success or failure on each individual region. |
@@ -72,4 +73,3 @@ always available in order to avoid unnecessary waiting while performing I/O. | |||
72 | When the user is finished using the dm-io services, they should call | 73 | When the user is finished using the dm-io services, they should call |
73 | dm_io_put() and specify the same number of pages that were given on the | 74 | dm_io_put() and specify the same number of pages that were given on the |
74 | dm_io_get() call. | 75 | dm_io_get() call. |
75 | |||
diff --git a/Documentation/device-mapper/dm-log.txt b/Documentation/device-mapper/dm-log.rst index c155ac569c44..ba4fce39bc27 100644 --- a/Documentation/device-mapper/dm-log.txt +++ b/Documentation/device-mapper/dm-log.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ===================== | ||
1 | Device-Mapper Logging | 2 | Device-Mapper Logging |
2 | ===================== | 3 | ===================== |
3 | The device-mapper logging code is used by some of the device-mapper | 4 | The device-mapper logging code is used by some of the device-mapper |
@@ -16,11 +17,13 @@ dm_dirty_log_type in include/linux/dm-dirty-log.h). Various different | |||
16 | logging implementations are available and provide different | 17 | logging implementations are available and provide different |
17 | capabilities. The list includes: | 18 | capabilities. The list includes: |
18 | 19 | ||
20 | ============== ============================================================== | ||
19 | Type Files | 21 | Type Files |
20 | ==== ===== | 22 | ============== ============================================================== |
21 | disk drivers/md/dm-log.c | 23 | disk drivers/md/dm-log.c |
22 | core drivers/md/dm-log.c | 24 | core drivers/md/dm-log.c |
23 | userspace drivers/md/dm-log-userspace* include/linux/dm-log-userspace.h | 25 | userspace drivers/md/dm-log-userspace* include/linux/dm-log-userspace.h |
26 | ============== ============================================================== | ||
24 | 27 | ||
25 | The "disk" log type | 28 | The "disk" log type |
26 | ------------------- | 29 | ------------------- |
diff --git a/Documentation/device-mapper/dm-queue-length.txt b/Documentation/device-mapper/dm-queue-length.rst index f4db2562175c..d8e381c1cb02 100644 --- a/Documentation/device-mapper/dm-queue-length.txt +++ b/Documentation/device-mapper/dm-queue-length.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | =============== | ||
1 | dm-queue-length | 2 | dm-queue-length |
2 | =============== | 3 | =============== |
3 | 4 | ||
@@ -6,12 +7,18 @@ which selects a path with the least number of in-flight I/Os. | |||
6 | The path selector name is 'queue-length'. | 7 | The path selector name is 'queue-length'. |
7 | 8 | ||
8 | Table parameters for each path: [<repeat_count>] | 9 | Table parameters for each path: [<repeat_count>] |
10 | |||
11 | :: | ||
12 | |||
9 | <repeat_count>: The number of I/Os to dispatch using the selected | 13 | <repeat_count>: The number of I/Os to dispatch using the selected |
10 | path before switching to the next path. | 14 | path before switching to the next path. |
11 | If not given, internal default is used. To check | 15 | If not given, internal default is used. To check |
12 | the default value, see the activated table. | 16 | the default value, see the activated table. |
13 | 17 | ||
14 | Status for each path: <status> <fail-count> <in-flight> | 18 | Status for each path: <status> <fail-count> <in-flight> |
19 | |||
20 | :: | ||
21 | |||
15 | <status>: 'A' if the path is active, 'F' if the path is failed. | 22 | <status>: 'A' if the path is active, 'F' if the path is failed. |
16 | <fail-count>: The number of path failures. | 23 | <fail-count>: The number of path failures. |
17 | <in-flight>: The number of in-flight I/Os on the path. | 24 | <in-flight>: The number of in-flight I/Os on the path. |
@@ -29,11 +36,13 @@ Examples | |||
29 | ======== | 36 | ======== |
30 | In case that 2 paths (sda and sdb) are used with repeat_count == 128. | 37 | In case that 2 paths (sda and sdb) are used with repeat_count == 128. |
31 | 38 | ||
32 | # echo "0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128" \ | 39 | :: |
33 | dmsetup create test | 40 | |
34 | # | 41 | # echo "0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128" \ |
35 | # dmsetup table | 42 | dmsetup create test |
36 | test: 0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128 | 43 | # |
37 | # | 44 | # dmsetup table |
38 | # dmsetup status | 45 | test: 0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128 |
39 | test: 0 10 multipath 2 0 0 0 1 1 E 0 2 1 8:0 A 0 0 8:16 A 0 0 | 46 | # |
47 | # dmsetup status | ||
48 | test: 0 10 multipath 2 0 0 0 1 1 E 0 2 1 8:0 A 0 0 8:16 A 0 0 | ||
diff --git a/Documentation/device-mapper/dm-raid.txt b/Documentation/device-mapper/dm-raid.rst index 2355bef14653..2fe255b130fb 100644 --- a/Documentation/device-mapper/dm-raid.txt +++ b/Documentation/device-mapper/dm-raid.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ======= | ||
1 | dm-raid | 2 | dm-raid |
2 | ======= | 3 | ======= |
3 | 4 | ||
@@ -8,49 +9,66 @@ interface. | |||
8 | 9 | ||
9 | Mapping Table Interface | 10 | Mapping Table Interface |
10 | ----------------------- | 11 | ----------------------- |
11 | The target is named "raid" and it accepts the following parameters: | 12 | The target is named "raid" and it accepts the following parameters:: |
12 | 13 | ||
13 | <raid_type> <#raid_params> <raid_params> \ | 14 | <raid_type> <#raid_params> <raid_params> \ |
14 | <#raid_devs> <metadata_dev0> <dev0> [.. <metadata_devN> <devN>] | 15 | <#raid_devs> <metadata_dev0> <dev0> [.. <metadata_devN> <devN>] |
15 | 16 | ||
16 | <raid_type>: | 17 | <raid_type>: |
18 | |||
19 | ============= =============================================================== | ||
17 | raid0 RAID0 striping (no resilience) | 20 | raid0 RAID0 striping (no resilience) |
18 | raid1 RAID1 mirroring | 21 | raid1 RAID1 mirroring |
19 | raid4 RAID4 with dedicated last parity disk | 22 | raid4 RAID4 with dedicated last parity disk |
20 | raid5_n RAID5 with dedicated last parity disk supporting takeover | 23 | raid5_n RAID5 with dedicated last parity disk supporting takeover |
21 | Same as raid4 | 24 | Same as raid4 |
22 | -Transitory layout | 25 | |
26 | - Transitory layout | ||
23 | raid5_la RAID5 left asymmetric | 27 | raid5_la RAID5 left asymmetric |
28 | |||
24 | - rotating parity 0 with data continuation | 29 | - rotating parity 0 with data continuation |
25 | raid5_ra RAID5 right asymmetric | 30 | raid5_ra RAID5 right asymmetric |
31 | |||
26 | - rotating parity N with data continuation | 32 | - rotating parity N with data continuation |
27 | raid5_ls RAID5 left symmetric | 33 | raid5_ls RAID5 left symmetric |
34 | |||
28 | - rotating parity 0 with data restart | 35 | - rotating parity 0 with data restart |
29 | raid5_rs RAID5 right symmetric | 36 | raid5_rs RAID5 right symmetric |
37 | |||
30 | - rotating parity N with data restart | 38 | - rotating parity N with data restart |
31 | raid6_zr RAID6 zero restart | 39 | raid6_zr RAID6 zero restart |
40 | |||
32 | - rotating parity zero (left-to-right) with data restart | 41 | - rotating parity zero (left-to-right) with data restart |
33 | raid6_nr RAID6 N restart | 42 | raid6_nr RAID6 N restart |
43 | |||
34 | - rotating parity N (right-to-left) with data restart | 44 | - rotating parity N (right-to-left) with data restart |
35 | raid6_nc RAID6 N continue | 45 | raid6_nc RAID6 N continue |
46 | |||
36 | - rotating parity N (right-to-left) with data continuation | 47 | - rotating parity N (right-to-left) with data continuation |
37 | raid6_n_6 RAID6 with dedicate parity disks | 48 | raid6_n_6 RAID6 with dedicate parity disks |
49 | |||
38 | - parity and Q-syndrome on the last 2 disks; | 50 | - parity and Q-syndrome on the last 2 disks; |
39 | layout for takeover from/to raid4/raid5_n | 51 | layout for takeover from/to raid4/raid5_n |
40 | raid6_la_6 Same as "raid_la" plus dedicated last Q-syndrome disk | 52 | raid6_la_6 Same as "raid_la" plus dedicated last Q-syndrome disk |
53 | |||
41 | - layout for takeover from raid5_la from/to raid6 | 54 | - layout for takeover from raid5_la from/to raid6 |
42 | raid6_ra_6 Same as "raid5_ra" dedicated last Q-syndrome disk | 55 | raid6_ra_6 Same as "raid5_ra" dedicated last Q-syndrome disk |
56 | |||
43 | - layout for takeover from raid5_ra from/to raid6 | 57 | - layout for takeover from raid5_ra from/to raid6 |
44 | raid6_ls_6 Same as "raid5_ls" dedicated last Q-syndrome disk | 58 | raid6_ls_6 Same as "raid5_ls" dedicated last Q-syndrome disk |
59 | |||
45 | - layout for takeover from raid5_ls from/to raid6 | 60 | - layout for takeover from raid5_ls from/to raid6 |
46 | raid6_rs_6 Same as "raid5_rs" dedicated last Q-syndrome disk | 61 | raid6_rs_6 Same as "raid5_rs" dedicated last Q-syndrome disk |
62 | |||
47 | - layout for takeover from raid5_rs from/to raid6 | 63 | - layout for takeover from raid5_rs from/to raid6 |
48 | raid10 Various RAID10 inspired algorithms chosen by additional params | 64 | raid10 Various RAID10 inspired algorithms chosen by additional params |
49 | (see raid10_format and raid10_copies below) | 65 | (see raid10_format and raid10_copies below) |
66 | |||
50 | - RAID10: Striped Mirrors (aka 'Striping on top of mirrors') | 67 | - RAID10: Striped Mirrors (aka 'Striping on top of mirrors') |
51 | - RAID1E: Integrated Adjacent Stripe Mirroring | 68 | - RAID1E: Integrated Adjacent Stripe Mirroring |
52 | - RAID1E: Integrated Offset Stripe Mirroring | 69 | - RAID1E: Integrated Offset Stripe Mirroring |
53 | - and other similar RAID10 variants | 70 | - and other similar RAID10 variants |
71 | ============= =============================================================== | ||
54 | 72 | ||
55 | Reference: Chapter 4 of | 73 | Reference: Chapter 4 of |
56 | http://www.snia.org/sites/default/files/SNIA_DDF_Technical_Position_v2.0.pdf | 74 | http://www.snia.org/sites/default/files/SNIA_DDF_Technical_Position_v2.0.pdf |
@@ -58,33 +76,41 @@ The target is named "raid" and it accepts the following parameters: | |||
58 | <#raid_params>: The number of parameters that follow. | 76 | <#raid_params>: The number of parameters that follow. |
59 | 77 | ||
60 | <raid_params> consists of | 78 | <raid_params> consists of |
79 | |||
61 | Mandatory parameters: | 80 | Mandatory parameters: |
62 | <chunk_size>: Chunk size in sectors. This parameter is often known as | 81 | <chunk_size>: |
82 | Chunk size in sectors. This parameter is often known as | ||
63 | "stripe size". It is the only mandatory parameter and | 83 | "stripe size". It is the only mandatory parameter and |
64 | is placed first. | 84 | is placed first. |
65 | 85 | ||
66 | followed by optional parameters (in any order): | 86 | followed by optional parameters (in any order): |
67 | [sync|nosync] Force or prevent RAID initialization. | 87 | [sync|nosync] |
88 | Force or prevent RAID initialization. | ||
68 | 89 | ||
69 | [rebuild <idx>] Rebuild drive number 'idx' (first drive is 0). | 90 | [rebuild <idx>] |
91 | Rebuild drive number 'idx' (first drive is 0). | ||
70 | 92 | ||
71 | [daemon_sleep <ms>] | 93 | [daemon_sleep <ms>] |
72 | Interval between runs of the bitmap daemon that | 94 | Interval between runs of the bitmap daemon that |
73 | clear bits. A longer interval means less bitmap I/O but | 95 | clear bits. A longer interval means less bitmap I/O but |
74 | resyncing after a failure is likely to take longer. | 96 | resyncing after a failure is likely to take longer. |
75 | 97 | ||
76 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 98 | [min_recovery_rate <kB/sec/disk>] |
77 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 99 | Throttle RAID initialization |
78 | [write_mostly <idx>] Mark drive index 'idx' write-mostly. | 100 | [max_recovery_rate <kB/sec/disk>] |
79 | [max_write_behind <sectors>] See '--write-behind=' (man mdadm) | 101 | Throttle RAID initialization |
80 | [stripe_cache <sectors>] Stripe cache size (RAID 4/5/6 only) | 102 | [write_mostly <idx>] |
103 | Mark drive index 'idx' write-mostly. | ||
104 | [max_write_behind <sectors>] | ||
105 | See '--write-behind=' (man mdadm) | ||
106 | [stripe_cache <sectors>] | ||
107 | Stripe cache size (RAID 4/5/6 only) | ||
81 | [region_size <sectors>] | 108 | [region_size <sectors>] |
82 | The region_size multiplied by the number of regions is the | 109 | The region_size multiplied by the number of regions is the |
83 | logical size of the array. The bitmap records the device | 110 | logical size of the array. The bitmap records the device |
84 | synchronisation state for each region. | 111 | synchronisation state for each region. |
85 | 112 | ||
86 | [raid10_copies <# copies>] | 113 | [raid10_copies <# copies>], [raid10_format <near|far|offset>] |
87 | [raid10_format <near|far|offset>] | ||
88 | These two options are used to alter the default layout of | 114 | These two options are used to alter the default layout of |
89 | a RAID10 configuration. The number of copies is can be | 115 | a RAID10 configuration. The number of copies is can be |
90 | specified, but the default is 2. There are also three | 116 | specified, but the default is 2. There are also three |
@@ -93,13 +119,17 @@ The target is named "raid" and it accepts the following parameters: | |||
93 | respect to mirroring. If these options are left unspecified, | 119 | respect to mirroring. If these options are left unspecified, |
94 | or 'raid10_copies 2' and/or 'raid10_format near' are given, | 120 | or 'raid10_copies 2' and/or 'raid10_format near' are given, |
95 | then the layouts for 2, 3 and 4 devices are: | 121 | then the layouts for 2, 3 and 4 devices are: |
122 | |||
123 | ======== ========== ============== | ||
96 | 2 drives 3 drives 4 drives | 124 | 2 drives 3 drives 4 drives |
97 | -------- ---------- -------------- | 125 | ======== ========== ============== |
98 | A1 A1 A1 A1 A2 A1 A1 A2 A2 | 126 | A1 A1 A1 A1 A2 A1 A1 A2 A2 |
99 | A2 A2 A2 A3 A3 A3 A3 A4 A4 | 127 | A2 A2 A2 A3 A3 A3 A3 A4 A4 |
100 | A3 A3 A4 A4 A5 A5 A5 A6 A6 | 128 | A3 A3 A4 A4 A5 A5 A5 A6 A6 |
101 | A4 A4 A5 A6 A6 A7 A7 A8 A8 | 129 | A4 A4 A5 A6 A6 A7 A7 A8 A8 |
102 | .. .. .. .. .. .. .. .. .. | 130 | .. .. .. .. .. .. .. .. .. |
131 | ======== ========== ============== | ||
132 | |||
103 | The 2-device layout is equivalent 2-way RAID1. The 4-device | 133 | The 2-device layout is equivalent 2-way RAID1. The 4-device |
104 | layout is what a traditional RAID10 would look like. The | 134 | layout is what a traditional RAID10 would look like. The |
105 | 3-device layout is what might be called a 'RAID1E - Integrated | 135 | 3-device layout is what might be called a 'RAID1E - Integrated |
@@ -107,8 +137,10 @@ The target is named "raid" and it accepts the following parameters: | |||
107 | 137 | ||
108 | If 'raid10_copies 2' and 'raid10_format far', then the layouts | 138 | If 'raid10_copies 2' and 'raid10_format far', then the layouts |
109 | for 2, 3 and 4 devices are: | 139 | for 2, 3 and 4 devices are: |
140 | |||
141 | ======== ============ =================== | ||
110 | 2 drives 3 drives 4 drives | 142 | 2 drives 3 drives 4 drives |
111 | -------- -------------- -------------------- | 143 | ======== ============ =================== |
112 | A1 A2 A1 A2 A3 A1 A2 A3 A4 | 144 | A1 A2 A1 A2 A3 A1 A2 A3 A4 |
113 | A3 A4 A4 A5 A6 A5 A6 A7 A8 | 145 | A3 A4 A4 A5 A6 A5 A6 A7 A8 |
114 | A5 A6 A7 A8 A9 A9 A10 A11 A12 | 146 | A5 A6 A7 A8 A9 A9 A10 A11 A12 |
@@ -117,11 +149,14 @@ The target is named "raid" and it accepts the following parameters: | |||
117 | A4 A3 A6 A4 A5 A6 A5 A8 A7 | 149 | A4 A3 A6 A4 A5 A6 A5 A8 A7 |
118 | A6 A5 A9 A7 A8 A10 A9 A12 A11 | 150 | A6 A5 A9 A7 A8 A10 A9 A12 A11 |
119 | .. .. .. .. .. .. .. .. .. | 151 | .. .. .. .. .. .. .. .. .. |
152 | ======== ============ =================== | ||
120 | 153 | ||
121 | If 'raid10_copies 2' and 'raid10_format offset', then the | 154 | If 'raid10_copies 2' and 'raid10_format offset', then the |
122 | layouts for 2, 3 and 4 devices are: | 155 | layouts for 2, 3 and 4 devices are: |
156 | |||
157 | ======== ========== ================ | ||
123 | 2 drives 3 drives 4 drives | 158 | 2 drives 3 drives 4 drives |
124 | -------- ------------ ----------------- | 159 | ======== ========== ================ |
125 | A1 A2 A1 A2 A3 A1 A2 A3 A4 | 160 | A1 A2 A1 A2 A3 A1 A2 A3 A4 |
126 | A2 A1 A3 A1 A2 A2 A1 A4 A3 | 161 | A2 A1 A3 A1 A2 A2 A1 A4 A3 |
127 | A3 A4 A4 A5 A6 A5 A6 A7 A8 | 162 | A3 A4 A4 A5 A6 A5 A6 A7 A8 |
@@ -129,6 +164,8 @@ The target is named "raid" and it accepts the following parameters: | |||
129 | A5 A6 A7 A8 A9 A9 A10 A11 A12 | 164 | A5 A6 A7 A8 A9 A9 A10 A11 A12 |
130 | A6 A5 A9 A7 A8 A10 A9 A12 A11 | 165 | A6 A5 A9 A7 A8 A10 A9 A12 A11 |
131 | .. .. .. .. .. .. .. .. .. | 166 | .. .. .. .. .. .. .. .. .. |
167 | ======== ========== ================ | ||
168 | |||
132 | Here we see layouts closely akin to 'RAID1E - Integrated | 169 | Here we see layouts closely akin to 'RAID1E - Integrated |
133 | Offset Stripe Mirroring'. | 170 | Offset Stripe Mirroring'. |
134 | 171 | ||
@@ -190,22 +227,25 @@ The target is named "raid" and it accepts the following parameters: | |||
190 | 227 | ||
191 | Example Tables | 228 | Example Tables |
192 | -------------- | 229 | -------------- |
193 | # RAID4 - 4 data drives, 1 parity (no metadata devices) | ||
194 | # No metadata devices specified to hold superblock/bitmap info | ||
195 | # Chunk size of 1MiB | ||
196 | # (Lines separated for easy reading) | ||
197 | 230 | ||
198 | 0 1960893648 raid \ | 231 | :: |
199 | raid4 1 2048 \ | ||
200 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 | ||
201 | 232 | ||
202 | # RAID4 - 4 data drives, 1 parity (with metadata devices) | 233 | # RAID4 - 4 data drives, 1 parity (no metadata devices) |
203 | # Chunk size of 1MiB, force RAID initialization, | 234 | # No metadata devices specified to hold superblock/bitmap info |
204 | # min recovery rate at 20 kiB/sec/disk | 235 | # Chunk size of 1MiB |
236 | # (Lines separated for easy reading) | ||
205 | 237 | ||
206 | 0 1960893648 raid \ | 238 | 0 1960893648 raid \ |
207 | raid4 4 2048 sync min_recovery_rate 20 \ | 239 | raid4 1 2048 \ |
208 | 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82 | 240 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 |
241 | |||
242 | # RAID4 - 4 data drives, 1 parity (with metadata devices) | ||
243 | # Chunk size of 1MiB, force RAID initialization, | ||
244 | # min recovery rate at 20 kiB/sec/disk | ||
245 | |||
246 | 0 1960893648 raid \ | ||
247 | raid4 4 2048 sync min_recovery_rate 20 \ | ||
248 | 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82 | ||
209 | 249 | ||
210 | 250 | ||
211 | Status Output | 251 | Status Output |
@@ -219,41 +259,58 @@ Arguments that can be repeated are ordered by value. | |||
219 | 259 | ||
220 | 'dmsetup status' yields information on the state and health of the array. | 260 | 'dmsetup status' yields information on the state and health of the array. |
221 | The output is as follows (normally a single line, but expanded here for | 261 | The output is as follows (normally a single line, but expanded here for |
222 | clarity): | 262 | clarity):: |
223 | 1: <s> <l> raid \ | 263 | |
224 | 2: <raid_type> <#devices> <health_chars> \ | 264 | 1: <s> <l> raid \ |
225 | 3: <sync_ratio> <sync_action> <mismatch_cnt> | 265 | 2: <raid_type> <#devices> <health_chars> \ |
266 | 3: <sync_ratio> <sync_action> <mismatch_cnt> | ||
226 | 267 | ||
227 | Line 1 is the standard output produced by device-mapper. | 268 | Line 1 is the standard output produced by device-mapper. |
228 | Line 2 & 3 are produced by the raid target and are best explained by example: | 269 | |
270 | Line 2 & 3 are produced by the raid target and are best explained by example:: | ||
271 | |||
229 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 init 0 | 272 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 init 0 |
273 | |||
230 | Here we can see the RAID type is raid4, there are 5 devices - all of | 274 | Here we can see the RAID type is raid4, there are 5 devices - all of |
231 | which are 'A'live, and the array is 2/490221568 complete with its initial | 275 | which are 'A'live, and the array is 2/490221568 complete with its initial |
232 | recovery. Here is a fuller description of the individual fields: | 276 | recovery. Here is a fuller description of the individual fields: |
277 | |||
278 | =============== ========================================================= | ||
233 | <raid_type> Same as the <raid_type> used to create the array. | 279 | <raid_type> Same as the <raid_type> used to create the array. |
234 | <health_chars> One char for each device, indicating: 'A' = alive and | 280 | <health_chars> One char for each device, indicating: |
235 | in-sync, 'a' = alive but not in-sync, 'D' = dead/failed. | 281 | |
282 | - 'A' = alive and in-sync | ||
283 | - 'a' = alive but not in-sync | ||
284 | - 'D' = dead/failed. | ||
236 | <sync_ratio> The ratio indicating how much of the array has undergone | 285 | <sync_ratio> The ratio indicating how much of the array has undergone |
237 | the process described by 'sync_action'. If the | 286 | the process described by 'sync_action'. If the |
238 | 'sync_action' is "check" or "repair", then the process | 287 | 'sync_action' is "check" or "repair", then the process |
239 | of "resync" or "recover" can be considered complete. | 288 | of "resync" or "recover" can be considered complete. |
240 | <sync_action> One of the following possible states: | 289 | <sync_action> One of the following possible states: |
241 | idle - No synchronization action is being performed. | 290 | |
242 | frozen - The current action has been halted. | 291 | idle |
243 | resync - Array is undergoing its initial synchronization | 292 | - No synchronization action is being performed. |
293 | frozen | ||
294 | - The current action has been halted. | ||
295 | resync | ||
296 | - Array is undergoing its initial synchronization | ||
244 | or is resynchronizing after an unclean shutdown | 297 | or is resynchronizing after an unclean shutdown |
245 | (possibly aided by a bitmap). | 298 | (possibly aided by a bitmap). |
246 | recover - A device in the array is being rebuilt or | 299 | recover |
300 | - A device in the array is being rebuilt or | ||
247 | replaced. | 301 | replaced. |
248 | check - A user-initiated full check of the array is | 302 | check |
303 | - A user-initiated full check of the array is | ||
249 | being performed. All blocks are read and | 304 | being performed. All blocks are read and |
250 | checked for consistency. The number of | 305 | checked for consistency. The number of |
251 | discrepancies found are recorded in | 306 | discrepancies found are recorded in |
252 | <mismatch_cnt>. No changes are made to the | 307 | <mismatch_cnt>. No changes are made to the |
253 | array by this action. | 308 | array by this action. |
254 | repair - The same as "check", but discrepancies are | 309 | repair |
310 | - The same as "check", but discrepancies are | ||
255 | corrected. | 311 | corrected. |
256 | reshape - The array is undergoing a reshape. | 312 | reshape |
313 | - The array is undergoing a reshape. | ||
257 | <mismatch_cnt> The number of discrepancies found between mirror copies | 314 | <mismatch_cnt> The number of discrepancies found between mirror copies |
258 | in RAID1/10 or wrong parity values found in RAID4/5/6. | 315 | in RAID1/10 or wrong parity values found in RAID4/5/6. |
259 | This value is valid only after a "check" of the array | 316 | This value is valid only after a "check" of the array |
@@ -261,10 +318,11 @@ recovery. Here is a fuller description of the individual fields: | |||
261 | <data_offset> The current data offset to the start of the user data on | 318 | <data_offset> The current data offset to the start of the user data on |
262 | each component device of a raid set (see the respective | 319 | each component device of a raid set (see the respective |
263 | raid parameter to support out-of-place reshaping). | 320 | raid parameter to support out-of-place reshaping). |
264 | <journal_char> 'A' - active write-through journal device. | 321 | <journal_char> - 'A' - active write-through journal device. |
265 | 'a' - active write-back journal device. | 322 | - 'a' - active write-back journal device. |
266 | 'D' - dead journal device. | 323 | - 'D' - dead journal device. |
267 | '-' - no journal device. | 324 | - '-' - no journal device. |
325 | =============== ========================================================= | ||
268 | 326 | ||
269 | 327 | ||
270 | Message Interface | 328 | Message Interface |
@@ -272,12 +330,15 @@ Message Interface | |||
272 | The dm-raid target will accept certain actions through the 'message' interface. | 330 | The dm-raid target will accept certain actions through the 'message' interface. |
273 | ('man dmsetup' for more information on the message interface.) These actions | 331 | ('man dmsetup' for more information on the message interface.) These actions |
274 | include: | 332 | include: |
275 | "idle" - Halt the current sync action. | 333 | |
276 | "frozen" - Freeze the current sync action. | 334 | ========= ================================================ |
277 | "resync" - Initiate/continue a resync. | 335 | "idle" Halt the current sync action. |
278 | "recover"- Initiate/continue a recover process. | 336 | "frozen" Freeze the current sync action. |
279 | "check" - Initiate a check (i.e. a "scrub") of the array. | 337 | "resync" Initiate/continue a resync. |
280 | "repair" - Initiate a repair of the array. | 338 | "recover" Initiate/continue a recover process. |
339 | "check" Initiate a check (i.e. a "scrub") of the array. | ||
340 | "repair" Initiate a repair of the array. | ||
341 | ========= ================================================ | ||
281 | 342 | ||
282 | 343 | ||
283 | Discard Support | 344 | Discard Support |
@@ -307,48 +368,52 @@ increasingly whitelisted in the kernel and can thus be trusted. | |||
307 | 368 | ||
308 | For trusted devices, the following dm-raid module parameter can be set | 369 | For trusted devices, the following dm-raid module parameter can be set |
309 | to safely enable discard support for RAID 4/5/6: | 370 | to safely enable discard support for RAID 4/5/6: |
371 | |||
310 | 'devices_handle_discards_safely' | 372 | 'devices_handle_discards_safely' |
311 | 373 | ||
312 | 374 | ||
313 | Version History | 375 | Version History |
314 | --------------- | 376 | --------------- |
315 | 1.0.0 Initial version. Support for RAID 4/5/6 | 377 | |
316 | 1.1.0 Added support for RAID 1 | 378 | :: |
317 | 1.2.0 Handle creation of arrays that contain failed devices. | 379 | |
318 | 1.3.0 Added support for RAID 10 | 380 | 1.0.0 Initial version. Support for RAID 4/5/6 |
319 | 1.3.1 Allow device replacement/rebuild for RAID 10 | 381 | 1.1.0 Added support for RAID 1 |
320 | 1.3.2 Fix/improve redundancy checking for RAID10 | 382 | 1.2.0 Handle creation of arrays that contain failed devices. |
321 | 1.4.0 Non-functional change. Removes arg from mapping function. | 383 | 1.3.0 Added support for RAID 10 |
322 | 1.4.1 RAID10 fix redundancy validation checks (commit 55ebbb5). | 384 | 1.3.1 Allow device replacement/rebuild for RAID 10 |
323 | 1.4.2 Add RAID10 "far" and "offset" algorithm support. | 385 | 1.3.2 Fix/improve redundancy checking for RAID10 |
324 | 1.5.0 Add message interface to allow manipulation of the sync_action. | 386 | 1.4.0 Non-functional change. Removes arg from mapping function. |
387 | 1.4.1 RAID10 fix redundancy validation checks (commit 55ebbb5). | ||
388 | 1.4.2 Add RAID10 "far" and "offset" algorithm support. | ||
389 | 1.5.0 Add message interface to allow manipulation of the sync_action. | ||
325 | New status (STATUSTYPE_INFO) fields: sync_action and mismatch_cnt. | 390 | New status (STATUSTYPE_INFO) fields: sync_action and mismatch_cnt. |
326 | 1.5.1 Add ability to restore transiently failed devices on resume. | 391 | 1.5.1 Add ability to restore transiently failed devices on resume. |
327 | 1.5.2 'mismatch_cnt' is zero unless [last_]sync_action is "check". | 392 | 1.5.2 'mismatch_cnt' is zero unless [last_]sync_action is "check". |
328 | 1.6.0 Add discard support (and devices_handle_discard_safely module param). | 393 | 1.6.0 Add discard support (and devices_handle_discard_safely module param). |
329 | 1.7.0 Add support for MD RAID0 mappings. | 394 | 1.7.0 Add support for MD RAID0 mappings. |
330 | 1.8.0 Explicitly check for compatible flags in the superblock metadata | 395 | 1.8.0 Explicitly check for compatible flags in the superblock metadata |
331 | and reject to start the raid set if any are set by a newer | 396 | and reject to start the raid set if any are set by a newer |
332 | target version, thus avoiding data corruption on a raid set | 397 | target version, thus avoiding data corruption on a raid set |
333 | with a reshape in progress. | 398 | with a reshape in progress. |
334 | 1.9.0 Add support for RAID level takeover/reshape/region size | 399 | 1.9.0 Add support for RAID level takeover/reshape/region size |
335 | and set size reduction. | 400 | and set size reduction. |
336 | 1.9.1 Fix activation of existing RAID 4/10 mapped devices | 401 | 1.9.1 Fix activation of existing RAID 4/10 mapped devices |
337 | 1.9.2 Don't emit '- -' on the status table line in case the constructor | 402 | 1.9.2 Don't emit '- -' on the status table line in case the constructor |
338 | fails reading a superblock. Correctly emit 'maj:min1 maj:min2' and | 403 | fails reading a superblock. Correctly emit 'maj:min1 maj:min2' and |
339 | 'D' on the status line. If '- -' is passed into the constructor, emit | 404 | 'D' on the status line. If '- -' is passed into the constructor, emit |
340 | '- -' on the table line and '-' as the status line health character. | 405 | '- -' on the table line and '-' as the status line health character. |
341 | 1.10.0 Add support for raid4/5/6 journal device | 406 | 1.10.0 Add support for raid4/5/6 journal device |
342 | 1.10.1 Fix data corruption on reshape request | 407 | 1.10.1 Fix data corruption on reshape request |
343 | 1.11.0 Fix table line argument order | 408 | 1.11.0 Fix table line argument order |
344 | (wrong raid10_copies/raid10_format sequence) | 409 | (wrong raid10_copies/raid10_format sequence) |
345 | 1.11.1 Add raid4/5/6 journal write-back support via journal_mode option | 410 | 1.11.1 Add raid4/5/6 journal write-back support via journal_mode option |
346 | 1.12.1 Fix for MD deadlock between mddev_suspend() and md_write_start() available | 411 | 1.12.1 Fix for MD deadlock between mddev_suspend() and md_write_start() available |
347 | 1.13.0 Fix dev_health status at end of "recover" (was 'a', now 'A') | 412 | 1.13.0 Fix dev_health status at end of "recover" (was 'a', now 'A') |
348 | 1.13.1 Fix deadlock caused by early md_stop_writes(). Also fix size an | 413 | 1.13.1 Fix deadlock caused by early md_stop_writes(). Also fix size an |
349 | state races. | 414 | state races. |
350 | 1.13.2 Fix raid redundancy validation and avoid keeping raid set frozen | 415 | 1.13.2 Fix raid redundancy validation and avoid keeping raid set frozen |
351 | 1.14.0 Fix reshape race on small devices. Fix stripe adding reshape | 416 | 1.14.0 Fix reshape race on small devices. Fix stripe adding reshape |
352 | deadlock/potential data corruption. Update superblock when | 417 | deadlock/potential data corruption. Update superblock when |
353 | specific devices are requested via rebuild. Fix RAID leg | 418 | specific devices are requested via rebuild. Fix RAID leg |
354 | rebuild errors. | 419 | rebuild errors. |
diff --git a/Documentation/device-mapper/dm-service-time.txt b/Documentation/device-mapper/dm-service-time.rst index fb1d4a0cf122..facf277fc13c 100644 --- a/Documentation/device-mapper/dm-service-time.txt +++ b/Documentation/device-mapper/dm-service-time.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | =============== | ||
1 | dm-service-time | 2 | dm-service-time |
2 | =============== | 3 | =============== |
3 | 4 | ||
@@ -12,25 +13,34 @@ in a path-group, and it can be specified as a table argument. | |||
12 | 13 | ||
13 | The path selector name is 'service-time'. | 14 | The path selector name is 'service-time'. |
14 | 15 | ||
15 | Table parameters for each path: [<repeat_count> [<relative_throughput>]] | 16 | Table parameters for each path: |
16 | <repeat_count>: The number of I/Os to dispatch using the selected | 17 | |
18 | [<repeat_count> [<relative_throughput>]] | ||
19 | <repeat_count>: | ||
20 | The number of I/Os to dispatch using the selected | ||
17 | path before switching to the next path. | 21 | path before switching to the next path. |
18 | If not given, internal default is used. To check | 22 | If not given, internal default is used. To check |
19 | the default value, see the activated table. | 23 | the default value, see the activated table. |
20 | <relative_throughput>: The relative throughput value of the path | 24 | <relative_throughput>: |
25 | The relative throughput value of the path | ||
21 | among all paths in the path-group. | 26 | among all paths in the path-group. |
22 | The valid range is 0-100. | 27 | The valid range is 0-100. |
23 | If not given, minimum value '1' is used. | 28 | If not given, minimum value '1' is used. |
24 | If '0' is given, the path isn't selected while | 29 | If '0' is given, the path isn't selected while |
25 | other paths having a positive value are available. | 30 | other paths having a positive value are available. |
26 | 31 | ||
27 | Status for each path: <status> <fail-count> <in-flight-size> \ | 32 | Status for each path: |
28 | <relative_throughput> | 33 | |
29 | <status>: 'A' if the path is active, 'F' if the path is failed. | 34 | <status> <fail-count> <in-flight-size> <relative_throughput> |
30 | <fail-count>: The number of path failures. | 35 | <status>: |
31 | <in-flight-size>: The size of in-flight I/Os on the path. | 36 | 'A' if the path is active, 'F' if the path is failed. |
32 | <relative_throughput>: The relative throughput value of the path | 37 | <fail-count>: |
33 | among all paths in the path-group. | 38 | The number of path failures. |
39 | <in-flight-size>: | ||
40 | The size of in-flight I/Os on the path. | ||
41 | <relative_throughput>: | ||
42 | The relative throughput value of the path | ||
43 | among all paths in the path-group. | ||
34 | 44 | ||
35 | 45 | ||
36 | Algorithm | 46 | Algorithm |
@@ -39,7 +49,7 @@ Algorithm | |||
39 | dm-service-time adds the I/O size to 'in-flight-size' when the I/O is | 49 | dm-service-time adds the I/O size to 'in-flight-size' when the I/O is |
40 | dispatched and subtracts when completed. | 50 | dispatched and subtracts when completed. |
41 | Basically, dm-service-time selects a path having minimum service time | 51 | Basically, dm-service-time selects a path having minimum service time |
42 | which is calculated by: | 52 | which is calculated by:: |
43 | 53 | ||
44 | ('in-flight-size' + 'size-of-incoming-io') / 'relative_throughput' | 54 | ('in-flight-size' + 'size-of-incoming-io') / 'relative_throughput' |
45 | 55 | ||
@@ -67,25 +77,25 @@ Examples | |||
67 | ======== | 77 | ======== |
68 | In case that 2 paths (sda and sdb) are used with repeat_count == 128 | 78 | In case that 2 paths (sda and sdb) are used with repeat_count == 128 |
69 | and sda has an average throughput 1GB/s and sdb has 4GB/s, | 79 | and sda has an average throughput 1GB/s and sdb has 4GB/s, |
70 | 'relative_throughput' value may be '1' for sda and '4' for sdb. | 80 | 'relative_throughput' value may be '1' for sda and '4' for sdb:: |
71 | 81 | ||
72 | # echo "0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 1 8:16 128 4" \ | 82 | # echo "0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 1 8:16 128 4" \ |
73 | dmsetup create test | 83 | dmsetup create test |
74 | # | 84 | # |
75 | # dmsetup table | 85 | # dmsetup table |
76 | test: 0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 1 8:16 128 4 | 86 | test: 0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 1 8:16 128 4 |
77 | # | 87 | # |
78 | # dmsetup status | 88 | # dmsetup status |
79 | test: 0 10 multipath 2 0 0 0 1 1 E 0 2 2 8:0 A 0 0 1 8:16 A 0 0 4 | 89 | test: 0 10 multipath 2 0 0 0 1 1 E 0 2 2 8:0 A 0 0 1 8:16 A 0 0 4 |
80 | 90 | ||
81 | 91 | ||
82 | Or '2' for sda and '8' for sdb would be also true. | 92 | Or '2' for sda and '8' for sdb would be also true:: |
83 | 93 | ||
84 | # echo "0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 2 8:16 128 8" \ | 94 | # echo "0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 2 8:16 128 8" \ |
85 | dmsetup create test | 95 | dmsetup create test |
86 | # | 96 | # |
87 | # dmsetup table | 97 | # dmsetup table |
88 | test: 0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 2 8:16 128 8 | 98 | test: 0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 2 8:16 128 8 |
89 | # | 99 | # |
90 | # dmsetup status | 100 | # dmsetup status |
91 | test: 0 10 multipath 2 0 0 0 1 1 E 0 2 2 8:0 A 0 0 2 8:16 A 0 0 8 | 101 | test: 0 10 multipath 2 0 0 0 1 1 E 0 2 2 8:0 A 0 0 2 8:16 A 0 0 8 |
diff --git a/Documentation/device-mapper/dm-uevent.rst b/Documentation/device-mapper/dm-uevent.rst new file mode 100644 index 000000000000..4a8ee8d069c9 --- /dev/null +++ b/Documentation/device-mapper/dm-uevent.rst | |||
@@ -0,0 +1,110 @@ | |||
1 | ==================== | ||
2 | device-mapper uevent | ||
3 | ==================== | ||
4 | |||
5 | The device-mapper uevent code adds the capability to device-mapper to create | ||
6 | and send kobject uevents (uevents). Previously device-mapper events were only | ||
7 | available through the ioctl interface. The advantage of the uevents interface | ||
8 | is the event contains environment attributes providing increased context for | ||
9 | the event avoiding the need to query the state of the device-mapper device after | ||
10 | the event is received. | ||
11 | |||
12 | There are two functions currently for device-mapper events. The first function | ||
13 | listed creates the event and the second function sends the event(s):: | ||
14 | |||
15 | void dm_path_uevent(enum dm_uevent_type event_type, struct dm_target *ti, | ||
16 | const char *path, unsigned nr_valid_paths) | ||
17 | |||
18 | void dm_send_uevents(struct list_head *events, struct kobject *kobj) | ||
19 | |||
20 | |||
21 | The variables added to the uevent environment are: | ||
22 | |||
23 | Variable Name: DM_TARGET | ||
24 | ------------------------ | ||
25 | :Uevent Action(s): KOBJ_CHANGE | ||
26 | :Type: string | ||
27 | :Description: | ||
28 | :Value: Name of device-mapper target that generated the event. | ||
29 | |||
30 | Variable Name: DM_ACTION | ||
31 | ------------------------ | ||
32 | :Uevent Action(s): KOBJ_CHANGE | ||
33 | :Type: string | ||
34 | :Description: | ||
35 | :Value: Device-mapper specific action that caused the uevent action. | ||
36 | PATH_FAILED - A path has failed; | ||
37 | PATH_REINSTATED - A path has been reinstated. | ||
38 | |||
39 | Variable Name: DM_SEQNUM | ||
40 | ------------------------ | ||
41 | :Uevent Action(s): KOBJ_CHANGE | ||
42 | :Type: unsigned integer | ||
43 | :Description: A sequence number for this specific device-mapper device. | ||
44 | :Value: Valid unsigned integer range. | ||
45 | |||
46 | Variable Name: DM_PATH | ||
47 | ---------------------- | ||
48 | :Uevent Action(s): KOBJ_CHANGE | ||
49 | :Type: string | ||
50 | :Description: Major and minor number of the path device pertaining to this | ||
51 | event. | ||
52 | :Value: Path name in the form of "Major:Minor" | ||
53 | |||
54 | Variable Name: DM_NR_VALID_PATHS | ||
55 | -------------------------------- | ||
56 | :Uevent Action(s): KOBJ_CHANGE | ||
57 | :Type: unsigned integer | ||
58 | :Description: | ||
59 | :Value: Valid unsigned integer range. | ||
60 | |||
61 | Variable Name: DM_NAME | ||
62 | ---------------------- | ||
63 | :Uevent Action(s): KOBJ_CHANGE | ||
64 | :Type: string | ||
65 | :Description: Name of the device-mapper device. | ||
66 | :Value: Name | ||
67 | |||
68 | Variable Name: DM_UUID | ||
69 | ---------------------- | ||
70 | :Uevent Action(s): KOBJ_CHANGE | ||
71 | :Type: string | ||
72 | :Description: UUID of the device-mapper device. | ||
73 | :Value: UUID. (Empty string if there isn't one.) | ||
74 | |||
75 | An example of the uevents generated as captured by udevmonitor is shown | ||
76 | below | ||
77 | |||
78 | 1.) Path failure:: | ||
79 | |||
80 | UEVENT[1192521009.711215] change@/block/dm-3 | ||
81 | ACTION=change | ||
82 | DEVPATH=/block/dm-3 | ||
83 | SUBSYSTEM=block | ||
84 | DM_TARGET=multipath | ||
85 | DM_ACTION=PATH_FAILED | ||
86 | DM_SEQNUM=1 | ||
87 | DM_PATH=8:32 | ||
88 | DM_NR_VALID_PATHS=0 | ||
89 | DM_NAME=mpath2 | ||
90 | DM_UUID=mpath-35333333000002328 | ||
91 | MINOR=3 | ||
92 | MAJOR=253 | ||
93 | SEQNUM=1130 | ||
94 | |||
95 | 2.) Path reinstate:: | ||
96 | |||
97 | UEVENT[1192521132.989927] change@/block/dm-3 | ||
98 | ACTION=change | ||
99 | DEVPATH=/block/dm-3 | ||
100 | SUBSYSTEM=block | ||
101 | DM_TARGET=multipath | ||
102 | DM_ACTION=PATH_REINSTATED | ||
103 | DM_SEQNUM=2 | ||
104 | DM_PATH=8:32 | ||
105 | DM_NR_VALID_PATHS=1 | ||
106 | DM_NAME=mpath2 | ||
107 | DM_UUID=mpath-35333333000002328 | ||
108 | MINOR=3 | ||
109 | MAJOR=253 | ||
110 | SEQNUM=1131 | ||
diff --git a/Documentation/device-mapper/dm-uevent.txt b/Documentation/device-mapper/dm-uevent.txt deleted file mode 100644 index 07edbd85c714..000000000000 --- a/Documentation/device-mapper/dm-uevent.txt +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | The device-mapper uevent code adds the capability to device-mapper to create | ||
2 | and send kobject uevents (uevents). Previously device-mapper events were only | ||
3 | available through the ioctl interface. The advantage of the uevents interface | ||
4 | is the event contains environment attributes providing increased context for | ||
5 | the event avoiding the need to query the state of the device-mapper device after | ||
6 | the event is received. | ||
7 | |||
8 | There are two functions currently for device-mapper events. The first function | ||
9 | listed creates the event and the second function sends the event(s). | ||
10 | |||
11 | void dm_path_uevent(enum dm_uevent_type event_type, struct dm_target *ti, | ||
12 | const char *path, unsigned nr_valid_paths) | ||
13 | |||
14 | void dm_send_uevents(struct list_head *events, struct kobject *kobj) | ||
15 | |||
16 | |||
17 | The variables added to the uevent environment are: | ||
18 | |||
19 | Variable Name: DM_TARGET | ||
20 | Uevent Action(s): KOBJ_CHANGE | ||
21 | Type: string | ||
22 | Description: | ||
23 | Value: Name of device-mapper target that generated the event. | ||
24 | |||
25 | Variable Name: DM_ACTION | ||
26 | Uevent Action(s): KOBJ_CHANGE | ||
27 | Type: string | ||
28 | Description: | ||
29 | Value: Device-mapper specific action that caused the uevent action. | ||
30 | PATH_FAILED - A path has failed. | ||
31 | PATH_REINSTATED - A path has been reinstated. | ||
32 | |||
33 | Variable Name: DM_SEQNUM | ||
34 | Uevent Action(s): KOBJ_CHANGE | ||
35 | Type: unsigned integer | ||
36 | Description: A sequence number for this specific device-mapper device. | ||
37 | Value: Valid unsigned integer range. | ||
38 | |||
39 | Variable Name: DM_PATH | ||
40 | Uevent Action(s): KOBJ_CHANGE | ||
41 | Type: string | ||
42 | Description: Major and minor number of the path device pertaining to this | ||
43 | event. | ||
44 | Value: Path name in the form of "Major:Minor" | ||
45 | |||
46 | Variable Name: DM_NR_VALID_PATHS | ||
47 | Uevent Action(s): KOBJ_CHANGE | ||
48 | Type: unsigned integer | ||
49 | Description: | ||
50 | Value: Valid unsigned integer range. | ||
51 | |||
52 | Variable Name: DM_NAME | ||
53 | Uevent Action(s): KOBJ_CHANGE | ||
54 | Type: string | ||
55 | Description: Name of the device-mapper device. | ||
56 | Value: Name | ||
57 | |||
58 | Variable Name: DM_UUID | ||
59 | Uevent Action(s): KOBJ_CHANGE | ||
60 | Type: string | ||
61 | Description: UUID of the device-mapper device. | ||
62 | Value: UUID. (Empty string if there isn't one.) | ||
63 | |||
64 | An example of the uevents generated as captured by udevmonitor is shown | ||
65 | below. | ||
66 | |||
67 | 1.) Path failure. | ||
68 | UEVENT[1192521009.711215] change@/block/dm-3 | ||
69 | ACTION=change | ||
70 | DEVPATH=/block/dm-3 | ||
71 | SUBSYSTEM=block | ||
72 | DM_TARGET=multipath | ||
73 | DM_ACTION=PATH_FAILED | ||
74 | DM_SEQNUM=1 | ||
75 | DM_PATH=8:32 | ||
76 | DM_NR_VALID_PATHS=0 | ||
77 | DM_NAME=mpath2 | ||
78 | DM_UUID=mpath-35333333000002328 | ||
79 | MINOR=3 | ||
80 | MAJOR=253 | ||
81 | SEQNUM=1130 | ||
82 | |||
83 | 2.) Path reinstate. | ||
84 | UEVENT[1192521132.989927] change@/block/dm-3 | ||
85 | ACTION=change | ||
86 | DEVPATH=/block/dm-3 | ||
87 | SUBSYSTEM=block | ||
88 | DM_TARGET=multipath | ||
89 | DM_ACTION=PATH_REINSTATED | ||
90 | DM_SEQNUM=2 | ||
91 | DM_PATH=8:32 | ||
92 | DM_NR_VALID_PATHS=1 | ||
93 | DM_NAME=mpath2 | ||
94 | DM_UUID=mpath-35333333000002328 | ||
95 | MINOR=3 | ||
96 | MAJOR=253 | ||
97 | SEQNUM=1131 | ||
diff --git a/Documentation/device-mapper/dm-zoned.txt b/Documentation/device-mapper/dm-zoned.rst index 736fcc78d193..07f56ebc1730 100644 --- a/Documentation/device-mapper/dm-zoned.txt +++ b/Documentation/device-mapper/dm-zoned.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ======== | ||
1 | dm-zoned | 2 | dm-zoned |
2 | ======== | 3 | ======== |
3 | 4 | ||
@@ -133,12 +134,13 @@ A zoned block device must first be formatted using the dmzadm tool. This | |||
133 | will analyze the device zone configuration, determine where to place the | 134 | will analyze the device zone configuration, determine where to place the |
134 | metadata sets on the device and initialize the metadata sets. | 135 | metadata sets on the device and initialize the metadata sets. |
135 | 136 | ||
136 | Ex: | 137 | Ex:: |
137 | 138 | ||
138 | dmzadm --format /dev/sdxx | 139 | dmzadm --format /dev/sdxx |
139 | 140 | ||
140 | For a formatted device, the target can be created normally with the | 141 | For a formatted device, the target can be created normally with the |
141 | dmsetup utility. The only parameter that dm-zoned requires is the | 142 | dmsetup utility. The only parameter that dm-zoned requires is the |
142 | underlying zoned block device name. Ex: | 143 | underlying zoned block device name. Ex:: |
143 | 144 | ||
144 | echo "0 `blockdev --getsize ${dev}` zoned ${dev}" | dmsetup create dmz-`basename ${dev}` | 145 | echo "0 `blockdev --getsize ${dev}` zoned ${dev}" | \ |
146 | dmsetup create dmz-`basename ${dev}` | ||
diff --git a/Documentation/device-mapper/era.txt b/Documentation/device-mapper/era.rst index 3c6d01be3560..90dd5c670b9f 100644 --- a/Documentation/device-mapper/era.txt +++ b/Documentation/device-mapper/era.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ====== | ||
2 | dm-era | ||
3 | ====== | ||
4 | |||
1 | Introduction | 5 | Introduction |
2 | ============ | 6 | ============ |
3 | 7 | ||
@@ -14,12 +18,14 @@ coherency after rolling back a vendor snapshot. | |||
14 | Constructor | 18 | Constructor |
15 | =========== | 19 | =========== |
16 | 20 | ||
17 | era <metadata dev> <origin dev> <block size> | 21 | era <metadata dev> <origin dev> <block size> |
18 | 22 | ||
19 | metadata dev : fast device holding the persistent metadata | 23 | ================ ====================================================== |
20 | origin dev : device holding data blocks that may change | 24 | metadata dev fast device holding the persistent metadata |
21 | block size : block size of origin data device, granularity that is | 25 | origin dev device holding data blocks that may change |
22 | tracked by the target | 26 | block size block size of origin data device, granularity that is |
27 | tracked by the target | ||
28 | ================ ====================================================== | ||
23 | 29 | ||
24 | Messages | 30 | Messages |
25 | ======== | 31 | ======== |
@@ -49,14 +55,16 @@ Status | |||
49 | <metadata block size> <#used metadata blocks>/<#total metadata blocks> | 55 | <metadata block size> <#used metadata blocks>/<#total metadata blocks> |
50 | <current era> <held metadata root | '-'> | 56 | <current era> <held metadata root | '-'> |
51 | 57 | ||
52 | metadata block size : Fixed block size for each metadata block in | 58 | ========================= ============================================== |
53 | sectors | 59 | metadata block size Fixed block size for each metadata block in |
54 | #used metadata blocks : Number of metadata blocks used | 60 | sectors |
55 | #total metadata blocks : Total number of metadata blocks | 61 | #used metadata blocks Number of metadata blocks used |
56 | current era : The current era | 62 | #total metadata blocks Total number of metadata blocks |
57 | held metadata root : The location, in blocks, of the metadata root | 63 | current era The current era |
58 | that has been 'held' for userspace read | 64 | held metadata root The location, in blocks, of the metadata root |
59 | access. '-' indicates there is no held root | 65 | that has been 'held' for userspace read |
66 | access. '-' indicates there is no held root | ||
67 | ========================= ============================================== | ||
60 | 68 | ||
61 | Detailed use case | 69 | Detailed use case |
62 | ================= | 70 | ================= |
@@ -88,7 +96,7 @@ Memory usage | |||
88 | 96 | ||
89 | The target uses a bitset to record writes in the current era. It also | 97 | The target uses a bitset to record writes in the current era. It also |
90 | has a spare bitset ready for switching over to a new era. Other than | 98 | has a spare bitset ready for switching over to a new era. Other than |
91 | that it uses a few 4k blocks for updating metadata. | 99 | that it uses a few 4k blocks for updating metadata:: |
92 | 100 | ||
93 | (4 * nr_blocks) bytes + buffers | 101 | (4 * nr_blocks) bytes + buffers |
94 | 102 | ||
diff --git a/Documentation/device-mapper/index.rst b/Documentation/device-mapper/index.rst new file mode 100644 index 000000000000..105e253bc231 --- /dev/null +++ b/Documentation/device-mapper/index.rst | |||
@@ -0,0 +1,44 @@ | |||
1 | :orphan: | ||
2 | |||
3 | ============= | ||
4 | Device Mapper | ||
5 | ============= | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | cache-policies | ||
11 | cache | ||
12 | delay | ||
13 | dm-crypt | ||
14 | dm-flakey | ||
15 | dm-init | ||
16 | dm-integrity | ||
17 | dm-io | ||
18 | dm-log | ||
19 | dm-queue-length | ||
20 | dm-raid | ||
21 | dm-service-time | ||
22 | dm-uevent | ||
23 | dm-zoned | ||
24 | era | ||
25 | kcopyd | ||
26 | linear | ||
27 | log-writes | ||
28 | persistent-data | ||
29 | snapshot | ||
30 | statistics | ||
31 | striped | ||
32 | switch | ||
33 | thin-provisioning | ||
34 | unstriped | ||
35 | verity | ||
36 | writecache | ||
37 | zero | ||
38 | |||
39 | .. only:: subproject and html | ||
40 | |||
41 | Indices | ||
42 | ======= | ||
43 | |||
44 | * :ref:`genindex` | ||
diff --git a/Documentation/device-mapper/kcopyd.txt b/Documentation/device-mapper/kcopyd.rst index 820382c4cecf..7651d395127f 100644 --- a/Documentation/device-mapper/kcopyd.txt +++ b/Documentation/device-mapper/kcopyd.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ====== | ||
1 | kcopyd | 2 | kcopyd |
2 | ====== | 3 | ====== |
3 | 4 | ||
@@ -7,7 +8,7 @@ notification. It is used by dm-snapshot and dm-mirror. | |||
7 | 8 | ||
8 | Users of kcopyd must first create a client and indicate how many memory pages | 9 | Users of kcopyd must first create a client and indicate how many memory pages |
9 | to set aside for their copy jobs. This is done with a call to | 10 | to set aside for their copy jobs. This is done with a call to |
10 | kcopyd_client_create(). | 11 | kcopyd_client_create():: |
11 | 12 | ||
12 | int kcopyd_client_create(unsigned int num_pages, | 13 | int kcopyd_client_create(unsigned int num_pages, |
13 | struct kcopyd_client **result); | 14 | struct kcopyd_client **result); |
@@ -16,7 +17,7 @@ To start a copy job, the user must set up io_region structures to describe | |||
16 | the source and destinations of the copy. Each io_region indicates a | 17 | the source and destinations of the copy. Each io_region indicates a |
17 | block-device along with the starting sector and size of the region. The source | 18 | block-device along with the starting sector and size of the region. The source |
18 | of the copy is given as one io_region structure, and the destinations of the | 19 | of the copy is given as one io_region structure, and the destinations of the |
19 | copy are given as an array of io_region structures. | 20 | copy are given as an array of io_region structures:: |
20 | 21 | ||
21 | struct io_region { | 22 | struct io_region { |
22 | struct block_device *bdev; | 23 | struct block_device *bdev; |
@@ -26,7 +27,7 @@ copy are given as an array of io_region structures. | |||
26 | 27 | ||
27 | To start the copy, the user calls kcopyd_copy(), passing in the client | 28 | To start the copy, the user calls kcopyd_copy(), passing in the client |
28 | pointer, pointers to the source and destination io_regions, the name of a | 29 | pointer, pointers to the source and destination io_regions, the name of a |
29 | completion callback routine, and a pointer to some context data for the copy. | 30 | completion callback routine, and a pointer to some context data for the copy:: |
30 | 31 | ||
31 | int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from, | 32 | int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from, |
32 | unsigned int num_dests, struct io_region *dests, | 33 | unsigned int num_dests, struct io_region *dests, |
@@ -41,7 +42,6 @@ write error occurred during the copy. | |||
41 | 42 | ||
42 | When a user is done with all their copy jobs, they should call | 43 | When a user is done with all their copy jobs, they should call |
43 | kcopyd_client_destroy() to delete the kcopyd client, which will release the | 44 | kcopyd_client_destroy() to delete the kcopyd client, which will release the |
44 | associated memory pages. | 45 | associated memory pages:: |
45 | 46 | ||
46 | void kcopyd_client_destroy(struct kcopyd_client *kc); | 47 | void kcopyd_client_destroy(struct kcopyd_client *kc); |
47 | |||
diff --git a/Documentation/device-mapper/linear.rst b/Documentation/device-mapper/linear.rst new file mode 100644 index 000000000000..9d17fc6e64a9 --- /dev/null +++ b/Documentation/device-mapper/linear.rst | |||
@@ -0,0 +1,63 @@ | |||
1 | ========= | ||
2 | dm-linear | ||
3 | ========= | ||
4 | |||
5 | Device-Mapper's "linear" target maps a linear range of the Device-Mapper | ||
6 | device onto a linear range of another device. This is the basic building | ||
7 | block of logical volume managers. | ||
8 | |||
9 | Parameters: <dev path> <offset> | ||
10 | <dev path>: | ||
11 | Full pathname to the underlying block-device, or a | ||
12 | "major:minor" device-number. | ||
13 | <offset>: | ||
14 | Starting sector within the device. | ||
15 | |||
16 | |||
17 | Example scripts | ||
18 | =============== | ||
19 | |||
20 | :: | ||
21 | |||
22 | #!/bin/sh | ||
23 | # Create an identity mapping for a device | ||
24 | echo "0 `blockdev --getsz $1` linear $1 0" | dmsetup create identity | ||
25 | |||
26 | :: | ||
27 | |||
28 | #!/bin/sh | ||
29 | # Join 2 devices together | ||
30 | size1=`blockdev --getsz $1` | ||
31 | size2=`blockdev --getsz $2` | ||
32 | echo "0 $size1 linear $1 0 | ||
33 | $size1 $size2 linear $2 0" | dmsetup create joined | ||
34 | |||
35 | :: | ||
36 | |||
37 | #!/usr/bin/perl -w | ||
38 | # Split a device into 4M chunks and then join them together in reverse order. | ||
39 | |||
40 | my $name = "reverse"; | ||
41 | my $extent_size = 4 * 1024 * 2; | ||
42 | my $dev = $ARGV[0]; | ||
43 | my $table = ""; | ||
44 | my $count = 0; | ||
45 | |||
46 | if (!defined($dev)) { | ||
47 | die("Please specify a device.\n"); | ||
48 | } | ||
49 | |||
50 | my $dev_size = `blockdev --getsz $dev`; | ||
51 | my $extents = int($dev_size / $extent_size) - | ||
52 | (($dev_size % $extent_size) ? 1 : 0); | ||
53 | |||
54 | while ($extents > 0) { | ||
55 | my $this_start = $count * $extent_size; | ||
56 | $extents--; | ||
57 | $count++; | ||
58 | my $this_offset = $extents * $extent_size; | ||
59 | |||
60 | $table .= "$this_start $extent_size linear $dev $this_offset\n"; | ||
61 | } | ||
62 | |||
63 | `echo \"$table\" | dmsetup create $name`; | ||
diff --git a/Documentation/device-mapper/linear.txt b/Documentation/device-mapper/linear.txt deleted file mode 100644 index 7cb98d89d3f8..000000000000 --- a/Documentation/device-mapper/linear.txt +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | dm-linear | ||
2 | ========= | ||
3 | |||
4 | Device-Mapper's "linear" target maps a linear range of the Device-Mapper | ||
5 | device onto a linear range of another device. This is the basic building | ||
6 | block of logical volume managers. | ||
7 | |||
8 | Parameters: <dev path> <offset> | ||
9 | <dev path>: Full pathname to the underlying block-device, or a | ||
10 | "major:minor" device-number. | ||
11 | <offset>: Starting sector within the device. | ||
12 | |||
13 | |||
14 | Example scripts | ||
15 | =============== | ||
16 | [[ | ||
17 | #!/bin/sh | ||
18 | # Create an identity mapping for a device | ||
19 | echo "0 `blockdev --getsz $1` linear $1 0" | dmsetup create identity | ||
20 | ]] | ||
21 | |||
22 | |||
23 | [[ | ||
24 | #!/bin/sh | ||
25 | # Join 2 devices together | ||
26 | size1=`blockdev --getsz $1` | ||
27 | size2=`blockdev --getsz $2` | ||
28 | echo "0 $size1 linear $1 0 | ||
29 | $size1 $size2 linear $2 0" | dmsetup create joined | ||
30 | ]] | ||
31 | |||
32 | |||
33 | [[ | ||
34 | #!/usr/bin/perl -w | ||
35 | # Split a device into 4M chunks and then join them together in reverse order. | ||
36 | |||
37 | my $name = "reverse"; | ||
38 | my $extent_size = 4 * 1024 * 2; | ||
39 | my $dev = $ARGV[0]; | ||
40 | my $table = ""; | ||
41 | my $count = 0; | ||
42 | |||
43 | if (!defined($dev)) { | ||
44 | die("Please specify a device.\n"); | ||
45 | } | ||
46 | |||
47 | my $dev_size = `blockdev --getsz $dev`; | ||
48 | my $extents = int($dev_size / $extent_size) - | ||
49 | (($dev_size % $extent_size) ? 1 : 0); | ||
50 | |||
51 | while ($extents > 0) { | ||
52 | my $this_start = $count * $extent_size; | ||
53 | $extents--; | ||
54 | $count++; | ||
55 | my $this_offset = $extents * $extent_size; | ||
56 | |||
57 | $table .= "$this_start $extent_size linear $dev $this_offset\n"; | ||
58 | } | ||
59 | |||
60 | `echo \"$table\" | dmsetup create $name`; | ||
61 | ]] | ||
diff --git a/Documentation/device-mapper/log-writes.txt b/Documentation/device-mapper/log-writes.rst index b638d124be6a..23141f2ffb7c 100644 --- a/Documentation/device-mapper/log-writes.txt +++ b/Documentation/device-mapper/log-writes.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============= | ||
1 | dm-log-writes | 2 | dm-log-writes |
2 | ============= | 3 | ============= |
3 | 4 | ||
@@ -25,11 +26,11 @@ completed WRITEs, at the time the REQ_PREFLUSH is issued, are added in order to | |||
25 | simulate the worst case scenario with regard to power failures. Consider the | 26 | simulate the worst case scenario with regard to power failures. Consider the |
26 | following example (W means write, C means complete): | 27 | following example (W means write, C means complete): |
27 | 28 | ||
28 | W1,W2,W3,C3,C2,Wflush,C1,Cflush | 29 | W1,W2,W3,C3,C2,Wflush,C1,Cflush |
29 | 30 | ||
30 | The log would show the following | 31 | The log would show the following: |
31 | 32 | ||
32 | W3,W2,flush,W1.... | 33 | W3,W2,flush,W1.... |
33 | 34 | ||
34 | Again this is to simulate what is actually on disk, this allows us to detect | 35 | Again this is to simulate what is actually on disk, this allows us to detect |
35 | cases where a power failure at a particular point in time would create an | 36 | cases where a power failure at a particular point in time would create an |
@@ -42,11 +43,11 @@ Any REQ_OP_DISCARD requests are treated like WRITE requests. Otherwise we would | |||
42 | have all the DISCARD requests, and then the WRITE requests and then the FLUSH | 43 | have all the DISCARD requests, and then the WRITE requests and then the FLUSH |
43 | request. Consider the following example: | 44 | request. Consider the following example: |
44 | 45 | ||
45 | WRITE block 1, DISCARD block 1, FLUSH | 46 | WRITE block 1, DISCARD block 1, FLUSH |
46 | 47 | ||
47 | If we logged DISCARD when it completed, the replay would look like this | 48 | If we logged DISCARD when it completed, the replay would look like this: |
48 | 49 | ||
49 | DISCARD 1, WRITE 1, FLUSH | 50 | DISCARD 1, WRITE 1, FLUSH |
50 | 51 | ||
51 | which isn't quite what happened and wouldn't be caught during the log replay. | 52 | which isn't quite what happened and wouldn't be caught during the log replay. |
52 | 53 | ||
@@ -57,15 +58,19 @@ i) Constructor | |||
57 | 58 | ||
58 | log-writes <dev_path> <log_dev_path> | 59 | log-writes <dev_path> <log_dev_path> |
59 | 60 | ||
60 | dev_path : Device that all of the IO will go to normally. | 61 | ============= ============================================== |
61 | log_dev_path : Device where the log entries are written to. | 62 | dev_path Device that all of the IO will go to normally. |
63 | log_dev_path Device where the log entries are written to. | ||
64 | ============= ============================================== | ||
62 | 65 | ||
63 | ii) Status | 66 | ii) Status |
64 | 67 | ||
65 | <#logged entries> <highest allocated sector> | 68 | <#logged entries> <highest allocated sector> |
66 | 69 | ||
67 | #logged entries : Number of logged entries | 70 | =========================== ======================== |
68 | highest allocated sector : Highest allocated sector | 71 | #logged entries Number of logged entries |
72 | highest allocated sector Highest allocated sector | ||
73 | =========================== ======================== | ||
69 | 74 | ||
70 | iii) Messages | 75 | iii) Messages |
71 | 76 | ||
@@ -75,15 +80,15 @@ iii) Messages | |||
75 | For example say you want to fsck a file system after every | 80 | For example say you want to fsck a file system after every |
76 | write, but first you need to replay up to the mkfs to make sure | 81 | write, but first you need to replay up to the mkfs to make sure |
77 | we're fsck'ing something reasonable, you would do something like | 82 | we're fsck'ing something reasonable, you would do something like |
78 | this: | 83 | this:: |
79 | 84 | ||
80 | mkfs.btrfs -f /dev/mapper/log | 85 | mkfs.btrfs -f /dev/mapper/log |
81 | dmsetup message log 0 mark mkfs | 86 | dmsetup message log 0 mark mkfs |
82 | <run test> | 87 | <run test> |
83 | 88 | ||
84 | This would allow you to replay the log up to the mkfs mark and | 89 | This would allow you to replay the log up to the mkfs mark and |
85 | then replay from that point on doing the fsck check in the | 90 | then replay from that point on doing the fsck check in the |
86 | interval that you want. | 91 | interval that you want. |
87 | 92 | ||
88 | Every log has a mark at the end labeled "dm-log-writes-end". | 93 | Every log has a mark at the end labeled "dm-log-writes-end". |
89 | 94 | ||
@@ -97,42 +102,42 @@ Example usage | |||
97 | ============= | 102 | ============= |
98 | 103 | ||
99 | Say you want to test fsync on your file system. You would do something like | 104 | Say you want to test fsync on your file system. You would do something like |
100 | this: | 105 | this:: |
101 | 106 | ||
102 | TABLE="0 $(blockdev --getsz /dev/sdb) log-writes /dev/sdb /dev/sdc" | 107 | TABLE="0 $(blockdev --getsz /dev/sdb) log-writes /dev/sdb /dev/sdc" |
103 | dmsetup create log --table "$TABLE" | 108 | dmsetup create log --table "$TABLE" |
104 | mkfs.btrfs -f /dev/mapper/log | 109 | mkfs.btrfs -f /dev/mapper/log |
105 | dmsetup message log 0 mark mkfs | 110 | dmsetup message log 0 mark mkfs |
106 | 111 | ||
107 | mount /dev/mapper/log /mnt/btrfs-test | 112 | mount /dev/mapper/log /mnt/btrfs-test |
108 | <some test that does fsync at the end> | 113 | <some test that does fsync at the end> |
109 | dmsetup message log 0 mark fsync | 114 | dmsetup message log 0 mark fsync |
110 | md5sum /mnt/btrfs-test/foo | 115 | md5sum /mnt/btrfs-test/foo |
111 | umount /mnt/btrfs-test | 116 | umount /mnt/btrfs-test |
112 | 117 | ||
113 | dmsetup remove log | 118 | dmsetup remove log |
114 | replay-log --log /dev/sdc --replay /dev/sdb --end-mark fsync | 119 | replay-log --log /dev/sdc --replay /dev/sdb --end-mark fsync |
115 | mount /dev/sdb /mnt/btrfs-test | 120 | mount /dev/sdb /mnt/btrfs-test |
116 | md5sum /mnt/btrfs-test/foo | 121 | md5sum /mnt/btrfs-test/foo |
117 | <verify md5sum's are correct> | 122 | <verify md5sum's are correct> |
118 | 123 | ||
119 | Another option is to do a complicated file system operation and verify the file | 124 | Another option is to do a complicated file system operation and verify the file |
120 | system is consistent during the entire operation. You could do this with: | 125 | system is consistent during the entire operation. You could do this with: |
121 | 126 | ||
122 | TABLE="0 $(blockdev --getsz /dev/sdb) log-writes /dev/sdb /dev/sdc" | 127 | TABLE="0 $(blockdev --getsz /dev/sdb) log-writes /dev/sdb /dev/sdc" |
123 | dmsetup create log --table "$TABLE" | 128 | dmsetup create log --table "$TABLE" |
124 | mkfs.btrfs -f /dev/mapper/log | 129 | mkfs.btrfs -f /dev/mapper/log |
125 | dmsetup message log 0 mark mkfs | 130 | dmsetup message log 0 mark mkfs |
126 | 131 | ||
127 | mount /dev/mapper/log /mnt/btrfs-test | 132 | mount /dev/mapper/log /mnt/btrfs-test |
128 | <fsstress to dirty the fs> | 133 | <fsstress to dirty the fs> |
129 | btrfs filesystem balance /mnt/btrfs-test | 134 | btrfs filesystem balance /mnt/btrfs-test |
130 | umount /mnt/btrfs-test | 135 | umount /mnt/btrfs-test |
131 | dmsetup remove log | 136 | dmsetup remove log |
132 | 137 | ||
133 | replay-log --log /dev/sdc --replay /dev/sdb --end-mark mkfs | 138 | replay-log --log /dev/sdc --replay /dev/sdb --end-mark mkfs |
134 | btrfsck /dev/sdb | 139 | btrfsck /dev/sdb |
135 | replay-log --log /dev/sdc --replay /dev/sdb --start-mark mkfs \ | 140 | replay-log --log /dev/sdc --replay /dev/sdb --start-mark mkfs \ |
136 | --fsck "btrfsck /dev/sdb" --check fua | 141 | --fsck "btrfsck /dev/sdb" --check fua |
137 | 142 | ||
138 | And that will replay the log until it sees a FUA request, run the fsck command | 143 | And that will replay the log until it sees a FUA request, run the fsck command |
diff --git a/Documentation/device-mapper/persistent-data.txt b/Documentation/device-mapper/persistent-data.rst index a333bcb3a6c2..2065c3c5a091 100644 --- a/Documentation/device-mapper/persistent-data.txt +++ b/Documentation/device-mapper/persistent-data.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | =============== | ||
2 | Persistent data | ||
3 | =============== | ||
4 | |||
1 | Introduction | 5 | Introduction |
2 | ============ | 6 | ============ |
3 | 7 | ||
diff --git a/Documentation/device-mapper/snapshot.txt b/Documentation/device-mapper/snapshot.rst index b8bbb516f989..4c53304e72f1 100644 --- a/Documentation/device-mapper/snapshot.txt +++ b/Documentation/device-mapper/snapshot.rst | |||
@@ -1,15 +1,16 @@ | |||
1 | ============================== | ||
1 | Device-mapper snapshot support | 2 | Device-mapper snapshot support |
2 | ============================== | 3 | ============================== |
3 | 4 | ||
4 | Device-mapper allows you, without massive data copying: | 5 | Device-mapper allows you, without massive data copying: |
5 | 6 | ||
6 | *) To create snapshots of any block device i.e. mountable, saved states of | 7 | - To create snapshots of any block device i.e. mountable, saved states of |
7 | the block device which are also writable without interfering with the | 8 | the block device which are also writable without interfering with the |
8 | original content; | 9 | original content; |
9 | *) To create device "forks", i.e. multiple different versions of the | 10 | - To create device "forks", i.e. multiple different versions of the |
10 | same data stream. | 11 | same data stream. |
11 | *) To merge a snapshot of a block device back into the snapshot's origin | 12 | - To merge a snapshot of a block device back into the snapshot's origin |
12 | device. | 13 | device. |
13 | 14 | ||
14 | In the first two cases, dm copies only the chunks of data that get | 15 | In the first two cases, dm copies only the chunks of data that get |
15 | changed and uses a separate copy-on-write (COW) block device for | 16 | changed and uses a separate copy-on-write (COW) block device for |
@@ -22,7 +23,7 @@ the origin device. | |||
22 | There are three dm targets available: | 23 | There are three dm targets available: |
23 | snapshot, snapshot-origin, and snapshot-merge. | 24 | snapshot, snapshot-origin, and snapshot-merge. |
24 | 25 | ||
25 | *) snapshot-origin <origin> | 26 | - snapshot-origin <origin> |
26 | 27 | ||
27 | which will normally have one or more snapshots based on it. | 28 | which will normally have one or more snapshots based on it. |
28 | Reads will be mapped directly to the backing device. For each write, the | 29 | Reads will be mapped directly to the backing device. For each write, the |
@@ -30,7 +31,7 @@ original data will be saved in the <COW device> of each snapshot to keep | |||
30 | its visible content unchanged, at least until the <COW device> fills up. | 31 | its visible content unchanged, at least until the <COW device> fills up. |
31 | 32 | ||
32 | 33 | ||
33 | *) snapshot <origin> <COW device> <persistent?> <chunksize> | 34 | - snapshot <origin> <COW device> <persistent?> <chunksize> |
34 | 35 | ||
35 | A snapshot of the <origin> block device is created. Changed chunks of | 36 | A snapshot of the <origin> block device is created. Changed chunks of |
36 | <chunksize> sectors will be stored on the <COW device>. Writes will | 37 | <chunksize> sectors will be stored on the <COW device>. Writes will |
@@ -83,25 +84,25 @@ When you create the first LVM2 snapshot of a volume, four dm devices are used: | |||
83 | source volume), whose table is replaced by a "snapshot-origin" mapping | 84 | source volume), whose table is replaced by a "snapshot-origin" mapping |
84 | from device #1. | 85 | from device #1. |
85 | 86 | ||
86 | A fixed naming scheme is used, so with the following commands: | 87 | A fixed naming scheme is used, so with the following commands:: |
87 | 88 | ||
88 | lvcreate -L 1G -n base volumeGroup | 89 | lvcreate -L 1G -n base volumeGroup |
89 | lvcreate -L 100M --snapshot -n snap volumeGroup/base | 90 | lvcreate -L 100M --snapshot -n snap volumeGroup/base |
90 | 91 | ||
91 | we'll have this situation (with volumes in above order): | 92 | we'll have this situation (with volumes in above order):: |
92 | 93 | ||
93 | # dmsetup table|grep volumeGroup | 94 | # dmsetup table|grep volumeGroup |
94 | 95 | ||
95 | volumeGroup-base-real: 0 2097152 linear 8:19 384 | 96 | volumeGroup-base-real: 0 2097152 linear 8:19 384 |
96 | volumeGroup-snap-cow: 0 204800 linear 8:19 2097536 | 97 | volumeGroup-snap-cow: 0 204800 linear 8:19 2097536 |
97 | volumeGroup-snap: 0 2097152 snapshot 254:11 254:12 P 16 | 98 | volumeGroup-snap: 0 2097152 snapshot 254:11 254:12 P 16 |
98 | volumeGroup-base: 0 2097152 snapshot-origin 254:11 | 99 | volumeGroup-base: 0 2097152 snapshot-origin 254:11 |
99 | 100 | ||
100 | # ls -lL /dev/mapper/volumeGroup-* | 101 | # ls -lL /dev/mapper/volumeGroup-* |
101 | brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real | 102 | brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real |
102 | brw------- 1 root root 254, 12 29 ago 18:15 /dev/mapper/volumeGroup-snap-cow | 103 | brw------- 1 root root 254, 12 29 ago 18:15 /dev/mapper/volumeGroup-snap-cow |
103 | brw------- 1 root root 254, 13 29 ago 18:15 /dev/mapper/volumeGroup-snap | 104 | brw------- 1 root root 254, 13 29 ago 18:15 /dev/mapper/volumeGroup-snap |
104 | brw------- 1 root root 254, 10 29 ago 18:14 /dev/mapper/volumeGroup-base | 105 | brw------- 1 root root 254, 10 29 ago 18:14 /dev/mapper/volumeGroup-base |
105 | 106 | ||
106 | 107 | ||
107 | How snapshot-merge is used by LVM2 | 108 | How snapshot-merge is used by LVM2 |
@@ -114,27 +115,28 @@ merging snapshot after it completes. The "snapshot" that hands over its | |||
114 | COW device to the "snapshot-merge" is deactivated (unless using lvchange | 115 | COW device to the "snapshot-merge" is deactivated (unless using lvchange |
115 | --refresh); but if it is left active it will simply return I/O errors. | 116 | --refresh); but if it is left active it will simply return I/O errors. |
116 | 117 | ||
117 | A snapshot will merge into its origin with the following command: | 118 | A snapshot will merge into its origin with the following command:: |
118 | 119 | ||
119 | lvconvert --merge volumeGroup/snap | 120 | lvconvert --merge volumeGroup/snap |
120 | 121 | ||
121 | we'll now have this situation: | 122 | we'll now have this situation:: |
122 | 123 | ||
123 | # dmsetup table|grep volumeGroup | 124 | # dmsetup table|grep volumeGroup |
124 | 125 | ||
125 | volumeGroup-base-real: 0 2097152 linear 8:19 384 | 126 | volumeGroup-base-real: 0 2097152 linear 8:19 384 |
126 | volumeGroup-base-cow: 0 204800 linear 8:19 2097536 | 127 | volumeGroup-base-cow: 0 204800 linear 8:19 2097536 |
127 | volumeGroup-base: 0 2097152 snapshot-merge 254:11 254:12 P 16 | 128 | volumeGroup-base: 0 2097152 snapshot-merge 254:11 254:12 P 16 |
128 | 129 | ||
129 | # ls -lL /dev/mapper/volumeGroup-* | 130 | # ls -lL /dev/mapper/volumeGroup-* |
130 | brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real | 131 | brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real |
131 | brw------- 1 root root 254, 12 29 ago 18:16 /dev/mapper/volumeGroup-base-cow | 132 | brw------- 1 root root 254, 12 29 ago 18:16 /dev/mapper/volumeGroup-base-cow |
132 | brw------- 1 root root 254, 10 29 ago 18:16 /dev/mapper/volumeGroup-base | 133 | brw------- 1 root root 254, 10 29 ago 18:16 /dev/mapper/volumeGroup-base |
133 | 134 | ||
134 | 135 | ||
135 | How to determine when a merging is complete | 136 | How to determine when a merging is complete |
136 | =========================================== | 137 | =========================================== |
137 | The snapshot-merge and snapshot status lines end with: | 138 | The snapshot-merge and snapshot status lines end with: |
139 | |||
138 | <sectors_allocated>/<total_sectors> <metadata_sectors> | 140 | <sectors_allocated>/<total_sectors> <metadata_sectors> |
139 | 141 | ||
140 | Both <sectors_allocated> and <total_sectors> include both data and metadata. | 142 | Both <sectors_allocated> and <total_sectors> include both data and metadata. |
@@ -142,35 +144,37 @@ During merging, the number of sectors allocated gets smaller and | |||
142 | smaller. Merging has finished when the number of sectors holding data | 144 | smaller. Merging has finished when the number of sectors holding data |
143 | is zero, in other words <sectors_allocated> == <metadata_sectors>. | 145 | is zero, in other words <sectors_allocated> == <metadata_sectors>. |
144 | 146 | ||
145 | Here is a practical example (using a hybrid of lvm and dmsetup commands): | 147 | Here is a practical example (using a hybrid of lvm and dmsetup commands):: |
146 | 148 | ||
147 | # lvs | 149 | # lvs |
148 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | 150 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert |
149 | base volumeGroup owi-a- 4.00g | 151 | base volumeGroup owi-a- 4.00g |
150 | snap volumeGroup swi-a- 1.00g base 18.97 | 152 | snap volumeGroup swi-a- 1.00g base 18.97 |
151 | 153 | ||
152 | # dmsetup status volumeGroup-snap | 154 | # dmsetup status volumeGroup-snap |
153 | 0 8388608 snapshot 397896/2097152 1560 | 155 | 0 8388608 snapshot 397896/2097152 1560 |
154 | ^^^^ metadata sectors | 156 | ^^^^ metadata sectors |
155 | 157 | ||
156 | # lvconvert --merge -b volumeGroup/snap | 158 | # lvconvert --merge -b volumeGroup/snap |
157 | Merging of volume snap started. | 159 | Merging of volume snap started. |
158 | 160 | ||
159 | # lvs volumeGroup/snap | 161 | # lvs volumeGroup/snap |
160 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | 162 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert |
161 | base volumeGroup Owi-a- 4.00g 17.23 | 163 | base volumeGroup Owi-a- 4.00g 17.23 |
162 | 164 | ||
163 | # dmsetup status volumeGroup-base | 165 | # dmsetup status volumeGroup-base |
164 | 0 8388608 snapshot-merge 281688/2097152 1104 | 166 | 0 8388608 snapshot-merge 281688/2097152 1104 |
165 | 167 | ||
166 | # dmsetup status volumeGroup-base | 168 | # dmsetup status volumeGroup-base |
167 | 0 8388608 snapshot-merge 180480/2097152 712 | 169 | 0 8388608 snapshot-merge 180480/2097152 712 |
168 | 170 | ||
169 | # dmsetup status volumeGroup-base | 171 | # dmsetup status volumeGroup-base |
170 | 0 8388608 snapshot-merge 16/2097152 16 | 172 | 0 8388608 snapshot-merge 16/2097152 16 |
171 | 173 | ||
172 | Merging has finished. | 174 | Merging has finished. |
173 | 175 | ||
174 | # lvs | 176 | :: |
175 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | 177 | |
176 | base volumeGroup owi-a- 4.00g | 178 | # lvs |
179 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | ||
180 | base volumeGroup owi-a- 4.00g | ||
diff --git a/Documentation/device-mapper/statistics.txt b/Documentation/device-mapper/statistics.rst index 170ac02a1f50..3d80a9f850cc 100644 --- a/Documentation/device-mapper/statistics.txt +++ b/Documentation/device-mapper/statistics.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============= | ||
1 | DM statistics | 2 | DM statistics |
2 | ============= | 3 | ============= |
3 | 4 | ||
@@ -11,7 +12,7 @@ Individual statistics will be collected for each step-sized area within | |||
11 | the range specified. | 12 | the range specified. |
12 | 13 | ||
13 | The I/O statistics counters for each step-sized area of a region are | 14 | The I/O statistics counters for each step-sized area of a region are |
14 | in the same format as /sys/block/*/stat or /proc/diskstats (see: | 15 | in the same format as `/sys/block/*/stat` or `/proc/diskstats` (see: |
15 | Documentation/iostats.txt). But two extra counters (12 and 13) are | 16 | Documentation/iostats.txt). But two extra counters (12 and 13) are |
16 | provided: total time spent reading and writing. When the histogram | 17 | provided: total time spent reading and writing. When the histogram |
17 | argument is used, the 14th parameter is reported that represents the | 18 | argument is used, the 14th parameter is reported that represents the |
@@ -32,40 +33,45 @@ on each other's data. | |||
32 | The creation of DM statistics will allocate memory via kmalloc or | 33 | The creation of DM statistics will allocate memory via kmalloc or |
33 | fallback to using vmalloc space. At most, 1/4 of the overall system | 34 | fallback to using vmalloc space. At most, 1/4 of the overall system |
34 | memory may be allocated by DM statistics. The admin can see how much | 35 | memory may be allocated by DM statistics. The admin can see how much |
35 | memory is used by reading | 36 | memory is used by reading: |
36 | /sys/module/dm_mod/parameters/stats_current_allocated_bytes | 37 | |
38 | /sys/module/dm_mod/parameters/stats_current_allocated_bytes | ||
37 | 39 | ||
38 | Messages | 40 | Messages |
39 | ======== | 41 | ======== |
40 | 42 | ||
41 | @stats_create <range> <step> | 43 | @stats_create <range> <step> [<number_of_optional_arguments> <optional_arguments>...] [<program_id> [<aux_data>]] |
42 | [<number_of_optional_arguments> <optional_arguments>...] | ||
43 | [<program_id> [<aux_data>]] | ||
44 | |||
45 | Create a new region and return the region_id. | 44 | Create a new region and return the region_id. |
46 | 45 | ||
47 | <range> | 46 | <range> |
48 | "-" - whole device | 47 | "-" |
49 | "<start_sector>+<length>" - a range of <length> 512-byte sectors | 48 | whole device |
50 | starting with <start_sector>. | 49 | "<start_sector>+<length>" |
50 | a range of <length> 512-byte sectors | ||
51 | starting with <start_sector>. | ||
51 | 52 | ||
52 | <step> | 53 | <step> |
53 | "<area_size>" - the range is subdivided into areas each containing | 54 | "<area_size>" |
54 | <area_size> sectors. | 55 | the range is subdivided into areas each containing |
55 | "/<number_of_areas>" - the range is subdivided into the specified | 56 | <area_size> sectors. |
56 | number of areas. | 57 | "/<number_of_areas>" |
58 | the range is subdivided into the specified | ||
59 | number of areas. | ||
57 | 60 | ||
58 | <number_of_optional_arguments> | 61 | <number_of_optional_arguments> |
59 | The number of optional arguments | 62 | The number of optional arguments |
60 | 63 | ||
61 | <optional_arguments> | 64 | <optional_arguments> |
62 | The following optional arguments are supported | 65 | The following optional arguments are supported: |
63 | precise_timestamps - use precise timer with nanosecond resolution | 66 | |
67 | precise_timestamps | ||
68 | use precise timer with nanosecond resolution | ||
64 | instead of the "jiffies" variable. When this argument is | 69 | instead of the "jiffies" variable. When this argument is |
65 | used, the resulting times are in nanoseconds instead of | 70 | used, the resulting times are in nanoseconds instead of |
66 | milliseconds. Precise timestamps are a little bit slower | 71 | milliseconds. Precise timestamps are a little bit slower |
67 | to obtain than jiffies-based timestamps. | 72 | to obtain than jiffies-based timestamps. |
68 | histogram:n1,n2,n3,n4,... - collect histogram of latencies. The | 73 | histogram:n1,n2,n3,n4,... |
74 | collect histogram of latencies. The | ||
69 | numbers n1, n2, etc are times that represent the boundaries | 75 | numbers n1, n2, etc are times that represent the boundaries |
70 | of the histogram. If precise_timestamps is not used, the | 76 | of the histogram. If precise_timestamps is not used, the |
71 | times are in milliseconds, otherwise they are in | 77 | times are in milliseconds, otherwise they are in |
@@ -96,21 +102,18 @@ Messages | |||
96 | @stats_list message, but it doesn't use this value for anything. | 102 | @stats_list message, but it doesn't use this value for anything. |
97 | 103 | ||
98 | @stats_delete <region_id> | 104 | @stats_delete <region_id> |
99 | |||
100 | Delete the region with the specified id. | 105 | Delete the region with the specified id. |
101 | 106 | ||
102 | <region_id> | 107 | <region_id> |
103 | region_id returned from @stats_create | 108 | region_id returned from @stats_create |
104 | 109 | ||
105 | @stats_clear <region_id> | 110 | @stats_clear <region_id> |
106 | |||
107 | Clear all the counters except the in-flight i/o counters. | 111 | Clear all the counters except the in-flight i/o counters. |
108 | 112 | ||
109 | <region_id> | 113 | <region_id> |
110 | region_id returned from @stats_create | 114 | region_id returned from @stats_create |
111 | 115 | ||
112 | @stats_list [<program_id>] | 116 | @stats_list [<program_id>] |
113 | |||
114 | List all regions registered with @stats_create. | 117 | List all regions registered with @stats_create. |
115 | 118 | ||
116 | <program_id> | 119 | <program_id> |
@@ -127,7 +130,6 @@ Messages | |||
127 | if they were specified when creating the region. | 130 | if they were specified when creating the region. |
128 | 131 | ||
129 | @stats_print <region_id> [<starting_line> <number_of_lines>] | 132 | @stats_print <region_id> [<starting_line> <number_of_lines>] |
130 | |||
131 | Print counters for each step-sized area of a region. | 133 | Print counters for each step-sized area of a region. |
132 | 134 | ||
133 | <region_id> | 135 | <region_id> |
@@ -143,10 +145,11 @@ Messages | |||
143 | 145 | ||
144 | Output format for each step-sized area of a region: | 146 | Output format for each step-sized area of a region: |
145 | 147 | ||
146 | <start_sector>+<length> counters | 148 | <start_sector>+<length> |
149 | counters | ||
147 | 150 | ||
148 | The first 11 counters have the same meaning as | 151 | The first 11 counters have the same meaning as |
149 | /sys/block/*/stat or /proc/diskstats. | 152 | `/sys/block/*/stat or /proc/diskstats`. |
150 | 153 | ||
151 | Please refer to Documentation/iostats.txt for details. | 154 | Please refer to Documentation/iostats.txt for details. |
152 | 155 | ||
@@ -163,11 +166,11 @@ Messages | |||
163 | 11. the weighted number of milliseconds spent doing I/Os | 166 | 11. the weighted number of milliseconds spent doing I/Os |
164 | 167 | ||
165 | Additional counters: | 168 | Additional counters: |
169 | |||
166 | 12. the total time spent reading in milliseconds | 170 | 12. the total time spent reading in milliseconds |
167 | 13. the total time spent writing in milliseconds | 171 | 13. the total time spent writing in milliseconds |
168 | 172 | ||
169 | @stats_print_clear <region_id> [<starting_line> <number_of_lines>] | 173 | @stats_print_clear <region_id> [<starting_line> <number_of_lines>] |
170 | |||
171 | Atomically print and then clear all the counters except the | 174 | Atomically print and then clear all the counters except the |
172 | in-flight i/o counters. Useful when the client consuming the | 175 | in-flight i/o counters. Useful when the client consuming the |
173 | statistics does not want to lose any statistics (those updated | 176 | statistics does not want to lose any statistics (those updated |
@@ -185,7 +188,6 @@ Messages | |||
185 | If omitted, all lines are printed and then cleared. | 188 | If omitted, all lines are printed and then cleared. |
186 | 189 | ||
187 | @stats_set_aux <region_id> <aux_data> | 190 | @stats_set_aux <region_id> <aux_data> |
188 | |||
189 | Store auxiliary data aux_data for the specified region. | 191 | Store auxiliary data aux_data for the specified region. |
190 | 192 | ||
191 | <region_id> | 193 | <region_id> |
@@ -201,23 +203,23 @@ Examples | |||
201 | ======== | 203 | ======== |
202 | 204 | ||
203 | Subdivide the DM device 'vol' into 100 pieces and start collecting | 205 | Subdivide the DM device 'vol' into 100 pieces and start collecting |
204 | statistics on them: | 206 | statistics on them:: |
205 | 207 | ||
206 | dmsetup message vol 0 @stats_create - /100 | 208 | dmsetup message vol 0 @stats_create - /100 |
207 | 209 | ||
208 | Set the auxiliary data string to "foo bar baz" (the escape for each | 210 | Set the auxiliary data string to "foo bar baz" (the escape for each |
209 | space must also be escaped, otherwise the shell will consume them): | 211 | space must also be escaped, otherwise the shell will consume them):: |
210 | 212 | ||
211 | dmsetup message vol 0 @stats_set_aux 0 foo\\ bar\\ baz | 213 | dmsetup message vol 0 @stats_set_aux 0 foo\\ bar\\ baz |
212 | 214 | ||
213 | List the statistics: | 215 | List the statistics:: |
214 | 216 | ||
215 | dmsetup message vol 0 @stats_list | 217 | dmsetup message vol 0 @stats_list |
216 | 218 | ||
217 | Print the statistics: | 219 | Print the statistics:: |
218 | 220 | ||
219 | dmsetup message vol 0 @stats_print 0 | 221 | dmsetup message vol 0 @stats_print 0 |
220 | 222 | ||
221 | Delete the statistics: | 223 | Delete the statistics:: |
222 | 224 | ||
223 | dmsetup message vol 0 @stats_delete 0 | 225 | dmsetup message vol 0 @stats_delete 0 |
diff --git a/Documentation/device-mapper/striped.rst b/Documentation/device-mapper/striped.rst new file mode 100644 index 000000000000..e9a8da192ae1 --- /dev/null +++ b/Documentation/device-mapper/striped.rst | |||
@@ -0,0 +1,61 @@ | |||
1 | ========= | ||
2 | dm-stripe | ||
3 | ========= | ||
4 | |||
5 | Device-Mapper's "striped" target is used to create a striped (i.e. RAID-0) | ||
6 | device across one or more underlying devices. Data is written in "chunks", | ||
7 | with consecutive chunks rotating among the underlying devices. This can | ||
8 | potentially provide improved I/O throughput by utilizing several physical | ||
9 | devices in parallel. | ||
10 | |||
11 | Parameters: <num devs> <chunk size> [<dev path> <offset>]+ | ||
12 | <num devs>: | ||
13 | Number of underlying devices. | ||
14 | <chunk size>: | ||
15 | Size of each chunk of data. Must be at least as | ||
16 | large as the system's PAGE_SIZE. | ||
17 | <dev path>: | ||
18 | Full pathname to the underlying block-device, or a | ||
19 | "major:minor" device-number. | ||
20 | <offset>: | ||
21 | Starting sector within the device. | ||
22 | |||
23 | One or more underlying devices can be specified. The striped device size must | ||
24 | be a multiple of the chunk size multiplied by the number of underlying devices. | ||
25 | |||
26 | |||
27 | Example scripts | ||
28 | =============== | ||
29 | |||
30 | :: | ||
31 | |||
32 | #!/usr/bin/perl -w | ||
33 | # Create a striped device across any number of underlying devices. The device | ||
34 | # will be called "stripe_dev" and have a chunk-size of 128k. | ||
35 | |||
36 | my $chunk_size = 128 * 2; | ||
37 | my $dev_name = "stripe_dev"; | ||
38 | my $num_devs = @ARGV; | ||
39 | my @devs = @ARGV; | ||
40 | my ($min_dev_size, $stripe_dev_size, $i); | ||
41 | |||
42 | if (!$num_devs) { | ||
43 | die("Specify at least one device\n"); | ||
44 | } | ||
45 | |||
46 | $min_dev_size = `blockdev --getsz $devs[0]`; | ||
47 | for ($i = 1; $i < $num_devs; $i++) { | ||
48 | my $this_size = `blockdev --getsz $devs[$i]`; | ||
49 | $min_dev_size = ($min_dev_size < $this_size) ? | ||
50 | $min_dev_size : $this_size; | ||
51 | } | ||
52 | |||
53 | $stripe_dev_size = $min_dev_size * $num_devs; | ||
54 | $stripe_dev_size -= $stripe_dev_size % ($chunk_size * $num_devs); | ||
55 | |||
56 | $table = "0 $stripe_dev_size striped $num_devs $chunk_size"; | ||
57 | for ($i = 0; $i < $num_devs; $i++) { | ||
58 | $table .= " $devs[$i] 0"; | ||
59 | } | ||
60 | |||
61 | `echo $table | dmsetup create $dev_name`; | ||
diff --git a/Documentation/device-mapper/striped.txt b/Documentation/device-mapper/striped.txt deleted file mode 100644 index 07ec492cceee..000000000000 --- a/Documentation/device-mapper/striped.txt +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | dm-stripe | ||
2 | ========= | ||
3 | |||
4 | Device-Mapper's "striped" target is used to create a striped (i.e. RAID-0) | ||
5 | device across one or more underlying devices. Data is written in "chunks", | ||
6 | with consecutive chunks rotating among the underlying devices. This can | ||
7 | potentially provide improved I/O throughput by utilizing several physical | ||
8 | devices in parallel. | ||
9 | |||
10 | Parameters: <num devs> <chunk size> [<dev path> <offset>]+ | ||
11 | <num devs>: Number of underlying devices. | ||
12 | <chunk size>: Size of each chunk of data. Must be at least as | ||
13 | large as the system's PAGE_SIZE. | ||
14 | <dev path>: Full pathname to the underlying block-device, or a | ||
15 | "major:minor" device-number. | ||
16 | <offset>: Starting sector within the device. | ||
17 | |||
18 | One or more underlying devices can be specified. The striped device size must | ||
19 | be a multiple of the chunk size multiplied by the number of underlying devices. | ||
20 | |||
21 | |||
22 | Example scripts | ||
23 | =============== | ||
24 | |||
25 | [[ | ||
26 | #!/usr/bin/perl -w | ||
27 | # Create a striped device across any number of underlying devices. The device | ||
28 | # will be called "stripe_dev" and have a chunk-size of 128k. | ||
29 | |||
30 | my $chunk_size = 128 * 2; | ||
31 | my $dev_name = "stripe_dev"; | ||
32 | my $num_devs = @ARGV; | ||
33 | my @devs = @ARGV; | ||
34 | my ($min_dev_size, $stripe_dev_size, $i); | ||
35 | |||
36 | if (!$num_devs) { | ||
37 | die("Specify at least one device\n"); | ||
38 | } | ||
39 | |||
40 | $min_dev_size = `blockdev --getsz $devs[0]`; | ||
41 | for ($i = 1; $i < $num_devs; $i++) { | ||
42 | my $this_size = `blockdev --getsz $devs[$i]`; | ||
43 | $min_dev_size = ($min_dev_size < $this_size) ? | ||
44 | $min_dev_size : $this_size; | ||
45 | } | ||
46 | |||
47 | $stripe_dev_size = $min_dev_size * $num_devs; | ||
48 | $stripe_dev_size -= $stripe_dev_size % ($chunk_size * $num_devs); | ||
49 | |||
50 | $table = "0 $stripe_dev_size striped $num_devs $chunk_size"; | ||
51 | for ($i = 0; $i < $num_devs; $i++) { | ||
52 | $table .= " $devs[$i] 0"; | ||
53 | } | ||
54 | |||
55 | `echo $table | dmsetup create $dev_name`; | ||
56 | ]] | ||
57 | |||
diff --git a/Documentation/device-mapper/switch.txt b/Documentation/device-mapper/switch.rst index 5bd4831db4a8..7dde06be1a4f 100644 --- a/Documentation/device-mapper/switch.txt +++ b/Documentation/device-mapper/switch.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ========= | ||
1 | dm-switch | 2 | dm-switch |
2 | ========= | 3 | ========= |
3 | 4 | ||
@@ -67,27 +68,25 @@ b-tree can achieve. | |||
67 | Construction Parameters | 68 | Construction Parameters |
68 | ======================= | 69 | ======================= |
69 | 70 | ||
70 | <num_paths> <region_size> <num_optional_args> [<optional_args>...] | 71 | <num_paths> <region_size> <num_optional_args> [<optional_args>...] [<dev_path> <offset>]+ |
71 | [<dev_path> <offset>]+ | 72 | <num_paths> |
72 | 73 | The number of paths across which to distribute the I/O. | |
73 | <num_paths> | ||
74 | The number of paths across which to distribute the I/O. | ||
75 | 74 | ||
76 | <region_size> | 75 | <region_size> |
77 | The number of 512-byte sectors in a region. Each region can be redirected | 76 | The number of 512-byte sectors in a region. Each region can be redirected |
78 | to any of the available paths. | 77 | to any of the available paths. |
79 | 78 | ||
80 | <num_optional_args> | 79 | <num_optional_args> |
81 | The number of optional arguments. Currently, no optional arguments | 80 | The number of optional arguments. Currently, no optional arguments |
82 | are supported and so this must be zero. | 81 | are supported and so this must be zero. |
83 | 82 | ||
84 | <dev_path> | 83 | <dev_path> |
85 | The block device that represents a specific path to the device. | 84 | The block device that represents a specific path to the device. |
86 | 85 | ||
87 | <offset> | 86 | <offset> |
88 | The offset of the start of data on the specific <dev_path> (in units | 87 | The offset of the start of data on the specific <dev_path> (in units |
89 | of 512-byte sectors). This number is added to the sector number when | 88 | of 512-byte sectors). This number is added to the sector number when |
90 | forwarding the request to the specific path. Typically it is zero. | 89 | forwarding the request to the specific path. Typically it is zero. |
91 | 90 | ||
92 | Messages | 91 | Messages |
93 | ======== | 92 | ======== |
@@ -122,17 +121,21 @@ Example | |||
122 | Assume that you have volumes vg1/switch0 vg1/switch1 vg1/switch2 with | 121 | Assume that you have volumes vg1/switch0 vg1/switch1 vg1/switch2 with |
123 | the same size. | 122 | the same size. |
124 | 123 | ||
125 | Create a switch device with 64kB region size: | 124 | Create a switch device with 64kB region size:: |
125 | |||
126 | dmsetup create switch --table "0 `blockdev --getsz /dev/vg1/switch0` | 126 | dmsetup create switch --table "0 `blockdev --getsz /dev/vg1/switch0` |
127 | switch 3 128 0 /dev/vg1/switch0 0 /dev/vg1/switch1 0 /dev/vg1/switch2 0" | 127 | switch 3 128 0 /dev/vg1/switch0 0 /dev/vg1/switch1 0 /dev/vg1/switch2 0" |
128 | 128 | ||
129 | Set mappings for the first 7 entries to point to devices switch0, switch1, | 129 | Set mappings for the first 7 entries to point to devices switch0, switch1, |
130 | switch2, switch0, switch1, switch2, switch1: | 130 | switch2, switch0, switch1, switch2, switch1:: |
131 | |||
131 | dmsetup message switch 0 set_region_mappings 0:0 :1 :2 :0 :1 :2 :1 | 132 | dmsetup message switch 0 set_region_mappings 0:0 :1 :2 :0 :1 :2 :1 |
132 | 133 | ||
133 | Set repetitive mapping. This command: | 134 | Set repetitive mapping. This command:: |
135 | |||
134 | dmsetup message switch 0 set_region_mappings 1000:1 :2 R2,10 | 136 | dmsetup message switch 0 set_region_mappings 1000:1 :2 R2,10 |
135 | is equivalent to: | 137 | |
138 | is equivalent to:: | ||
139 | |||
136 | dmsetup message switch 0 set_region_mappings 1000:1 :2 :1 :2 :1 :2 :1 :2 \ | 140 | dmsetup message switch 0 set_region_mappings 1000:1 :2 :1 :2 :1 :2 :1 :2 \ |
137 | :1 :2 :1 :2 :1 :2 :1 :2 :1 :2 | 141 | :1 :2 :1 :2 :1 :2 :1 :2 :1 :2 |
138 | |||
diff --git a/Documentation/device-mapper/thin-provisioning.txt b/Documentation/device-mapper/thin-provisioning.rst index 883e7ca5f745..bafebf79da4b 100644 --- a/Documentation/device-mapper/thin-provisioning.txt +++ b/Documentation/device-mapper/thin-provisioning.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ================= | ||
2 | Thin provisioning | ||
3 | ================= | ||
4 | |||
1 | Introduction | 5 | Introduction |
2 | ============ | 6 | ============ |
3 | 7 | ||
@@ -95,6 +99,8 @@ previously.) | |||
95 | Using an existing pool device | 99 | Using an existing pool device |
96 | ----------------------------- | 100 | ----------------------------- |
97 | 101 | ||
102 | :: | ||
103 | |||
98 | dmsetup create pool \ | 104 | dmsetup create pool \ |
99 | --table "0 20971520 thin-pool $metadata_dev $data_dev \ | 105 | --table "0 20971520 thin-pool $metadata_dev $data_dev \ |
100 | $data_block_size $low_water_mark" | 106 | $data_block_size $low_water_mark" |
@@ -154,7 +160,7 @@ Thin provisioning | |||
154 | i) Creating a new thinly-provisioned volume. | 160 | i) Creating a new thinly-provisioned volume. |
155 | 161 | ||
156 | To create a new thinly- provisioned volume you must send a message to an | 162 | To create a new thinly- provisioned volume you must send a message to an |
157 | active pool device, /dev/mapper/pool in this example. | 163 | active pool device, /dev/mapper/pool in this example:: |
158 | 164 | ||
159 | dmsetup message /dev/mapper/pool 0 "create_thin 0" | 165 | dmsetup message /dev/mapper/pool 0 "create_thin 0" |
160 | 166 | ||
@@ -164,7 +170,7 @@ i) Creating a new thinly-provisioned volume. | |||
164 | 170 | ||
165 | ii) Using a thinly-provisioned volume. | 171 | ii) Using a thinly-provisioned volume. |
166 | 172 | ||
167 | Thinly-provisioned volumes are activated using the 'thin' target: | 173 | Thinly-provisioned volumes are activated using the 'thin' target:: |
168 | 174 | ||
169 | dmsetup create thin --table "0 2097152 thin /dev/mapper/pool 0" | 175 | dmsetup create thin --table "0 2097152 thin /dev/mapper/pool 0" |
170 | 176 | ||
@@ -181,6 +187,8 @@ i) Creating an internal snapshot. | |||
181 | must suspend it before creating the snapshot to avoid corruption. | 187 | must suspend it before creating the snapshot to avoid corruption. |
182 | This is NOT enforced at the moment, so please be careful! | 188 | This is NOT enforced at the moment, so please be careful! |
183 | 189 | ||
190 | :: | ||
191 | |||
184 | dmsetup suspend /dev/mapper/thin | 192 | dmsetup suspend /dev/mapper/thin |
185 | dmsetup message /dev/mapper/pool 0 "create_snap 1 0" | 193 | dmsetup message /dev/mapper/pool 0 "create_snap 1 0" |
186 | dmsetup resume /dev/mapper/thin | 194 | dmsetup resume /dev/mapper/thin |
@@ -198,14 +206,14 @@ ii) Using an internal snapshot. | |||
198 | activating or removing them both. (This differs from conventional | 206 | activating or removing them both. (This differs from conventional |
199 | device-mapper snapshots.) | 207 | device-mapper snapshots.) |
200 | 208 | ||
201 | Activate it exactly the same way as any other thinly-provisioned volume: | 209 | Activate it exactly the same way as any other thinly-provisioned volume:: |
202 | 210 | ||
203 | dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1" | 211 | dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1" |
204 | 212 | ||
205 | External snapshots | 213 | External snapshots |
206 | ------------------ | 214 | ------------------ |
207 | 215 | ||
208 | You can use an external _read only_ device as an origin for a | 216 | You can use an external **read only** device as an origin for a |
209 | thinly-provisioned volume. Any read to an unprovisioned area of the | 217 | thinly-provisioned volume. Any read to an unprovisioned area of the |
210 | thin device will be passed through to the origin. Writes trigger | 218 | thin device will be passed through to the origin. Writes trigger |
211 | the allocation of new blocks as usual. | 219 | the allocation of new blocks as usual. |
@@ -223,11 +231,13 @@ i) Creating a snapshot of an external device | |||
223 | This is the same as creating a thin device. | 231 | This is the same as creating a thin device. |
224 | You don't mention the origin at this stage. | 232 | You don't mention the origin at this stage. |
225 | 233 | ||
234 | :: | ||
235 | |||
226 | dmsetup message /dev/mapper/pool 0 "create_thin 0" | 236 | dmsetup message /dev/mapper/pool 0 "create_thin 0" |
227 | 237 | ||
228 | ii) Using a snapshot of an external device. | 238 | ii) Using a snapshot of an external device. |
229 | 239 | ||
230 | Append an extra parameter to the thin target specifying the origin: | 240 | Append an extra parameter to the thin target specifying the origin:: |
231 | 241 | ||
232 | dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 0 /dev/image" | 242 | dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 0 /dev/image" |
233 | 243 | ||
@@ -240,6 +250,8 @@ Deactivation | |||
240 | All devices using a pool must be deactivated before the pool itself | 250 | All devices using a pool must be deactivated before the pool itself |
241 | can be. | 251 | can be. |
242 | 252 | ||
253 | :: | ||
254 | |||
243 | dmsetup remove thin | 255 | dmsetup remove thin |
244 | dmsetup remove snap | 256 | dmsetup remove snap |
245 | dmsetup remove pool | 257 | dmsetup remove pool |
@@ -252,25 +264,32 @@ Reference | |||
252 | 264 | ||
253 | i) Constructor | 265 | i) Constructor |
254 | 266 | ||
255 | thin-pool <metadata dev> <data dev> <data block size (sectors)> \ | 267 | :: |
256 | <low water mark (blocks)> [<number of feature args> [<arg>]*] | 268 | |
269 | thin-pool <metadata dev> <data dev> <data block size (sectors)> \ | ||
270 | <low water mark (blocks)> [<number of feature args> [<arg>]*] | ||
257 | 271 | ||
258 | Optional feature arguments: | 272 | Optional feature arguments: |
259 | 273 | ||
260 | skip_block_zeroing: Skip the zeroing of newly-provisioned blocks. | 274 | skip_block_zeroing: |
275 | Skip the zeroing of newly-provisioned blocks. | ||
261 | 276 | ||
262 | ignore_discard: Disable discard support. | 277 | ignore_discard: |
278 | Disable discard support. | ||
263 | 279 | ||
264 | no_discard_passdown: Don't pass discards down to the underlying | 280 | no_discard_passdown: |
265 | data device, but just remove the mapping. | 281 | Don't pass discards down to the underlying |
282 | data device, but just remove the mapping. | ||
266 | 283 | ||
267 | read_only: Don't allow any changes to be made to the pool | 284 | read_only: |
285 | Don't allow any changes to be made to the pool | ||
268 | metadata. This mode is only available after the | 286 | metadata. This mode is only available after the |
269 | thin-pool has been created and first used in full | 287 | thin-pool has been created and first used in full |
270 | read/write mode. It cannot be specified on initial | 288 | read/write mode. It cannot be specified on initial |
271 | thin-pool creation. | 289 | thin-pool creation. |
272 | 290 | ||
273 | error_if_no_space: Error IOs, instead of queueing, if no space. | 291 | error_if_no_space: |
292 | Error IOs, instead of queueing, if no space. | ||
274 | 293 | ||
275 | Data block size must be between 64KB (128 sectors) and 1GB | 294 | Data block size must be between 64KB (128 sectors) and 1GB |
276 | (2097152 sectors) inclusive. | 295 | (2097152 sectors) inclusive. |
@@ -278,10 +297,12 @@ i) Constructor | |||
278 | 297 | ||
279 | ii) Status | 298 | ii) Status |
280 | 299 | ||
281 | <transaction id> <used metadata blocks>/<total metadata blocks> | 300 | :: |
282 | <used data blocks>/<total data blocks> <held metadata root> | 301 | |
283 | ro|rw|out_of_data_space [no_]discard_passdown [error|queue]_if_no_space | 302 | <transaction id> <used metadata blocks>/<total metadata blocks> |
284 | needs_check|- metadata_low_watermark | 303 | <used data blocks>/<total data blocks> <held metadata root> |
304 | ro|rw|out_of_data_space [no_]discard_passdown [error|queue]_if_no_space | ||
305 | needs_check|- metadata_low_watermark | ||
285 | 306 | ||
286 | transaction id: | 307 | transaction id: |
287 | A 64-bit number used by userspace to help synchronise with metadata | 308 | A 64-bit number used by userspace to help synchronise with metadata |
@@ -336,13 +357,11 @@ ii) Status | |||
336 | iii) Messages | 357 | iii) Messages |
337 | 358 | ||
338 | create_thin <dev id> | 359 | create_thin <dev id> |
339 | |||
340 | Create a new thinly-provisioned device. | 360 | Create a new thinly-provisioned device. |
341 | <dev id> is an arbitrary unique 24-bit identifier chosen by | 361 | <dev id> is an arbitrary unique 24-bit identifier chosen by |
342 | the caller. | 362 | the caller. |
343 | 363 | ||
344 | create_snap <dev id> <origin id> | 364 | create_snap <dev id> <origin id> |
345 | |||
346 | Create a new snapshot of another thinly-provisioned device. | 365 | Create a new snapshot of another thinly-provisioned device. |
347 | <dev id> is an arbitrary unique 24-bit identifier chosen by | 366 | <dev id> is an arbitrary unique 24-bit identifier chosen by |
348 | the caller. | 367 | the caller. |
@@ -350,11 +369,9 @@ iii) Messages | |||
350 | of which the new device will be a snapshot. | 369 | of which the new device will be a snapshot. |
351 | 370 | ||
352 | delete <dev id> | 371 | delete <dev id> |
353 | |||
354 | Deletes a thin device. Irreversible. | 372 | Deletes a thin device. Irreversible. |
355 | 373 | ||
356 | set_transaction_id <current id> <new id> | 374 | set_transaction_id <current id> <new id> |
357 | |||
358 | Userland volume managers, such as LVM, need a way to | 375 | Userland volume managers, such as LVM, need a way to |
359 | synchronise their external metadata with the internal metadata of the | 376 | synchronise their external metadata with the internal metadata of the |
360 | pool target. The thin-pool target offers to store an | 377 | pool target. The thin-pool target offers to store an |
@@ -364,14 +381,12 @@ iii) Messages | |||
364 | compare-and-swap message. | 381 | compare-and-swap message. |
365 | 382 | ||
366 | reserve_metadata_snap | 383 | reserve_metadata_snap |
367 | |||
368 | Reserve a copy of the data mapping btree for use by userland. | 384 | Reserve a copy of the data mapping btree for use by userland. |
369 | This allows userland to inspect the mappings as they were when | 385 | This allows userland to inspect the mappings as they were when |
370 | this message was executed. Use the pool's status command to | 386 | this message was executed. Use the pool's status command to |
371 | get the root block associated with the metadata snapshot. | 387 | get the root block associated with the metadata snapshot. |
372 | 388 | ||
373 | release_metadata_snap | 389 | release_metadata_snap |
374 | |||
375 | Release a previously reserved copy of the data mapping btree. | 390 | Release a previously reserved copy of the data mapping btree. |
376 | 391 | ||
377 | 'thin' target | 392 | 'thin' target |
@@ -379,7 +394,9 @@ iii) Messages | |||
379 | 394 | ||
380 | i) Constructor | 395 | i) Constructor |
381 | 396 | ||
382 | thin <pool dev> <dev id> [<external origin dev>] | 397 | :: |
398 | |||
399 | thin <pool dev> <dev id> [<external origin dev>] | ||
383 | 400 | ||
384 | pool dev: | 401 | pool dev: |
385 | the thin-pool device, e.g. /dev/mapper/my_pool or 253:0 | 402 | the thin-pool device, e.g. /dev/mapper/my_pool or 253:0 |
@@ -401,8 +418,7 @@ provisioned as and when needed. | |||
401 | 418 | ||
402 | ii) Status | 419 | ii) Status |
403 | 420 | ||
404 | <nr mapped sectors> <highest mapped sector> | 421 | <nr mapped sectors> <highest mapped sector> |
405 | |||
406 | If the pool has encountered device errors and failed, the status | 422 | If the pool has encountered device errors and failed, the status |
407 | will just contain the string 'Fail'. The userspace recovery | 423 | will just contain the string 'Fail'. The userspace recovery |
408 | tools should then be used. | 424 | tools should then be used. |
diff --git a/Documentation/device-mapper/unstriped.txt b/Documentation/device-mapper/unstriped.rst index 0b2a306c54ee..0a8d3eb3f072 100644 --- a/Documentation/device-mapper/unstriped.txt +++ b/Documentation/device-mapper/unstriped.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ================================ | ||
2 | Device-mapper "unstriped" target | ||
3 | ================================ | ||
4 | |||
1 | Introduction | 5 | Introduction |
2 | ============ | 6 | ============ |
3 | 7 | ||
@@ -34,46 +38,46 @@ striped target to combine the 4 devices into one. It then will use | |||
34 | the unstriped target ontop of the striped device to access the | 38 | the unstriped target ontop of the striped device to access the |
35 | individual backing loop devices. We write data to the newly exposed | 39 | individual backing loop devices. We write data to the newly exposed |
36 | unstriped devices and verify the data written matches the correct | 40 | unstriped devices and verify the data written matches the correct |
37 | underlying device on the striped array. | 41 | underlying device on the striped array:: |
38 | 42 | ||
39 | #!/bin/bash | 43 | #!/bin/bash |
40 | 44 | ||
41 | MEMBER_SIZE=$((128 * 1024 * 1024)) | 45 | MEMBER_SIZE=$((128 * 1024 * 1024)) |
42 | NUM=4 | 46 | NUM=4 |
43 | SEQ_END=$((${NUM}-1)) | 47 | SEQ_END=$((${NUM}-1)) |
44 | CHUNK=256 | 48 | CHUNK=256 |
45 | BS=4096 | 49 | BS=4096 |
46 | 50 | ||
47 | RAID_SIZE=$((${MEMBER_SIZE}*${NUM}/512)) | 51 | RAID_SIZE=$((${MEMBER_SIZE}*${NUM}/512)) |
48 | DM_PARMS="0 ${RAID_SIZE} striped ${NUM} ${CHUNK}" | 52 | DM_PARMS="0 ${RAID_SIZE} striped ${NUM} ${CHUNK}" |
49 | COUNT=$((${MEMBER_SIZE} / ${BS})) | 53 | COUNT=$((${MEMBER_SIZE} / ${BS})) |
50 | 54 | ||
51 | for i in $(seq 0 ${SEQ_END}); do | 55 | for i in $(seq 0 ${SEQ_END}); do |
52 | dd if=/dev/zero of=member-${i} bs=${MEMBER_SIZE} count=1 oflag=direct | 56 | dd if=/dev/zero of=member-${i} bs=${MEMBER_SIZE} count=1 oflag=direct |
53 | losetup /dev/loop${i} member-${i} | 57 | losetup /dev/loop${i} member-${i} |
54 | DM_PARMS+=" /dev/loop${i} 0" | 58 | DM_PARMS+=" /dev/loop${i} 0" |
55 | done | 59 | done |
56 | 60 | ||
57 | echo $DM_PARMS | dmsetup create raid0 | 61 | echo $DM_PARMS | dmsetup create raid0 |
58 | for i in $(seq 0 ${SEQ_END}); do | 62 | for i in $(seq 0 ${SEQ_END}); do |
59 | echo "0 1 unstriped ${NUM} ${CHUNK} ${i} /dev/mapper/raid0 0" | dmsetup create set-${i} | 63 | echo "0 1 unstriped ${NUM} ${CHUNK} ${i} /dev/mapper/raid0 0" | dmsetup create set-${i} |
60 | done; | 64 | done; |
61 | 65 | ||
62 | for i in $(seq 0 ${SEQ_END}); do | 66 | for i in $(seq 0 ${SEQ_END}); do |
63 | dd if=/dev/urandom of=/dev/mapper/set-${i} bs=${BS} count=${COUNT} oflag=direct | 67 | dd if=/dev/urandom of=/dev/mapper/set-${i} bs=${BS} count=${COUNT} oflag=direct |
64 | diff /dev/mapper/set-${i} member-${i} | 68 | diff /dev/mapper/set-${i} member-${i} |
65 | done; | 69 | done; |
66 | 70 | ||
67 | for i in $(seq 0 ${SEQ_END}); do | 71 | for i in $(seq 0 ${SEQ_END}); do |
68 | dmsetup remove set-${i} | 72 | dmsetup remove set-${i} |
69 | done | 73 | done |
70 | 74 | ||
71 | dmsetup remove raid0 | 75 | dmsetup remove raid0 |
72 | 76 | ||
73 | for i in $(seq 0 ${SEQ_END}); do | 77 | for i in $(seq 0 ${SEQ_END}); do |
74 | losetup -d /dev/loop${i} | 78 | losetup -d /dev/loop${i} |
75 | rm -f member-${i} | 79 | rm -f member-${i} |
76 | done | 80 | done |
77 | 81 | ||
78 | Another example | 82 | Another example |
79 | --------------- | 83 | --------------- |
@@ -81,7 +85,7 @@ Another example | |||
81 | Intel NVMe drives contain two cores on the physical device. | 85 | Intel NVMe drives contain two cores on the physical device. |
82 | Each core of the drive has segregated access to its LBA range. | 86 | Each core of the drive has segregated access to its LBA range. |
83 | The current LBA model has a RAID 0 128k chunk on each core, resulting | 87 | The current LBA model has a RAID 0 128k chunk on each core, resulting |
84 | in a 256k stripe across the two cores: | 88 | in a 256k stripe across the two cores:: |
85 | 89 | ||
86 | Core 0: Core 1: | 90 | Core 0: Core 1: |
87 | __________ __________ | 91 | __________ __________ |
@@ -108,17 +112,24 @@ Example dmsetup usage | |||
108 | 112 | ||
109 | unstriped ontop of Intel NVMe device that has 2 cores | 113 | unstriped ontop of Intel NVMe device that has 2 cores |
110 | ----------------------------------------------------- | 114 | ----------------------------------------------------- |
111 | dmsetup create nvmset0 --table '0 512 unstriped 2 256 0 /dev/nvme0n1 0' | 115 | |
112 | dmsetup create nvmset1 --table '0 512 unstriped 2 256 1 /dev/nvme0n1 0' | 116 | :: |
117 | |||
118 | dmsetup create nvmset0 --table '0 512 unstriped 2 256 0 /dev/nvme0n1 0' | ||
119 | dmsetup create nvmset1 --table '0 512 unstriped 2 256 1 /dev/nvme0n1 0' | ||
113 | 120 | ||
114 | There will now be two devices that expose Intel NVMe core 0 and 1 | 121 | There will now be two devices that expose Intel NVMe core 0 and 1 |
115 | respectively: | 122 | respectively:: |
116 | /dev/mapper/nvmset0 | 123 | |
117 | /dev/mapper/nvmset1 | 124 | /dev/mapper/nvmset0 |
125 | /dev/mapper/nvmset1 | ||
118 | 126 | ||
119 | unstriped ontop of striped with 4 drives using 128K chunk size | 127 | unstriped ontop of striped with 4 drives using 128K chunk size |
120 | -------------------------------------------------------------- | 128 | -------------------------------------------------------------- |
121 | dmsetup create raid_disk0 --table '0 512 unstriped 4 256 0 /dev/mapper/striped 0' | 129 | |
122 | dmsetup create raid_disk1 --table '0 512 unstriped 4 256 1 /dev/mapper/striped 0' | 130 | :: |
123 | dmsetup create raid_disk2 --table '0 512 unstriped 4 256 2 /dev/mapper/striped 0' | 131 | |
124 | dmsetup create raid_disk3 --table '0 512 unstriped 4 256 3 /dev/mapper/striped 0' | 132 | dmsetup create raid_disk0 --table '0 512 unstriped 4 256 0 /dev/mapper/striped 0' |
133 | dmsetup create raid_disk1 --table '0 512 unstriped 4 256 1 /dev/mapper/striped 0' | ||
134 | dmsetup create raid_disk2 --table '0 512 unstriped 4 256 2 /dev/mapper/striped 0' | ||
135 | dmsetup create raid_disk3 --table '0 512 unstriped 4 256 3 /dev/mapper/striped 0' | ||
diff --git a/Documentation/device-mapper/verity.txt b/Documentation/device-mapper/verity.rst index b3d2e4a42255..a4d1c1476d72 100644 --- a/Documentation/device-mapper/verity.txt +++ b/Documentation/device-mapper/verity.rst | |||
@@ -1,5 +1,6 @@ | |||
1 | ========= | ||
1 | dm-verity | 2 | dm-verity |
2 | ========== | 3 | ========= |
3 | 4 | ||
4 | Device-Mapper's "verity" target provides transparent integrity checking of | 5 | Device-Mapper's "verity" target provides transparent integrity checking of |
5 | block devices using a cryptographic digest provided by the kernel crypto API. | 6 | block devices using a cryptographic digest provided by the kernel crypto API. |
@@ -7,6 +8,9 @@ This target is read-only. | |||
7 | 8 | ||
8 | Construction Parameters | 9 | Construction Parameters |
9 | ======================= | 10 | ======================= |
11 | |||
12 | :: | ||
13 | |||
10 | <version> <dev> <hash_dev> | 14 | <version> <dev> <hash_dev> |
11 | <data_block_size> <hash_block_size> | 15 | <data_block_size> <hash_block_size> |
12 | <num_data_blocks> <hash_start_block> | 16 | <num_data_blocks> <hash_start_block> |
@@ -160,7 +164,9 @@ calculating the parent node. | |||
160 | 164 | ||
161 | The tree looks something like: | 165 | The tree looks something like: |
162 | 166 | ||
163 | alg = sha256, num_blocks = 32768, block_size = 4096 | 167 | alg = sha256, num_blocks = 32768, block_size = 4096 |
168 | |||
169 | :: | ||
164 | 170 | ||
165 | [ root ] | 171 | [ root ] |
166 | / . . . \ | 172 | / . . . \ |
@@ -189,6 +195,7 @@ block boundary) are the hash blocks which are stored a depth at a time | |||
189 | 195 | ||
190 | The full specification of kernel parameters and on-disk metadata format | 196 | The full specification of kernel parameters and on-disk metadata format |
191 | is available at the cryptsetup project's wiki page | 197 | is available at the cryptsetup project's wiki page |
198 | |||
192 | https://gitlab.com/cryptsetup/cryptsetup/wikis/DMVerity | 199 | https://gitlab.com/cryptsetup/cryptsetup/wikis/DMVerity |
193 | 200 | ||
194 | Status | 201 | Status |
@@ -198,7 +205,8 @@ If any check failed, C (for Corruption) is returned. | |||
198 | 205 | ||
199 | Example | 206 | Example |
200 | ======= | 207 | ======= |
201 | Set up a device: | 208 | Set up a device:: |
209 | |||
202 | # dmsetup create vroot --readonly --table \ | 210 | # dmsetup create vroot --readonly --table \ |
203 | "0 2097152 verity 1 /dev/sda1 /dev/sda2 4096 4096 262144 1 sha256 "\ | 211 | "0 2097152 verity 1 /dev/sda1 /dev/sda2 4096 4096 262144 1 sha256 "\ |
204 | "4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 "\ | 212 | "4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 "\ |
@@ -209,11 +217,13 @@ the hash tree or activate the kernel device. This is available from | |||
209 | the cryptsetup upstream repository https://gitlab.com/cryptsetup/cryptsetup/ | 217 | the cryptsetup upstream repository https://gitlab.com/cryptsetup/cryptsetup/ |
210 | (as a libcryptsetup extension). | 218 | (as a libcryptsetup extension). |
211 | 219 | ||
212 | Create hash on the device: | 220 | Create hash on the device:: |
221 | |||
213 | # veritysetup format /dev/sda1 /dev/sda2 | 222 | # veritysetup format /dev/sda1 /dev/sda2 |
214 | ... | 223 | ... |
215 | Root hash: 4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 | 224 | Root hash: 4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 |
216 | 225 | ||
217 | Activate the device: | 226 | Activate the device:: |
227 | |||
218 | # veritysetup create vroot /dev/sda1 /dev/sda2 \ | 228 | # veritysetup create vroot /dev/sda1 /dev/sda2 \ |
219 | 4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 | 229 | 4392712ba01368efdf14b05c76f9e4df0d53664630b5d48632ed17a137f39076 |
diff --git a/Documentation/device-mapper/writecache.txt b/Documentation/device-mapper/writecache.rst index 01532b3008ae..d3d7690f5e8d 100644 --- a/Documentation/device-mapper/writecache.txt +++ b/Documentation/device-mapper/writecache.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ================= | ||
2 | Writecache target | ||
3 | ================= | ||
4 | |||
1 | The writecache target caches writes on persistent memory or on SSD. It | 5 | The writecache target caches writes on persistent memory or on SSD. It |
2 | doesn't cache reads because reads are supposed to be cached in page cache | 6 | doesn't cache reads because reads are supposed to be cached in page cache |
3 | in normal RAM. | 7 | in normal RAM. |
@@ -6,15 +10,18 @@ When the device is constructed, the first sector should be zeroed or the | |||
6 | first sector should contain valid superblock from previous invocation. | 10 | first sector should contain valid superblock from previous invocation. |
7 | 11 | ||
8 | Constructor parameters: | 12 | Constructor parameters: |
13 | |||
9 | 1. type of the cache device - "p" or "s" | 14 | 1. type of the cache device - "p" or "s" |
10 | p - persistent memory | 15 | |
11 | s - SSD | 16 | - p - persistent memory |
17 | - s - SSD | ||
12 | 2. the underlying device that will be cached | 18 | 2. the underlying device that will be cached |
13 | 3. the cache device | 19 | 3. the cache device |
14 | 4. block size (4096 is recommended; the maximum block size is the page | 20 | 4. block size (4096 is recommended; the maximum block size is the page |
15 | size) | 21 | size) |
16 | 5. the number of optional parameters (the parameters with an argument | 22 | 5. the number of optional parameters (the parameters with an argument |
17 | count as two) | 23 | count as two) |
24 | |||
18 | start_sector n (default: 0) | 25 | start_sector n (default: 0) |
19 | offset from the start of cache device in 512-byte sectors | 26 | offset from the start of cache device in 512-byte sectors |
20 | high_watermark n (default: 50) | 27 | high_watermark n (default: 50) |
@@ -43,6 +50,7 @@ Constructor parameters: | |||
43 | applicable only to persistent memory - don't use the FUA | 50 | applicable only to persistent memory - don't use the FUA |
44 | flag when writing back data and send the FLUSH request | 51 | flag when writing back data and send the FLUSH request |
45 | afterwards | 52 | afterwards |
53 | |||
46 | - some underlying devices perform better with fua, some | 54 | - some underlying devices perform better with fua, some |
47 | with nofua. The user should test it | 55 | with nofua. The user should test it |
48 | 56 | ||
@@ -60,6 +68,7 @@ Messages: | |||
60 | flush the cache device on next suspend. Use this message | 68 | flush the cache device on next suspend. Use this message |
61 | when you are going to remove the cache device. The proper | 69 | when you are going to remove the cache device. The proper |
62 | sequence for removing the cache device is: | 70 | sequence for removing the cache device is: |
71 | |||
63 | 1. send the "flush_on_suspend" message | 72 | 1. send the "flush_on_suspend" message |
64 | 2. load an inactive table with a linear target that maps | 73 | 2. load an inactive table with a linear target that maps |
65 | to the underlying device | 74 | to the underlying device |
diff --git a/Documentation/device-mapper/zero.txt b/Documentation/device-mapper/zero.rst index 20fb38e7fa7e..11fb5cf4597c 100644 --- a/Documentation/device-mapper/zero.txt +++ b/Documentation/device-mapper/zero.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ======= | ||
1 | dm-zero | 2 | dm-zero |
2 | ======= | 3 | ======= |
3 | 4 | ||
@@ -18,20 +19,19 @@ filesystem limitations. | |||
18 | 19 | ||
19 | To create a sparse device, start by creating a dm-zero device that's the | 20 | To create a sparse device, start by creating a dm-zero device that's the |
20 | desired size of the sparse device. For this example, we'll assume a 10TB | 21 | desired size of the sparse device. For this example, we'll assume a 10TB |
21 | sparse device. | 22 | sparse device:: |
22 | 23 | ||
23 | TEN_TERABYTES=`expr 10 \* 1024 \* 1024 \* 1024 \* 2` # 10 TB in sectors | 24 | TEN_TERABYTES=`expr 10 \* 1024 \* 1024 \* 1024 \* 2` # 10 TB in sectors |
24 | echo "0 $TEN_TERABYTES zero" | dmsetup create zero1 | 25 | echo "0 $TEN_TERABYTES zero" | dmsetup create zero1 |
25 | 26 | ||
26 | Then create a snapshot of the zero device, using any available block-device as | 27 | Then create a snapshot of the zero device, using any available block-device as |
27 | the COW device. The size of the COW device will determine the amount of real | 28 | the COW device. The size of the COW device will determine the amount of real |
28 | space available to the sparse device. For this example, we'll assume /dev/sdb1 | 29 | space available to the sparse device. For this example, we'll assume /dev/sdb1 |
29 | is an available 10GB partition. | 30 | is an available 10GB partition:: |
30 | 31 | ||
31 | echo "0 $TEN_TERABYTES snapshot /dev/mapper/zero1 /dev/sdb1 p 128" | \ | 32 | echo "0 $TEN_TERABYTES snapshot /dev/mapper/zero1 /dev/sdb1 p 128" | \ |
32 | dmsetup create sparse1 | 33 | dmsetup create sparse1 |
33 | 34 | ||
34 | This will create a 10TB sparse device called /dev/mapper/sparse1 that has | 35 | This will create a 10TB sparse device called /dev/mapper/sparse1 that has |
35 | 10GB of actual storage space available. If more than 10GB of data is written | 36 | 10GB of actual storage space available. If more than 10GB of data is written |
36 | to this device, it will start returning I/O errors. | 37 | to this device, it will start returning I/O errors. |
37 | |||
diff --git a/Documentation/filesystems/ubifs-authentication.md b/Documentation/filesystems/ubifs-authentication.md index 028b3e2e25f9..23e698167141 100644 --- a/Documentation/filesystems/ubifs-authentication.md +++ b/Documentation/filesystems/ubifs-authentication.md | |||
@@ -417,9 +417,9 @@ will then have to be provided beforehand in the normal way. | |||
417 | 417 | ||
418 | [DMC-CBC-ATTACK] http://www.jakoblell.com/blog/2013/12/22/practical-malleability-attack-against-cbc-encrypted-luks-partitions/ | 418 | [DMC-CBC-ATTACK] http://www.jakoblell.com/blog/2013/12/22/practical-malleability-attack-against-cbc-encrypted-luks-partitions/ |
419 | 419 | ||
420 | [DM-INTEGRITY] https://www.kernel.org/doc/Documentation/device-mapper/dm-integrity.txt | 420 | [DM-INTEGRITY] https://www.kernel.org/doc/Documentation/device-mapper/dm-integrity.rst |
421 | 421 | ||
422 | [DM-VERITY] https://www.kernel.org/doc/Documentation/device-mapper/verity.txt | 422 | [DM-VERITY] https://www.kernel.org/doc/Documentation/device-mapper/verity.rst |
423 | 423 | ||
424 | [FSCRYPT-POLICY2] https://www.spinics.net/lists/linux-ext4/msg58710.html | 424 | [FSCRYPT-POLICY2] https://www.spinics.net/lists/linux-ext4/msg58710.html |
425 | 425 | ||
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig index 45254b3ef715..5ccac0b77f17 100644 --- a/drivers/md/Kconfig +++ b/drivers/md/Kconfig | |||
@@ -453,7 +453,7 @@ config DM_INIT | |||
453 | Enable "dm-mod.create=" parameter to create mapped devices at init time. | 453 | Enable "dm-mod.create=" parameter to create mapped devices at init time. |
454 | This option is useful to allow mounting rootfs without requiring an | 454 | This option is useful to allow mounting rootfs without requiring an |
455 | initramfs. | 455 | initramfs. |
456 | See Documentation/device-mapper/dm-init.txt for dm-mod.create="..." | 456 | See Documentation/device-mapper/dm-init.rst for dm-mod.create="..." |
457 | format. | 457 | format. |
458 | 458 | ||
459 | If unsure, say N. | 459 | If unsure, say N. |
diff --git a/drivers/md/dm-init.c b/drivers/md/dm-init.c index 352e803f566e..a58d0944f592 100644 --- a/drivers/md/dm-init.c +++ b/drivers/md/dm-init.c | |||
@@ -25,7 +25,7 @@ static char *create; | |||
25 | * Format: dm-mod.create=<name>,<uuid>,<minor>,<flags>,<table>[,<table>+][;<name>,<uuid>,<minor>,<flags>,<table>[,<table>+]+] | 25 | * Format: dm-mod.create=<name>,<uuid>,<minor>,<flags>,<table>[,<table>+][;<name>,<uuid>,<minor>,<flags>,<table>[,<table>+]+] |
26 | * Table format: <start_sector> <num_sectors> <target_type> <target_args> | 26 | * Table format: <start_sector> <num_sectors> <target_type> <target_args> |
27 | * | 27 | * |
28 | * See Documentation/device-mapper/dm-init.txt for dm-mod.create="..." format | 28 | * See Documentation/device-mapper/dm-init.rst for dm-mod.create="..." format |
29 | * details. | 29 | * details. |
30 | */ | 30 | */ |
31 | 31 | ||
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 9fdef6897316..7a87a640f8ba 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c | |||
@@ -3558,7 +3558,7 @@ static void raid_status(struct dm_target *ti, status_type_t type, | |||
3558 | * v1.5.0+: | 3558 | * v1.5.0+: |
3559 | * | 3559 | * |
3560 | * Sync action: | 3560 | * Sync action: |
3561 | * See Documentation/device-mapper/dm-raid.txt for | 3561 | * See Documentation/device-mapper/dm-raid.rst for |
3562 | * information on each of these states. | 3562 | * information on each of these states. |
3563 | */ | 3563 | */ |
3564 | DMEMIT(" %s", sync_action); | 3564 | DMEMIT(" %s", sync_action); |