Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345894
b: refs/heads/master
c: 927036f
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent efb8e66 commit 6a6bbbd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 103ea275285970568cbc07ce01063aa69bac5577
refs/heads/master: 927036f9089d9c776217656960b2352971cc2ea0
6 changes: 3 additions & 3 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,19 +974,19 @@ int drbd_send_state(struct drbd_conf *mdev)
{
struct socket *sock;
struct p_state p;
int ok = 0;
int err = -EIO;

mutex_lock(&mdev->tconn->data.mutex);

p.state = cpu_to_be32(mdev->state.i); /* Within the send 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,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ int drbd_connected(int vnr, void *p, void *data)
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);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/block/drbd/drbd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
"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");
Expand Down Expand Up @@ -1220,7 +1220,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
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. */
Expand Down

0 comments on commit 6a6bbbd

Please sign in to comment.