162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci#
362306a36Sopenharmony_ci# DRBD device driver configuration
462306a36Sopenharmony_ci#
562306a36Sopenharmony_ci
662306a36Sopenharmony_cicomment "DRBD disabled because PROC_FS or INET not selected"
762306a36Sopenharmony_ci	depends on PROC_FS='n' || INET='n'
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciconfig BLK_DEV_DRBD
1062306a36Sopenharmony_ci	tristate "DRBD Distributed Replicated Block Device support"
1162306a36Sopenharmony_ci	depends on PROC_FS && INET
1262306a36Sopenharmony_ci	select LRU_CACHE
1362306a36Sopenharmony_ci	select LIBCRC32C
1462306a36Sopenharmony_ci	help
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci	  NOTE: In order to authenticate connections you have to select
1762306a36Sopenharmony_ci	  CRYPTO_HMAC and a hash function as well.
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci	  DRBD is a shared-nothing, synchronously replicated block device. It
2062306a36Sopenharmony_ci	  is designed to serve as a building block for high availability
2162306a36Sopenharmony_ci	  clusters and in this context, is a "drop-in" replacement for shared
2262306a36Sopenharmony_ci	  storage. Simplistically, you could see it as a network RAID 1.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci	  Each minor device has a role, which can be 'primary' or 'secondary'.
2562306a36Sopenharmony_ci	  On the node with the primary device the application is supposed to
2662306a36Sopenharmony_ci	  run and to access the device (/dev/drbdX). Every write is sent to
2762306a36Sopenharmony_ci	  the local 'lower level block device' and, across the network, to the
2862306a36Sopenharmony_ci	  node with the device in 'secondary' state.  The secondary device
2962306a36Sopenharmony_ci	  simply writes the data to its lower level block device.
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci	  DRBD can also be used in dual-Primary mode (device writable on both
3262306a36Sopenharmony_ci	  nodes), which means it can exhibit shared disk semantics in a
3362306a36Sopenharmony_ci	  shared-nothing cluster.  Needless to say, on top of dual-Primary
3462306a36Sopenharmony_ci	  DRBD utilizing a cluster file system is necessary to maintain for
3562306a36Sopenharmony_ci	  cache coherency.
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci	  For automatic failover you need a cluster manager (e.g. heartbeat).
3862306a36Sopenharmony_ci	  See also: https://www.drbd.org/, http://www.linux-ha.org
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci	  If unsure, say N.
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciconfig DRBD_FAULT_INJECTION
4362306a36Sopenharmony_ci	bool "DRBD fault injection"
4462306a36Sopenharmony_ci	depends on BLK_DEV_DRBD
4562306a36Sopenharmony_ci	help
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci	  Say Y here if you want to simulate IO errors, in order to test DRBD's
4862306a36Sopenharmony_ci	  behavior.
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci	  The actual simulation of IO errors is done by writing 3 values to
5162306a36Sopenharmony_ci	  /sys/module/drbd/parameters/
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci	  enable_faults: bitmask of...
5462306a36Sopenharmony_ci	  1	meta data write
5562306a36Sopenharmony_ci	  2               read
5662306a36Sopenharmony_ci	  4	resync data write
5762306a36Sopenharmony_ci	  8	            read
5862306a36Sopenharmony_ci	  16	data write
5962306a36Sopenharmony_ci	  32	data read
6062306a36Sopenharmony_ci	  64	read ahead
6162306a36Sopenharmony_ci	  128	kmalloc of bitmap
6262306a36Sopenharmony_ci	  256	allocation of peer_requests
6362306a36Sopenharmony_ci	  512	insert data corruption on receiving side
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci	  fault_devs: bitmask of minor numbers
6662306a36Sopenharmony_ci	  fault_rate: frequency in percent
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci	  Example: Simulate data write errors on /dev/drbd0 with a probability of 5%.
6962306a36Sopenharmony_ci		echo 16 > /sys/module/drbd/parameters/enable_faults
7062306a36Sopenharmony_ci		echo 1 > /sys/module/drbd/parameters/fault_devs
7162306a36Sopenharmony_ci		echo 5 > /sys/module/drbd/parameters/fault_rate
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci	  If unsure, say N.
74