From: Andreas Gruenbacher Date: Tue, 15 Mar 2011 23:43:02 +0000 (+0100) Subject: drbd: drbd_send_sync_param(): Return 0 upon success and an error code otherwise X-Git-Tag: firefly_0821_release~3680^2~1419^2~18^2~381 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=103ea275285970568cbc07ce01063aa69bac5577;p=firefly-linux-kernel-4.4.55.git drbd: drbd_send_sync_param(): Return 0 upon success and an error code otherwise Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index e41fffbfd679..80cfd3020711 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -769,7 +769,7 @@ int drbd_send_sync_param(struct drbd_conf *mdev) { struct p_rs_param_95 *p; struct socket *sock; - int size, rv; + int size, err; const int apv = mdev->tconn->agreed_pro_version; size = apv <= 87 ? sizeof(struct p_rs_param) @@ -813,13 +813,13 @@ int drbd_send_sync_param(struct drbd_conf *mdev) if (apv >= 89) 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 - rv = 0; /* not ok */ + err = -EIO; mutex_unlock(&mdev->tconn->data.mutex); - return rv; + return err; } int drbd_send_protocol(struct drbd_tconn *tconn) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index d21c2ffe6c6f..c35be86b121e 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -763,7 +763,7 @@ int drbd_connected(int vnr, void *p, void *data) &mdev->tconn->cstate_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_uuids(mdev); ok &= drbd_send_state(mdev);