18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci#
38c2ecf20Sopenharmony_ci# DRBD device driver configuration
48c2ecf20Sopenharmony_ci#
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_cicomment "DRBD disabled because PROC_FS or INET not selected"
78c2ecf20Sopenharmony_ci	depends on PROC_FS='n' || INET='n'
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciconfig BLK_DEV_DRBD
108c2ecf20Sopenharmony_ci	tristate "DRBD Distributed Replicated Block Device support"
118c2ecf20Sopenharmony_ci	depends on PROC_FS && INET
128c2ecf20Sopenharmony_ci	select LRU_CACHE
138c2ecf20Sopenharmony_ci	select LIBCRC32C
148c2ecf20Sopenharmony_ci	help
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci	  NOTE: In order to authenticate connections you have to select
178c2ecf20Sopenharmony_ci	  CRYPTO_HMAC and a hash function as well.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci	  DRBD is a shared-nothing, synchronously replicated block device. It
208c2ecf20Sopenharmony_ci	  is designed to serve as a building block for high availability
218c2ecf20Sopenharmony_ci	  clusters and in this context, is a "drop-in" replacement for shared
228c2ecf20Sopenharmony_ci	  storage. Simplistically, you could see it as a network RAID 1.
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci	  Each minor device has a role, which can be 'primary' or 'secondary'.
258c2ecf20Sopenharmony_ci	  On the node with the primary device the application is supposed to
268c2ecf20Sopenharmony_ci	  run and to access the device (/dev/drbdX). Every write is sent to
278c2ecf20Sopenharmony_ci	  the local 'lower level block device' and, across the network, to the
288c2ecf20Sopenharmony_ci	  node with the device in 'secondary' state.  The secondary device
298c2ecf20Sopenharmony_ci	  simply writes the data to its lower level block device.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci	  DRBD can also be used in dual-Primary mode (device writable on both
328c2ecf20Sopenharmony_ci	  nodes), which means it can exhibit shared disk semantics in a
338c2ecf20Sopenharmony_ci	  shared-nothing cluster.  Needless to say, on top of dual-Primary
348c2ecf20Sopenharmony_ci	  DRBD utilizing a cluster file system is necessary to maintain for
358c2ecf20Sopenharmony_ci	  cache coherency.
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci	  For automatic failover you need a cluster manager (e.g. heartbeat).
388c2ecf20Sopenharmony_ci	  See also: https://www.drbd.org/, http://www.linux-ha.org
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci	  If unsure, say N.
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ciconfig DRBD_FAULT_INJECTION
438c2ecf20Sopenharmony_ci	bool "DRBD fault injection"
448c2ecf20Sopenharmony_ci	depends on BLK_DEV_DRBD
458c2ecf20Sopenharmony_ci	help
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci	  Say Y here if you want to simulate IO errors, in order to test DRBD's
488c2ecf20Sopenharmony_ci	  behavior.
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci	  The actual simulation of IO errors is done by writing 3 values to
518c2ecf20Sopenharmony_ci	  /sys/module/drbd/parameters/
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci	  enable_faults: bitmask of...
548c2ecf20Sopenharmony_ci	  1	meta data write
558c2ecf20Sopenharmony_ci	  2               read
568c2ecf20Sopenharmony_ci	  4	resync data write
578c2ecf20Sopenharmony_ci	  8	            read
588c2ecf20Sopenharmony_ci	  16	data write
598c2ecf20Sopenharmony_ci	  32	data read
608c2ecf20Sopenharmony_ci	  64	read ahead
618c2ecf20Sopenharmony_ci	  128	kmalloc of bitmap
628c2ecf20Sopenharmony_ci	  256	allocation of peer_requests
638c2ecf20Sopenharmony_ci	  512	insert data corruption on receiving side
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	  fault_devs: bitmask of minor numbers
668c2ecf20Sopenharmony_ci	  fault_rate: frequency in percent
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci	  Example: Simulate data write errors on /dev/drbd0 with a probability of 5%.
698c2ecf20Sopenharmony_ci		echo 16 > /sys/module/drbd/parameters/enable_faults
708c2ecf20Sopenharmony_ci		echo 1 > /sys/module/drbd/parameters/fault_devs
718c2ecf20Sopenharmony_ci		echo 5 > /sys/module/drbd/parameters/fault_rate
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci	  If unsure, say N.
74