summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher2011-04-28 21:47:21 +0200
committerPhilipp Reisner2012-11-08 16:52:59 +0100
commit88104ca458dff8ed7db935936b91b9af4422c9cd (patch)
treeeb6844263caa72ddf6406998e9f45d497506019e /drivers/block/drbd/drbd_main.c
parentdrbd: Introduce a "lockless" variant of drbd_send_protocoll() (diff)
downloadkernel-qcow2-linux-88104ca458dff8ed7db935936b91b9af4422c9cd.tar.gz
kernel-qcow2-linux-88104ca458dff8ed7db935936b91b9af4422c9cd.tar.xz
kernel-qcow2-linux-88104ca458dff8ed7db935936b91b9af4422c9cd.zip
drbd: Allow to change data-integrity-alg on the fly
The main purpose of this is to allow to turn data integrity checking on and off on demand without causing interruptions. Implemented by allocating tconn->peer_integrity_tfm only when receiving a P_PROTOCOL message. l accesses to tconn->peer_integrity_tf happen in worker context, and no further synchronization is necessary. On the sender side, tconn->integrity_tfm is modified under tconn->data.mutex, and a P_PROTOCOL message is sent whenever. All accesses to tconn->integrity_tfm already happen under this mutex. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r--drivers/block/drbd/drbd_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 3cb2af6c6069..a5c9b385223a 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1433,8 +1433,8 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,
void drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packet cmd,
struct p_data *dp, int data_size)
{
- data_size -= (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->peer_integrity_tfm) ?
- crypto_hash_digestsize(mdev->tconn->peer_integrity_tfm) : 0;
+ if (mdev->tconn->peer_integrity_tfm)
+ data_size -= crypto_hash_digestsize(mdev->tconn->peer_integrity_tfm);
_drbd_send_ack(mdev, cmd, dp->sector, cpu_to_be32(data_size),
dp->block_id);
}