From: Andreas Gruenbacher Date: Thu, 24 Mar 2011 13:31:22 +0000 (+0100) Subject: drbd: drbd_connected(): Return an error code upon failure. X-Git-Tag: firefly_0821_release~3680^2~1419^2~18^2~334 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0829f5edf37cb1731e97066288f520de85b7b5e5;p=firefly-linux-kernel-4.4.55.git drbd: drbd_connected(): Return an error code upon failure. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 208a2ec54935..6a3e628b68c6 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -781,7 +781,7 @@ static int drbd_socket_okay(struct socket **sock) int drbd_connected(int vnr, void *p, void *data) { struct drbd_conf *mdev = (struct drbd_conf *)p; - int ok = 1; + int err; atomic_set(&mdev->packet_seq, 0); mdev->peer_seq = 0; @@ -790,15 +790,16 @@ 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_sizes(mdev, 0, 0); - ok &= !drbd_send_uuids(mdev); - ok &= !drbd_send_state(mdev); + err = drbd_send_sync_param(mdev); + if (!err) + err = drbd_send_sizes(mdev, 0, 0); + if (!err) + err = drbd_send_uuids(mdev); + if (!err) + err = drbd_send_state(mdev); clear_bit(USE_DEGR_WFC_T, &mdev->flags); clear_bit(RESIZE_PENDING, &mdev->flags); - - - return !ok; + return err; } /*