提交 5b614abe 编写于 作者: A Andreas Gruenbacher 提交者: Philipp Reisner

drbd: Rename integrity_r_tfm -> peer_integrity_tfm

Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 8d412fc6
...@@ -850,7 +850,7 @@ struct drbd_tconn { /* is a resource from the config file */ ...@@ -850,7 +850,7 @@ struct drbd_tconn { /* is a resource from the config file */
struct crypto_hash *cram_hmac_tfm; struct crypto_hash *cram_hmac_tfm;
struct crypto_hash *integrity_tfm; /* checksums we compute */ struct crypto_hash *integrity_tfm; /* checksums we compute */
struct crypto_hash *integrity_r_tfm; /* to be used by the receiver thread */ struct crypto_hash *peer_integrity_tfm; /* checksums we verify */
struct crypto_hash *csums_tfm; struct crypto_hash *csums_tfm;
struct crypto_hash *verify_tfm; struct crypto_hash *verify_tfm;
void *int_dig_in; void *int_dig_in;
......
...@@ -1405,8 +1405,8 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -1405,8 +1405,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, void drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packet cmd,
struct p_data *dp, int data_size) struct p_data *dp, int data_size)
{ {
data_size -= (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->integrity_r_tfm) ? data_size -= (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->peer_integrity_tfm) ?
crypto_hash_digestsize(mdev->tconn->integrity_r_tfm) : 0; crypto_hash_digestsize(mdev->tconn->peer_integrity_tfm) : 0;
_drbd_send_ack(mdev, cmd, dp->sector, cpu_to_be32(data_size), _drbd_send_ack(mdev, cmd, dp->sector, cpu_to_be32(data_size),
dp->block_id); dp->block_id);
} }
...@@ -2407,7 +2407,7 @@ void conn_free_crypto(struct drbd_tconn *tconn) ...@@ -2407,7 +2407,7 @@ void conn_free_crypto(struct drbd_tconn *tconn)
crypto_free_hash(tconn->verify_tfm); crypto_free_hash(tconn->verify_tfm);
crypto_free_hash(tconn->cram_hmac_tfm); crypto_free_hash(tconn->cram_hmac_tfm);
crypto_free_hash(tconn->integrity_tfm); crypto_free_hash(tconn->integrity_tfm);
crypto_free_hash(tconn->integrity_r_tfm); crypto_free_hash(tconn->peer_integrity_tfm);
kfree(tconn->int_dig_in); kfree(tconn->int_dig_in);
kfree(tconn->int_dig_vv); kfree(tconn->int_dig_vv);
...@@ -2415,7 +2415,7 @@ void conn_free_crypto(struct drbd_tconn *tconn) ...@@ -2415,7 +2415,7 @@ void conn_free_crypto(struct drbd_tconn *tconn)
tconn->verify_tfm = NULL; tconn->verify_tfm = NULL;
tconn->cram_hmac_tfm = NULL; tconn->cram_hmac_tfm = NULL;
tconn->integrity_tfm = NULL; tconn->integrity_tfm = NULL;
tconn->integrity_r_tfm = NULL; tconn->peer_integrity_tfm = NULL;
tconn->int_dig_in = NULL; tconn->int_dig_in = NULL;
tconn->int_dig_vv = NULL; tconn->int_dig_vv = NULL;
} }
......
...@@ -1793,7 +1793,7 @@ struct crypto { ...@@ -1793,7 +1793,7 @@ struct crypto {
struct crypto_hash *csums_tfm; struct crypto_hash *csums_tfm;
struct crypto_hash *cram_hmac_tfm; struct crypto_hash *cram_hmac_tfm;
struct crypto_hash *integrity_tfm; struct crypto_hash *integrity_tfm;
struct crypto_hash *integrity_r_tfm; struct crypto_hash *peer_integrity_tfm;
void *int_dig_in; void *int_dig_in;
void *int_dig_vv; void *int_dig_vv;
}; };
...@@ -1835,7 +1835,7 @@ alloc_crypto(struct crypto *crypto, struct net_conf *new_conf) ...@@ -1835,7 +1835,7 @@ alloc_crypto(struct crypto *crypto, struct net_conf *new_conf)
ERR_INTEGRITY_ALG, ERR_INTEGRITY_ALG_ND); ERR_INTEGRITY_ALG, ERR_INTEGRITY_ALG_ND);
if (rv != NO_ERROR) if (rv != NO_ERROR)
return rv; return rv;
rv = alloc_tfm(&crypto->integrity_r_tfm, new_conf->integrity_alg, rv = alloc_tfm(&crypto->peer_integrity_tfm, new_conf->integrity_alg,
ERR_INTEGRITY_ALG, ERR_INTEGRITY_ALG_ND); ERR_INTEGRITY_ALG, ERR_INTEGRITY_ALG_ND);
if (rv != NO_ERROR) if (rv != NO_ERROR)
return rv; return rv;
...@@ -1865,7 +1865,7 @@ static void free_crypto(struct crypto *crypto) ...@@ -1865,7 +1865,7 @@ static void free_crypto(struct crypto *crypto)
kfree(crypto->int_dig_vv); kfree(crypto->int_dig_vv);
crypto_free_hash(crypto->cram_hmac_tfm); crypto_free_hash(crypto->cram_hmac_tfm);
crypto_free_hash(crypto->integrity_tfm); crypto_free_hash(crypto->integrity_tfm);
crypto_free_hash(crypto->integrity_r_tfm); crypto_free_hash(crypto->peer_integrity_tfm);
crypto_free_hash(crypto->csums_tfm); crypto_free_hash(crypto->csums_tfm);
crypto_free_hash(crypto->verify_tfm); crypto_free_hash(crypto->verify_tfm);
} }
...@@ -1958,8 +1958,8 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) ...@@ -1958,8 +1958,8 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
tconn->int_dig_vv = crypto.int_dig_vv; tconn->int_dig_vv = crypto.int_dig_vv;
crypto_free_hash(tconn->integrity_tfm); crypto_free_hash(tconn->integrity_tfm);
tconn->integrity_tfm = crypto.integrity_tfm; tconn->integrity_tfm = crypto.integrity_tfm;
crypto_free_hash(tconn->integrity_r_tfm); crypto_free_hash(tconn->peer_integrity_tfm);
tconn->integrity_r_tfm = crypto.integrity_r_tfm; tconn->peer_integrity_tfm = crypto.peer_integrity_tfm;
/* FIXME Changing cram_hmac while the connection is established is useless */ /* FIXME Changing cram_hmac while the connection is established is useless */
crypto_free_hash(tconn->cram_hmac_tfm); crypto_free_hash(tconn->cram_hmac_tfm);
...@@ -2084,7 +2084,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) ...@@ -2084,7 +2084,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info)
tconn->int_dig_vv = crypto.int_dig_vv; tconn->int_dig_vv = crypto.int_dig_vv;
tconn->cram_hmac_tfm = crypto.cram_hmac_tfm; tconn->cram_hmac_tfm = crypto.cram_hmac_tfm;
tconn->integrity_tfm = crypto.integrity_tfm; tconn->integrity_tfm = crypto.integrity_tfm;
tconn->integrity_r_tfm = crypto.integrity_r_tfm; tconn->peer_integrity_tfm = crypto.peer_integrity_tfm;
tconn->csums_tfm = crypto.csums_tfm; tconn->csums_tfm = crypto.csums_tfm;
tconn->verify_tfm = crypto.verify_tfm; tconn->verify_tfm = crypto.verify_tfm;
......
...@@ -1384,8 +1384,8 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, ...@@ -1384,8 +1384,8 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector,
void *dig_vv = mdev->tconn->int_dig_vv; void *dig_vv = mdev->tconn->int_dig_vv;
unsigned long *data; unsigned long *data;
dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->integrity_r_tfm) ? dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->peer_integrity_tfm) ?
crypto_hash_digestsize(mdev->tconn->integrity_r_tfm) : 0; crypto_hash_digestsize(mdev->tconn->peer_integrity_tfm) : 0;
if (dgs) { if (dgs) {
/* /*
...@@ -1442,7 +1442,7 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, ...@@ -1442,7 +1442,7 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector,
} }
if (dgs) { if (dgs) {
drbd_csum_ee(mdev, mdev->tconn->integrity_r_tfm, peer_req, dig_vv); drbd_csum_ee(mdev, mdev->tconn->peer_integrity_tfm, peer_req, dig_vv);
if (memcmp(dig_in, dig_vv, dgs)) { if (memcmp(dig_in, dig_vv, dgs)) {
dev_err(DEV, "Digest integrity check FAILED: %llus +%u\n", dev_err(DEV, "Digest integrity check FAILED: %llus +%u\n",
(unsigned long long)sector, data_size); (unsigned long long)sector, data_size);
...@@ -1491,8 +1491,8 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req, ...@@ -1491,8 +1491,8 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,
void *dig_in = mdev->tconn->int_dig_in; void *dig_in = mdev->tconn->int_dig_in;
void *dig_vv = mdev->tconn->int_dig_vv; void *dig_vv = mdev->tconn->int_dig_vv;
dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->integrity_r_tfm) ? dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->tconn->peer_integrity_tfm) ?
crypto_hash_digestsize(mdev->tconn->integrity_r_tfm) : 0; crypto_hash_digestsize(mdev->tconn->peer_integrity_tfm) : 0;
if (dgs) { if (dgs) {
err = drbd_recv_all_warn(mdev->tconn, dig_in, dgs); err = drbd_recv_all_warn(mdev->tconn, dig_in, dgs);
...@@ -1520,7 +1520,7 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req, ...@@ -1520,7 +1520,7 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,
} }
if (dgs) { if (dgs) {
drbd_csum_bio(mdev, mdev->tconn->integrity_r_tfm, bio, dig_vv); drbd_csum_bio(mdev, mdev->tconn->peer_integrity_tfm, bio, dig_vv);
if (memcmp(dig_in, dig_vv, dgs)) { if (memcmp(dig_in, dig_vv, dgs)) {
dev_err(DEV, "Digest integrity check FAILED. Broken NICs?\n"); dev_err(DEV, "Digest integrity check FAILED. Broken NICs?\n");
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册