Commit 103ea275 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: drbd_send_sync_param(): Return 0 upon success and an error code otherwise

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent f7254463
...@@ -769,7 +769,7 @@ int drbd_send_sync_param(struct drbd_conf *mdev) ...@@ -769,7 +769,7 @@ int drbd_send_sync_param(struct drbd_conf *mdev)
{ {
struct p_rs_param_95 *p; struct p_rs_param_95 *p;
struct socket *sock; struct socket *sock;
int size, rv; int size, err;
const int apv = mdev->tconn->agreed_pro_version; const int apv = mdev->tconn->agreed_pro_version;
size = apv <= 87 ? sizeof(struct p_rs_param) size = apv <= 87 ? sizeof(struct p_rs_param)
...@@ -813,13 +813,13 @@ int drbd_send_sync_param(struct drbd_conf *mdev) ...@@ -813,13 +813,13 @@ int drbd_send_sync_param(struct drbd_conf *mdev)
if (apv >= 89) if (apv >= 89)
strcpy(p->csums_alg, mdev->tconn->net_conf->csums_alg); strcpy(p->csums_alg, mdev->tconn->net_conf->csums_alg);
rv = !_drbd_send_cmd(mdev, sock, cmd, &p->head, size, 0); err = _drbd_send_cmd(mdev, sock, cmd, &p->head, size, 0);
} else } else
rv = 0; /* not ok */ err = -EIO;
mutex_unlock(&mdev->tconn->data.mutex); mutex_unlock(&mdev->tconn->data.mutex);
return rv; return err;
} }
int drbd_send_protocol(struct drbd_tconn *tconn) int drbd_send_protocol(struct drbd_tconn *tconn)
......
...@@ -763,7 +763,7 @@ int drbd_connected(int vnr, void *p, void *data) ...@@ -763,7 +763,7 @@ int drbd_connected(int vnr, void *p, void *data)
&mdev->tconn->cstate_mutex : &mdev->tconn->cstate_mutex :
&mdev->own_state_mutex; &mdev->own_state_mutex;
ok &= drbd_send_sync_param(mdev); ok &= !drbd_send_sync_param(mdev);
ok &= drbd_send_sizes(mdev, 0, 0); ok &= drbd_send_sizes(mdev, 0, 0);
ok &= drbd_send_uuids(mdev); ok &= drbd_send_uuids(mdev);
ok &= drbd_send_state(mdev); ok &= drbd_send_state(mdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment