xref: /OK3568_Linux_fs/kernel/drivers/block/drbd/Kconfig (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# DRBD device driver configuration
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun
6*4882a593Smuzhiyuncomment "DRBD disabled because PROC_FS or INET not selected"
7*4882a593Smuzhiyun	depends on PROC_FS='n' || INET='n'
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunconfig BLK_DEV_DRBD
10*4882a593Smuzhiyun	tristate "DRBD Distributed Replicated Block Device support"
11*4882a593Smuzhiyun	depends on PROC_FS && INET
12*4882a593Smuzhiyun	select LRU_CACHE
13*4882a593Smuzhiyun	select LIBCRC32C
14*4882a593Smuzhiyun	help
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun	  NOTE: In order to authenticate connections you have to select
17*4882a593Smuzhiyun	  CRYPTO_HMAC and a hash function as well.
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun	  DRBD is a shared-nothing, synchronously replicated block device. It
20*4882a593Smuzhiyun	  is designed to serve as a building block for high availability
21*4882a593Smuzhiyun	  clusters and in this context, is a "drop-in" replacement for shared
22*4882a593Smuzhiyun	  storage. Simplistically, you could see it as a network RAID 1.
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun	  Each minor device has a role, which can be 'primary' or 'secondary'.
25*4882a593Smuzhiyun	  On the node with the primary device the application is supposed to
26*4882a593Smuzhiyun	  run and to access the device (/dev/drbdX). Every write is sent to
27*4882a593Smuzhiyun	  the local 'lower level block device' and, across the network, to the
28*4882a593Smuzhiyun	  node with the device in 'secondary' state.  The secondary device
29*4882a593Smuzhiyun	  simply writes the data to its lower level block device.
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun	  DRBD can also be used in dual-Primary mode (device writable on both
32*4882a593Smuzhiyun	  nodes), which means it can exhibit shared disk semantics in a
33*4882a593Smuzhiyun	  shared-nothing cluster.  Needless to say, on top of dual-Primary
34*4882a593Smuzhiyun	  DRBD utilizing a cluster file system is necessary to maintain for
35*4882a593Smuzhiyun	  cache coherency.
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun	  For automatic failover you need a cluster manager (e.g. heartbeat).
38*4882a593Smuzhiyun	  See also: https://www.drbd.org/, http://www.linux-ha.org
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun	  If unsure, say N.
41*4882a593Smuzhiyun
42*4882a593Smuzhiyunconfig DRBD_FAULT_INJECTION
43*4882a593Smuzhiyun	bool "DRBD fault injection"
44*4882a593Smuzhiyun	depends on BLK_DEV_DRBD
45*4882a593Smuzhiyun	help
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun	  Say Y here if you want to simulate IO errors, in order to test DRBD's
48*4882a593Smuzhiyun	  behavior.
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun	  The actual simulation of IO errors is done by writing 3 values to
51*4882a593Smuzhiyun	  /sys/module/drbd/parameters/
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun	  enable_faults: bitmask of...
54*4882a593Smuzhiyun	  1	meta data write
55*4882a593Smuzhiyun	  2               read
56*4882a593Smuzhiyun	  4	resync data write
57*4882a593Smuzhiyun	  8	            read
58*4882a593Smuzhiyun	  16	data write
59*4882a593Smuzhiyun	  32	data read
60*4882a593Smuzhiyun	  64	read ahead
61*4882a593Smuzhiyun	  128	kmalloc of bitmap
62*4882a593Smuzhiyun	  256	allocation of peer_requests
63*4882a593Smuzhiyun	  512	insert data corruption on receiving side
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun	  fault_devs: bitmask of minor numbers
66*4882a593Smuzhiyun	  fault_rate: frequency in percent
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun	  Example: Simulate data write errors on /dev/drbd0 with a probability of 5%.
69*4882a593Smuzhiyun		echo 16 > /sys/module/drbd/parameters/enable_faults
70*4882a593Smuzhiyun		echo 1 > /sys/module/drbd/parameters/fault_devs
71*4882a593Smuzhiyun		echo 5 > /sys/module/drbd/parameters/fault_rate
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun	  If unsure, say N.
74