summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* drbd: allow ping-timeout of up to 30 secondsLars Ellenberg2012-11-081-1/+1
| | | | | | | | | | Allow up to 300 centi-seconds to be configured for the "ping timeout". There may be setups where heavy congestion, huge buffers, and asymmetric bandwidth limitations may need a "huge" ping-timeout as work-around for "spurious connection loss" problems. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* DRBD: Fix comparison always false warning due to long/long long compareDavid Howells2012-11-081-1/+1
| | | | | | | | | | | | | | Fix warnings of the following nature in the drbd header: In file included from drivers/block/drbd/drbd_bitmap.c:32: drivers/block/drbd/drbd_int.h: In function 'drbd_get_syncer_progress': drivers/block/drbd/drbd_int.h:2234: warning: comparison is always false due to limited range of data where mdev->rs_total (an unsigned long) is being compared to 1ULL << 32, which is always false on a 32-bit machine. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Rename --dry-run to --tentativeAndreas Gruenbacher2012-11-083-6/+6
| | | | | | | | | | | drbdadm already has a --dry-run option, so this option cannot directly be passed through to drbdsetup. Rename the drbdsetup option to resolve this conflict. For backward compatibility, make --dry-run an alias of --tentative. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Remove dead codeAndreas Gruenbacher2012-11-081-12/+0
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Allow to pass resource options to the new-resource commandAndreas Gruenbacher2012-11-083-40/+61
| | | | | | | This is equivalent to how the attach and connect commands work. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Convert the generic netlink interface to accept connection endpointsAndreas Gruenbacher2012-11-086-107/+164
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Rename DRBD_ADM_NEED_{CONN -> RESOURCE}Andreas Gruenbacher2012-11-081-11/+11
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Split off netlink mandatory attribute handling into separate fileAndreas Gruenbacher2012-11-086-56/+66
| | | | | | | Duplicate this file in the kernel module and in user space; both sides need it. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Also need to check for DRBD_GENLA_F_MANDATORY flags before ↵Andreas Gruenbacher2012-11-084-58/+83
| | | | | | | | | | nla_find_nested() This is done by introducing drbd_nla_find_nested() which handles the flag before calling nla_find_nested(). Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Use the terminology suggested by the command names in the source code ↵Andreas Gruenbacher2012-11-083-23/+14
| | | | | | | and messages Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: spelling fix: too smallLars Ellenberg2012-11-082-6/+6
| | | | | | | It is not "to small", but "too small". Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: cosmetic: fix accidental division instead of modulo when pretty printingLars Ellenberg2012-11-081-1/+1
| | | | | | | | For large resync rates, seq_printf_with_thousands_grouping() accidentally only produced Y,000,00Y, instead of the real numbers. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Use DRBD_MINOR_COUNT_DEF in one more placeAndreas Gruenbacher2012-11-081-1/+1
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Lower log priority for an event that is definitely not an errorPhilipp Reisner2012-11-081-1/+1
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Don't use empty nested netlink attributesAndreas Gruenbacher2012-11-081-3/+3
| | | | | | | | | Before mainline commit ea5693cc (v2.6.29-rc1), empty nested netlink attributes were not allowed. Fix that by leaving out nested attributes if they are empty and by allowing the top-level attributes to be missing. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: drbd_adm_prepare(): Pass through error codesAndreas Gruenbacher2012-11-081-3/+7
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: drbd_nla_check_mandatory(): Need to remove the DRBD_GENLA_F_MANDATORY ↵Andreas Gruenbacher2012-11-081-1/+1
| | | | | | | | | flag first We need to remove the flag before checking for valid types. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Make drbd's use of netlink attribute flags less confusingAndreas Gruenbacher2012-11-083-222/+193
| | | | | | | | | | | | | | | Make it more clear in the flag names which flags are internal to drbd, and which are not. The check for mandatory attributes is the only extension visible at the netlink layer. Attributes with this flag set would look like unknown attributes to some kernel versions. The netlink layer would ignore them and also skip consistency checks on the attribute type and legth. To avoid this, we check for mandatory attributes first, remove the mandatory flag, and then process the attributes normally. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Remove unused GENLA_F_MAY_IGNORE flagAndreas Gruenbacher2012-11-081-6/+0
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Output signed / unsigned netlink fields correctlyAndreas Gruenbacher2012-11-082-22/+53
| | | | | | | | Note: All input values are still treated as signed; unsigned long long values are still broken. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Use more generic constant namesAndreas Gruenbacher2012-11-081-4/+4
| | | | | | | These constants are useful for the same purpose in more than one place. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Send PROTOCOL_UPDATE packets when appropriatePhilipp Reisner2012-11-083-13/+6
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Receiving part for the PROTOCOL_UPDATE packetPhilipp Reisner2012-11-083-15/+63
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Allocation of int_dig_in and int_dig_vv was missingPhilipp Reisner2012-11-081-0/+15
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Made cmp_after_sb() more generic into convert_after_sb()Philipp Reisner2012-11-081-16/+9
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: protect updates to integrits_tfm by tconn->data->mutexPhilipp Reisner2012-11-082-5/+6
| | | | | | | | | | Since we need to hold that mutex anyways to make sure the peer gets that change in the right position in the data stream, it makes a lot of sense to use the same mutex to ensure existence of the tfm. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Refuse to change network options online when...Philipp Reisner2012-11-082-4/+19
| | | | | | | | | | | | | | * the peer does not speak protocol_version 100 and the user wants to change one of: - wire_protocol - two_primaries - integrity_alg * the user wants to remove the allow_two_primaries flag when there are two primaries Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Rename DISK_SIZE_SECT -> DISK_SIZEAndreas Gruenbacher2012-11-081-3/+4
| | | | | | | We don't have the units in constant names in other places, either. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Convert resync-after into a signed netlink fieldAndreas Gruenbacher2012-11-083-1/+6
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Fix the upper limit of resync-afterAndreas Gruenbacher2012-11-086-23/+24
| | | | | | | | | | The 32-bit resync_after netlink field takes a device minor number as parameter, which is no longer limited to 255. We cannot statically verify which device numbers are valid, so set the ummer limit to the highest possible signed 32-bit integer. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Refer to connect-int consistently throughout the codeAndreas Gruenbacher2012-11-082-7/+7
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Refer to resync-rate consistently throughout the codeAndreas Gruenbacher2012-11-085-10/+11
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: skip spurious wait_event in drbd_al_begin_ioLars Ellenberg2012-11-081-8/+10
| | | | | | | | | | | | | | | | | | | Activity log transaction writes are serialized on a bit lock. If several CPUs race to write an AL transaction, those that did not get the lock the first time may continue as soon as there are no more pending transactions. The do not need to all grab the lock in turn, just to realize that the AL is clean already, and they have nothing to do. This also closes a potential deadlock with drbd_adm_disk_opts. Once it got the AL bit lock, it knows there are no pending transactions, the AL is clean, and it should be safe to wait for all element references to drop to zero. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Rename the want_lose field/flag to discard_my_dataAndreas Gruenbacher2012-11-085-14/+14
| | | | | | | | This is what it is called in config files and on the command line as well. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Also define the default values of boolean flags in a single placeAndreas Gruenbacher2012-11-082-8/+18
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Make broadcast events return NO_ERRORAndreas Gruenbacher2012-11-081-1/+1
| | | | | | | | | Instead of returning a ret_code outside of the range of enum drbd_ret_code, use NO_ERROR to indicate success. This way, ret_code has the same meaning in all packets. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Removing drbd_cfg_rwsemPhilipp Reisner2012-11-086-75/+72
| | | | | | | | | | | * Updates to all configuration items is done under genl_lock(). Including removal of mdevs or tconns. * All read non sleeping read sides are protected by rcu * All sleeping read sides keep reference counts to keep the objects alive Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Use RCU for the drbd_tconns listPhilipp Reisner2012-11-082-8/+11
| | | | | | | Preparing removal of drbd_cfg_rwsem Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Refcounting for mdev objectsPhilipp Reisner2012-11-084-19/+31
| | | | | | | Preparing removal of drbd_cfg_rwsem Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Turn no-tcp-cork into tcp-cork={yes|no}Andreas Gruenbacher2012-11-083-6/+6
| | | | | | | | Change the --no-tcp-cork drbdsetup command line option as well as the no_cork netlink packet. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Turn no-md-flushes into md-flushes={yes|no}Andreas Gruenbacher2012-11-082-4/+4
| | | | | | | | Change the --no-md-flushes drbdsetup command line option as well as the no_md_flush netlink packet. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Turn no-disk-drain into disk-drain={yes|no}Andreas Gruenbacher2012-11-082-2/+2
| | | | | | | | Change the --no-disk-drain drbdsetup command line option as well as the no_disk_drain netlink packet. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Turn no-disk-flushes into disk-flushes={yes|no}Andreas Gruenbacher2012-11-082-3/+3
| | | | | | | | Change the --no-disk-flushes drbdsetup command line option as well as the no_disk_flush netlink packet. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Convert boolean flags on netlink from NLA_FLAG to NLA_U8Andreas Gruenbacher2012-11-081-8/+2
| | | | | | | | | | | | Flags of type NLA_FLAG are either present or absent, but do not have a value by themselves. Use type NLA_U8 for our boolean flags instead, and use the value to determine if the flag should be on or off. On the drbdsetup command line, all those flags have an optional yes/no argument which defaults to yes. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: RCU for rs_plan_sPhilipp Reisner2012-11-084-55/+77
| | | | | | | | This removes the issue with using peer_seq_lock out of different contexts. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Enforce limits of disk_conf members; centralized these checksPhilipp Reisner2012-11-081-10/+14
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Made the fifo object a self contained object (preparing for RCU)Philipp Reisner2012-11-085-31/+57
| | | | | | | | | * Moved rs_planed into it, named total * When having a pointer to the object the values can be embedded into the fifo object. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: RCU for disk_confPhilipp Reisner2012-11-086-133/+282
| | | | | Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Introduce __s32_field in the genetlink macro magicLars Ellenberg2012-11-083-5/+8
| | | | | | | ...and drop explicit typecasts (int)meta_dev_idx < 0. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
* drbd: Renamed (old|new)_conf into (old|new)_net_conf in receive_SyncParamPhilipp Reisner2012-11-081-16/+16
| | | | | | | Preparing RCU for disk_conf Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
OpenPOWER on IntegriCloud