Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346071
b: refs/heads/master
c: d659f2a
h: refs/heads/master
i:
  346069: 34b7d08
  346067: 3560614
  346063: b651c91
v: v3
  • Loading branch information
Philipp Reisner committed Nov 8, 2012
1 parent 3eed8ac commit 0e30867
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 036b17eaab935541835f4cc1fcbfe62ead5faa55
refs/heads/master: d659f2aaea1bd2fe9cf68b33d881470678c6ce2b
2 changes: 1 addition & 1 deletion trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ extern int drbd_send(struct drbd_tconn *tconn, struct socket *sock,
extern int drbd_send_all(struct drbd_tconn *, struct socket *, void *, size_t,
unsigned);

extern int __drbd_send_protocol(struct drbd_tconn *tconn);
extern int __drbd_send_protocol(struct drbd_tconn *tconn, enum drbd_packet cmd);
extern int drbd_send_protocol(struct drbd_tconn *tconn);
extern int drbd_send_uuids(struct drbd_conf *mdev);
extern int drbd_send_uuids_skip_initial_sync(struct drbd_conf *mdev);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ int drbd_send_sync_param(struct drbd_conf *mdev)
return drbd_send_command(mdev, sock, cmd, size, NULL, 0);
}

int __drbd_send_protocol(struct drbd_tconn *tconn)
int __drbd_send_protocol(struct drbd_tconn *tconn, enum drbd_packet cmd)
{
struct drbd_socket *sock;
struct p_protocol *p;
Expand Down Expand Up @@ -953,15 +953,15 @@ int __drbd_send_protocol(struct drbd_tconn *tconn)
strcpy(p->integrity_alg, nc->integrity_alg);
rcu_read_unlock();

return __conn_send_command(tconn, sock, P_PROTOCOL, size, NULL, 0);
return __conn_send_command(tconn, sock, cmd, size, NULL, 0);
}

int drbd_send_protocol(struct drbd_tconn *tconn)
{
int err;

mutex_lock(&tconn->data.mutex);
err = __drbd_send_protocol(tconn);
err = __drbd_send_protocol(tconn, P_PROTOCOL);
mutex_unlock(&tconn->data.mutex);

return err;
Expand Down
11 changes: 2 additions & 9 deletions trunk/drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,6 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
int ovr; /* online verify running */
int rsr; /* re-sync running */
struct crypto crypto = { };
bool change_integrity_alg;

retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_CONN);
if (!adm_ctx.reply_skb)
Expand Down Expand Up @@ -1923,9 +1922,6 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
goto fail;
}

change_integrity_alg = strcmp(old_conf->integrity_alg,
new_conf->integrity_alg);

retcode = alloc_crypto(&crypto, new_conf);
if (retcode != NO_ERROR)
goto fail;
Expand All @@ -1949,13 +1945,10 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
tconn->int_dig_vv = crypto.int_dig_vv;
crypto_free_hash(tconn->integrity_tfm);
tconn->integrity_tfm = crypto.integrity_tfm;
if (change_integrity_alg) {
if (tconn->cstate >= C_WF_REPORT_PARAMS && tconn->agreed_pro_version >= 100)
/* Do this without trying to take tconn->data.mutex again. */
if (__drbd_send_protocol(tconn))
goto fail;
}
__drbd_send_protocol(tconn, P_PROTOCOL_UPDATE);

/* FIXME Changing cram_hmac while the connection is established is useless */
crypto_free_hash(tconn->cram_hmac_tfm);
tconn->cram_hmac_tfm = crypto.cram_hmac_tfm;

Expand Down

0 comments on commit 0e30867

Please sign in to comment.