{
struct socket *sock;
struct p_state p;
- int ok = 0;
+ int err = -EIO;
mutex_lock(&mdev->tconn->data.mutex);
sock = mdev->tconn->data.socket;
if (likely(sock != NULL))
- ok = !_drbd_send_cmd(mdev, sock, P_STATE, &p.head, sizeof(p), 0);
+ err = _drbd_send_cmd(mdev, sock, P_STATE, &p.head, sizeof(p), 0);
mutex_unlock(&mdev->tconn->data.mutex);
- return ok;
+ return err;
}
int _conn_send_state_req(struct drbd_tconn *tconn, int vnr, enum drbd_packet cmd,
ok &= !drbd_send_sync_param(mdev);
ok &= drbd_send_sizes(mdev, 0, 0);
ok &= drbd_send_uuids(mdev);
- ok &= drbd_send_state(mdev);
+ ok &= !drbd_send_state(mdev);
clear_bit(USE_DEGR_WFC_T, &mdev->flags);
clear_bit(RESIZE_PENDING, &mdev->flags);
"ASSERT FAILED: disk is %s during detach\n",
drbd_disk_str(mdev->state.disk));
- if (drbd_send_state(mdev))
+ if (!drbd_send_state(mdev))
dev_warn(DEV, "Notified peer that I am detaching my disk\n");
else
dev_err(DEV, "Sending state for detaching disk failed\n");
mdev->rs_failed = 0;
atomic_set(&mdev->rs_pending_cnt, 0);
- if (drbd_send_state(mdev))
+ if (!drbd_send_state(mdev))
dev_warn(DEV, "Notified peer that I'm now diskless.\n");
/* corresponding get_ldev in __drbd_set_state
* this may finally trigger drbd_ldev_destroy. */