Skip to content

Commit

Permalink
drbd: drbd_send_sync_param(): Return 0 upon success and an error code…
Browse files Browse the repository at this point in the history
… otherwise

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent f725446 commit 103ea27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 103ea27

Please sign in to comment.