xref: /linux/drivers/md/Kconfig (revision c27474ac1d4609af3c1c38ccac252c2575b47b9e)
1# SPDX-License-Identifier: GPL-2.0-only
2#
3# Block device driver configuration
4#
5
6menuconfig MD
7	bool "Multiple devices driver support (RAID and LVM)"
8	depends on BLOCK
9	help
10	  Support multiple physical spindles through a single logical device.
11	  Required for RAID and logical volume management.
12
13if MD
14
15config BLK_DEV_MD
16	tristate "RAID support"
17	select BLOCK_HOLDER_DEPRECATED if SYSFS
18	select BUFFER_HEAD
19	# BLOCK_LEGACY_AUTOLOAD requirement should be removed
20	# after relevant mdadm enhancements - to make "names=yes"
21	# the default - are widely available.
22	select BLOCK_LEGACY_AUTOLOAD
23	help
24	  This driver lets you combine several hard disk partitions into one
25	  logical block device. This can be used to simply append one
26	  partition to another one or to combine several redundant hard disks
27	  into a RAID1/4/5 device so as to provide protection against hard
28	  disk failures. This is called "Software RAID" since the combining of
29	  the partitions is done by the kernel. "Hardware RAID" means that the
30	  combining is done by a dedicated controller; if you have such a
31	  controller, you do not need to say Y here.
32
33	  More information about Software RAID on Linux is contained in the
34	  Software RAID mini-HOWTO, available from
35	  <https://www.tldp.org/docs.html#howto>. There you will also learn
36	  where to get the supporting user space utilities raidtools.
37
38	  If unsure, say N.
39
40config MD_BITMAP
41	bool "MD RAID bitmap support"
42	default y
43	depends on BLK_DEV_MD
44	help
45	  If you say Y here, support for the write intent bitmap will be
46	  enabled. The bitmap can be used to optimize resync speed after power
47	  failure or readding a disk, limiting it to recorded dirty sectors in
48	  bitmap.
49
50	  This feature can be added to existing MD array or MD array can be
51	  created with bitmap via mdadm(8).
52
53	  If unsure, say Y.
54
55config MD_AUTODETECT
56	bool "Autodetect RAID arrays during kernel boot"
57	depends on BLK_DEV_MD=y
58	default y
59	help
60	  If you say Y here, then the kernel will try to autodetect raid
61	  arrays as part of its boot process.
62
63	  If you don't use raid and say Y, this autodetection can cause
64	  a several-second delay in the boot time due to various
65	  synchronisation steps that are part of this step.
66
67	  If unsure, say Y.
68
69config MD_BITMAP_FILE
70	bool "MD bitmap file support (deprecated)"
71	default y
72	depends on MD_BITMAP
73	help
74	  If you say Y here, support for write intent bitmaps in files on an
75	  external file system is enabled.  This is an alternative to the internal
76	  bitmaps near the MD superblock, and very problematic code that abuses
77	  various kernel APIs and can only work with files on a file system not
78	  actually sitting on the MD device.
79
80config MD_LINEAR
81	tristate "Linear (append) mode"
82	depends on BLK_DEV_MD
83	help
84	  If you say Y here, then your multiple devices driver will be able to
85	  use the so-called linear mode, i.e. it will combine the hard disk
86	  partitions by simply appending one to the other.
87
88	  To compile this as a module, choose M here: the module
89	  will be called linear.
90
91	  If unsure, say Y.
92
93config MD_RAID0
94	tristate "RAID-0 (striping) mode"
95	depends on BLK_DEV_MD
96	help
97	  If you say Y here, then your multiple devices driver will be able to
98	  use the so-called raid0 mode, i.e. it will combine the hard disk
99	  partitions into one logical device in such a fashion as to fill them
100	  up evenly, one chunk here and one chunk there. This will increase
101	  the throughput rate if the partitions reside on distinct disks.
102
103	  Information about Software RAID on Linux is contained in the
104	  Software-RAID mini-HOWTO, available from
105	  <https://www.tldp.org/docs.html#howto>. There you will also
106	  learn where to get the supporting user space utilities raidtools.
107
108	  To compile this as a module, choose M here: the module
109	  will be called raid0.
110
111	  If unsure, say Y.
112
113config MD_RAID1
114	tristate "RAID-1 (mirroring) mode"
115	depends on BLK_DEV_MD
116	help
117	  A RAID-1 set consists of several disk drives which are exact copies
118	  of each other.  In the event of a mirror failure, the RAID driver
119	  will continue to use the operational mirrors in the set, providing
120	  an error free MD (multiple device) to the higher levels of the
121	  kernel.  In a set with N drives, the available space is the capacity
122	  of a single drive, and the set protects against a failure of (N - 1)
123	  drives.
124
125	  Information about Software RAID on Linux is contained in the
126	  Software-RAID mini-HOWTO, available from
127	  <https://www.tldp.org/docs.html#howto>.  There you will also
128	  learn where to get the supporting user space utilities raidtools.
129
130	  If you want to use such a RAID-1 set, say Y.  To compile this code
131	  as a module, choose M here: the module will be called raid1.
132
133	  If unsure, say Y.
134
135config MD_RAID10
136	tristate "RAID-10 (mirrored striping) mode"
137	depends on BLK_DEV_MD
138	help
139	  RAID-10 provides a combination of striping (RAID-0) and
140	  mirroring (RAID-1) with easier configuration and more flexible
141	  layout.
142	  Unlike RAID-0, but like RAID-1, RAID-10 requires all devices to
143	  be the same size (or at least, only as much as the smallest device
144	  will be used).
145	  RAID-10 provides a variety of layouts that provide different levels
146	  of redundancy and performance.
147
148	  RAID-10 requires mdadm-1.7.0 or later, available at:
149
150	  https://www.kernel.org/pub/linux/utils/raid/mdadm/
151
152	  If unsure, say Y.
153
154config MD_RAID456
155	tristate "RAID-4/RAID-5/RAID-6 mode"
156	depends on BLK_DEV_MD
157	select RAID6_PQ
158	select CRC32
159	select ASYNC_MEMCPY
160	select ASYNC_XOR
161	select ASYNC_PQ
162	select ASYNC_RAID6_RECOV
163	help
164	  A RAID-5 set of N drives with a capacity of C MB per drive provides
165	  the capacity of C * (N - 1) MB, and protects against a failure
166	  of a single drive. For a given sector (row) number, (N - 1) drives
167	  contain data sectors, and one drive contains the parity protection.
168	  For a RAID-4 set, the parity blocks are present on a single drive,
169	  while a RAID-5 set distributes the parity across the drives in one
170	  of the available parity distribution methods.
171
172	  A RAID-6 set of N drives with a capacity of C MB per drive
173	  provides the capacity of C * (N - 2) MB, and protects
174	  against a failure of any two drives. For a given sector
175	  (row) number, (N - 2) drives contain data sectors, and two
176	  drives contains two independent redundancy syndromes.  Like
177	  RAID-5, RAID-6 distributes the syndromes across the drives
178	  in one of the available parity distribution methods.
179
180	  Information about Software RAID on Linux is contained in the
181	  Software-RAID mini-HOWTO, available from
182	  <https://www.tldp.org/docs.html#howto>. There you will also
183	  learn where to get the supporting user space utilities raidtools.
184
185	  If you want to use such a RAID-4/RAID-5/RAID-6 set, say Y.  To
186	  compile this code as a module, choose M here: the module
187	  will be called raid456.
188
189	  If unsure, say Y.
190
191config MD_CLUSTER
192	tristate "Cluster Support for MD"
193	select MD_BITMAP
194	depends on BLK_DEV_MD
195	depends on DLM
196	default n
197	help
198	Clustering support for MD devices. This enables locking and
199	synchronization across multiple systems on the cluster, so all
200	nodes in the cluster can access the MD devices simultaneously.
201
202	This brings the redundancy (and uptime) of RAID levels across the
203	nodes of the cluster. Currently, it can work with raid1 and raid10
204	(limited support).
205
206	If unsure, say N.
207
208source "drivers/md/bcache/Kconfig"
209
210config BLK_DEV_DM_BUILTIN
211	bool
212
213config BLK_DEV_DM
214	tristate "Device mapper support"
215	select BLOCK_HOLDER_DEPRECATED if SYSFS
216	select BLK_DEV_DM_BUILTIN
217	select BLK_MQ_STACKING
218	depends on DAX || DAX=n
219	help
220	  Device-mapper is a low level volume manager.  It works by allowing
221	  people to specify mappings for ranges of logical sectors.  Various
222	  mapping types are available, in addition people may write their own
223	  modules containing custom mappings if they wish.
224
225	  Higher level volume managers such as LVM2 use this driver.
226
227	  To compile this as a module, choose M here: the module will be
228	  called dm-mod.
229
230	  If unsure, say N.
231
232config DM_DEBUG
233	bool "Device mapper debugging support"
234	depends on BLK_DEV_DM
235	help
236	  Enable this for messages that may help debug device-mapper problems.
237
238	  If unsure, say N.
239
240config DM_BUFIO
241       tristate
242       depends on BLK_DEV_DM
243	help
244	 This interface allows you to do buffered I/O on a device and acts
245	 as a cache, holding recently-read blocks in memory and performing
246	 delayed writes.
247
248config DM_DEBUG_BLOCK_MANAGER_LOCKING
249       bool "Block manager locking"
250       depends on DM_BUFIO
251	help
252	 Block manager locking can catch various metadata corruption issues.
253
254	 If unsure, say N.
255
256config DM_DEBUG_BLOCK_STACK_TRACING
257       bool "Keep stack trace of persistent data block lock holders"
258       depends on STACKTRACE_SUPPORT && DM_DEBUG_BLOCK_MANAGER_LOCKING
259       select STACKTRACE
260	help
261	 Enable this for messages that may help debug problems with the
262	 block manager locking used by thin provisioning and caching.
263
264	 If unsure, say N.
265
266config DM_BIO_PRISON
267       tristate
268       depends on BLK_DEV_DM
269	help
270	 Some bio locking schemes used by other device-mapper targets
271	 including thin provisioning.
272
273source "drivers/md/persistent-data/Kconfig"
274
275config DM_UNSTRIPED
276       tristate "Unstriped target"
277       depends on BLK_DEV_DM
278	help
279	  Unstripes I/O so it is issued solely on a single drive in a HW
280	  RAID0 or dm-striped target.
281
282config DM_CRYPT
283	tristate "Crypt target support"
284	depends on BLK_DEV_DM
285	depends on (ENCRYPTED_KEYS || ENCRYPTED_KEYS=n)
286	depends on (TRUSTED_KEYS || TRUSTED_KEYS=n)
287	select CRC32
288	select CRYPTO
289	select CRYPTO_CBC
290	select CRYPTO_ESSIV
291	help
292	  This device-mapper target allows you to create a device that
293	  transparently encrypts the data on it. You'll need to activate
294	  the ciphers you're going to use in the cryptoapi configuration.
295
296	  For further information on dm-crypt and userspace tools see:
297	  <https://gitlab.com/cryptsetup/cryptsetup/wikis/DMCrypt>
298
299	  To compile this code as a module, choose M here: the module will
300	  be called dm-crypt.
301
302	  If unsure, say N.
303
304config DM_SNAPSHOT
305       tristate "Snapshot target"
306       depends on BLK_DEV_DM
307       select DM_BUFIO
308	help
309	 Allow volume managers to take writable snapshots of a device.
310
311config DM_THIN_PROVISIONING
312       tristate "Thin provisioning target"
313       depends on BLK_DEV_DM
314       select DM_PERSISTENT_DATA
315       select DM_BIO_PRISON
316	help
317	 Provides thin provisioning and snapshots that share a data store.
318
319config DM_CACHE
320       tristate "Cache target (EXPERIMENTAL)"
321       depends on BLK_DEV_DM
322       default n
323       select DM_PERSISTENT_DATA
324       select DM_BIO_PRISON
325	help
326	 dm-cache attempts to improve performance of a block device by
327	 moving frequently used data to a smaller, higher performance
328	 device.  Different 'policy' plugins can be used to change the
329	 algorithms used to select which blocks are promoted, demoted,
330	 cleaned etc.  It supports writeback and writethrough modes.
331
332config DM_CACHE_SMQ
333       tristate "Stochastic MQ Cache Policy (EXPERIMENTAL)"
334       depends on DM_CACHE
335       default y
336	help
337	 A cache policy that uses a multiqueue ordered by recent hits
338	 to select which blocks should be promoted and demoted.
339	 This is meant to be a general purpose policy.  It prioritises
340	 reads over writes.  This SMQ policy (vs MQ) offers the promise
341	 of less memory utilization, improved performance and increased
342	 adaptability in the face of changing workloads.
343
344config DM_WRITECACHE
345	tristate "Writecache target"
346	depends on BLK_DEV_DM
347	help
348	   The writecache target caches writes on persistent memory or SSD.
349	   It is intended for databases or other programs that need extremely
350	   low commit latency.
351
352	   The writecache target doesn't cache reads because reads are supposed
353	   to be cached in standard RAM.
354
355config DM_EBS
356	tristate "Emulated block size target (EXPERIMENTAL)"
357	depends on BLK_DEV_DM && !HIGHMEM
358	select DM_BUFIO
359	help
360	  dm-ebs emulates smaller logical block size on backing devices
361	  with larger ones (e.g. 512 byte sectors on 4K native disks).
362
363config DM_ERA
364       tristate "Era target (EXPERIMENTAL)"
365       depends on BLK_DEV_DM
366       default n
367       select DM_PERSISTENT_DATA
368       select DM_BIO_PRISON
369	help
370	 dm-era tracks which parts of a block device are written to
371	 over time.  Useful for maintaining cache coherency when using
372	 vendor snapshots.
373
374config DM_CLONE
375       tristate "Clone target (EXPERIMENTAL)"
376       depends on BLK_DEV_DM
377       default n
378       select DM_PERSISTENT_DATA
379	help
380	 dm-clone produces a one-to-one copy of an existing, read-only source
381	 device into a writable destination device. The cloned device is
382	 visible/mountable immediately and the copy of the source device to the
383	 destination device happens in the background, in parallel with user
384	 I/O.
385
386	 If unsure, say N.
387
388config DM_MIRROR
389       tristate "Mirror target"
390       depends on BLK_DEV_DM
391	help
392	 Allow volume managers to mirror logical volumes, also
393	 needed for live data migration tools such as 'pvmove'.
394
395config DM_LOG_USERSPACE
396	tristate "Mirror userspace logging"
397	depends on DM_MIRROR && NET
398	select CONNECTOR
399	help
400	  The userspace logging module provides a mechanism for
401	  relaying the dm-dirty-log API to userspace.  Log designs
402	  which are more suited to userspace implementation (e.g.
403	  shared storage logs) or experimental logs can be implemented
404	  by leveraging this framework.
405
406config DM_RAID
407       tristate "RAID 1/4/5/6/10 target"
408       depends on BLK_DEV_DM
409       select MD_RAID0
410       select MD_RAID1
411       select MD_RAID10
412       select MD_RAID456
413       select MD_BITMAP
414       select BLK_DEV_MD
415	help
416	 A dm target that supports RAID1, RAID10, RAID4, RAID5 and RAID6 mappings
417
418	 A RAID-5 set of N drives with a capacity of C MB per drive provides
419	 the capacity of C * (N - 1) MB, and protects against a failure
420	 of a single drive. For a given sector (row) number, (N - 1) drives
421	 contain data sectors, and one drive contains the parity protection.
422	 For a RAID-4 set, the parity blocks are present on a single drive,
423	 while a RAID-5 set distributes the parity across the drives in one
424	 of the available parity distribution methods.
425
426	 A RAID-6 set of N drives with a capacity of C MB per drive
427	 provides the capacity of C * (N - 2) MB, and protects
428	 against a failure of any two drives. For a given sector
429	 (row) number, (N - 2) drives contain data sectors, and two
430	 drives contains two independent redundancy syndromes.  Like
431	 RAID-5, RAID-6 distributes the syndromes across the drives
432	 in one of the available parity distribution methods.
433
434config DM_ZERO
435	tristate "Zero target"
436	depends on BLK_DEV_DM
437	help
438	  A target that discards writes, and returns all zeroes for
439	  reads.  Useful in some recovery situations.
440
441config DM_MULTIPATH
442	tristate "Multipath target"
443	depends on BLK_DEV_DM
444	# nasty syntax but means make DM_MULTIPATH independent
445	# of SCSI_DH if the latter isn't defined but if
446	# it is, DM_MULTIPATH must depend on it.  We get a build
447	# error if SCSI_DH=m and DM_MULTIPATH=y
448	depends on !SCSI_DH || SCSI
449	help
450	  Allow volume managers to support multipath hardware.
451
452config DM_MULTIPATH_QL
453	tristate "I/O Path Selector based on the number of in-flight I/Os"
454	depends on DM_MULTIPATH
455	help
456	  This path selector is a dynamic load balancer which selects
457	  the path with the least number of in-flight I/Os.
458
459	  If unsure, say N.
460
461config DM_MULTIPATH_ST
462	tristate "I/O Path Selector based on the service time"
463	depends on DM_MULTIPATH
464	help
465	  This path selector is a dynamic load balancer which selects
466	  the path expected to complete the incoming I/O in the shortest
467	  time.
468
469	  If unsure, say N.
470
471config DM_MULTIPATH_HST
472	tristate "I/O Path Selector based on historical service time"
473	depends on DM_MULTIPATH
474	help
475	  This path selector is a dynamic load balancer which selects
476	  the path expected to complete the incoming I/O in the shortest
477	  time by comparing estimated service time (based on historical
478	  service time).
479
480	  If unsure, say N.
481
482config DM_MULTIPATH_IOA
483	tristate "I/O Path Selector based on CPU submission"
484	depends on DM_MULTIPATH
485	help
486	  This path selector selects the path based on the CPU the IO is
487	  executed on and the CPU to path mapping setup at path addition time.
488
489	  If unsure, say N.
490
491config DM_DELAY
492	tristate "I/O delaying target"
493	depends on BLK_DEV_DM
494	help
495	A target that delays reads and/or writes and can send
496	them to different devices.  Useful for testing.
497
498	If unsure, say N.
499
500config DM_DUST
501	tristate "Bad sector simulation target"
502	depends on BLK_DEV_DM
503	help
504	A target that simulates bad sector behavior.
505	Useful for testing.
506
507	If unsure, say N.
508
509config DM_INIT
510	bool "DM \"dm-mod.create=\" parameter support"
511	depends on BLK_DEV_DM=y
512	help
513	Enable "dm-mod.create=" parameter to create mapped devices at init time.
514	This option is useful to allow mounting rootfs without requiring an
515	initramfs.
516	See Documentation/admin-guide/device-mapper/dm-init.rst for dm-mod.create="..."
517	format.
518
519	If unsure, say N.
520
521config DM_UEVENT
522	bool "DM uevents"
523	depends on BLK_DEV_DM
524	help
525	Generate udev events for DM events.
526
527config DM_FLAKEY
528       tristate "Flakey target"
529       depends on BLK_DEV_DM
530	help
531	 A target that intermittently fails I/O for debugging purposes.
532
533config DM_VERITY
534	tristate "Verity target support"
535	depends on BLK_DEV_DM
536	select CRYPTO
537	select CRYPTO_HASH
538	select DM_BUFIO
539	help
540	  This device-mapper target creates a read-only device that
541	  transparently validates the data on one underlying device against
542	  a pre-generated tree of cryptographic checksums stored on a second
543	  device.
544
545	  You'll need to activate the digests you're going to use in the
546	  cryptoapi configuration.
547
548	  To compile this code as a module, choose M here: the module will
549	  be called dm-verity.
550
551	  If unsure, say N.
552
553config DM_VERITY_VERIFY_ROOTHASH_SIG
554	bool "Verity data device root hash signature verification support"
555	depends on DM_VERITY
556	select SYSTEM_DATA_VERIFICATION
557	help
558	  Add ability for dm-verity device to be validated if the
559	  pre-generated tree of cryptographic checksums passed has a pkcs#7
560	  signature file that can validate the roothash of the tree.
561
562	  By default, rely on the builtin trusted keyring.
563
564	  If unsure, say N.
565
566config DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING
567	bool "Verity data device root hash signature verification with secondary keyring"
568	depends on DM_VERITY_VERIFY_ROOTHASH_SIG
569	depends on SECONDARY_TRUSTED_KEYRING
570	help
571	  Rely on the secondary trusted keyring to verify dm-verity signatures.
572
573	  If unsure, say N.
574
575config DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING
576	bool "Verity data device root hash signature verification with platform keyring"
577	default DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING
578	depends on DM_VERITY_VERIFY_ROOTHASH_SIG
579	depends on INTEGRITY_PLATFORM_KEYRING
580	help
581	  Rely also on the platform keyring to verify dm-verity signatures.
582
583	  If unsure, say N.
584
585config DM_VERITY_FEC
586	bool "Verity forward error correction support"
587	depends on DM_VERITY
588	select REED_SOLOMON
589	select REED_SOLOMON_DEC8
590	help
591	  Add forward error correction support to dm-verity. This option
592	  makes it possible to use pre-generated error correction data to
593	  recover from corrupted blocks.
594
595	  If unsure, say N.
596
597config DM_SWITCH
598	tristate "Switch target support (EXPERIMENTAL)"
599	depends on BLK_DEV_DM
600	help
601	  This device-mapper target creates a device that supports an arbitrary
602	  mapping of fixed-size regions of I/O across a fixed set of paths.
603	  The path used for any specific region can be switched dynamically
604	  by sending the target a message.
605
606	  To compile this code as a module, choose M here: the module will
607	  be called dm-switch.
608
609	  If unsure, say N.
610
611config DM_LOG_WRITES
612	tristate "Log writes target support"
613	depends on BLK_DEV_DM
614	help
615	  This device-mapper target takes two devices, one device to use
616	  normally, one to log all write operations done to the first device.
617	  This is for use by file system developers wishing to verify that
618	  their fs is writing a consistent file system at all times by allowing
619	  them to replay the log in a variety of ways and to check the
620	  contents.
621
622	  To compile this code as a module, choose M here: the module will
623	  be called dm-log-writes.
624
625	  If unsure, say N.
626
627config DM_INTEGRITY
628	tristate "Integrity target support"
629	depends on BLK_DEV_DM
630	select BLK_DEV_INTEGRITY
631	select DM_BUFIO
632	select CRYPTO
633	select CRYPTO_SKCIPHER
634	select ASYNC_XOR
635	select DM_AUDIT if AUDIT
636	help
637	  This device-mapper target emulates a block device that has
638	  additional per-sector tags that can be used for storing
639	  integrity information.
640
641	  This integrity target is used with the dm-crypt target to
642	  provide authenticated disk encryption or it can be used
643	  standalone.
644
645	  To compile this code as a module, choose M here: the module will
646	  be called dm-integrity.
647
648config DM_ZONED
649	tristate "Drive-managed zoned block device target support"
650	depends on BLK_DEV_DM
651	depends on BLK_DEV_ZONED
652	select CRC32
653	help
654	  This device-mapper target takes a host-managed or host-aware zoned
655	  block device and exposes most of its capacity as a regular block
656	  device (drive-managed zoned block device) without any write
657	  constraints. This is mainly intended for use with file systems that
658	  do not natively support zoned block devices but still want to
659	  benefit from the increased capacity offered by SMR disks. Other uses
660	  by applications using raw block devices (for example object stores)
661	  are also possible.
662
663	  To compile this code as a module, choose M here: the module will
664	  be called dm-zoned.
665
666	  If unsure, say N.
667
668config DM_AUDIT
669	bool "DM audit events"
670	depends on BLK_DEV_DM
671	depends on AUDIT
672	help
673	  Generate audit events for device-mapper.
674
675	  Enables audit logging of several security relevant events in the
676	  particular device-mapper targets, especially the integrity target.
677
678source "drivers/md/dm-vdo/Kconfig"
679
680endif # MD
681