Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345916
b: refs/heads/master
c: 7b57b89
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent 9705b11 commit f9534e5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 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: 9f69230cd6e8dc87bf6b55e46c51418a2b6ac322
refs/heads/master: 7b57b89d624cfdefc91d0a8b015c494c25a49292
23 changes: 12 additions & 11 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)
int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd,
struct drbd_peer_request *peer_req)
{
int ok;
int err;
struct p_data p;
void *dgb;
int dgs;
Expand All @@ -1627,21 +1627,22 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd,
* This one may be interrupted by DRBD_SIG and/or DRBD_SIGKILL
* in response to admin command or module unload.
*/
if (drbd_get_data_sock(mdev->tconn))
return 0;

ok = sizeof(p) == drbd_send(mdev->tconn, mdev->tconn->data.socket, &p, sizeof(p), dgs ? MSG_MORE : 0);
if (ok && dgs) {
err = drbd_get_data_sock(mdev->tconn);
if (err)
return err;
err = drbd_send_all(mdev->tconn, mdev->tconn->data.socket, &p,
sizeof(p), dgs ? MSG_MORE : 0);
if (!err && dgs) {
dgb = mdev->tconn->int_dig_out;
drbd_csum_ee(mdev, mdev->tconn->integrity_w_tfm, peer_req, dgb);
ok = dgs == drbd_send(mdev->tconn, mdev->tconn->data.socket, dgb, dgs, 0);
err = drbd_send_all(mdev->tconn, mdev->tconn->data.socket, dgb,
dgs, 0);
}
if (ok)
ok = !_drbd_send_zc_ee(mdev, peer_req);

if (!err)
err = _drbd_send_zc_ee(mdev, peer_req);
drbd_put_data_sock(mdev->tconn);

return ok;
return err;
}

int drbd_send_oos(struct drbd_conf *mdev, struct drbd_request *req)
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/block/drbd/drbd_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ int w_e_end_data_req(struct drbd_work *w, int cancel)
}

if (likely((peer_req->flags & EE_WAS_ERROR) == 0)) {
ok = drbd_send_block(mdev, P_DATA_REPLY, peer_req);
ok = !drbd_send_block(mdev, P_DATA_REPLY, peer_req);
} else {
if (__ratelimit(&drbd_ratelimit_state))
dev_err(DEV, "Sending NegDReply. sector=%llus.\n",
Expand Down Expand Up @@ -966,7 +966,7 @@ int w_e_end_rsdata_req(struct drbd_work *w, int cancel)
} else if (likely((peer_req->flags & EE_WAS_ERROR) == 0)) {
if (likely(mdev->state.pdsk >= D_INCONSISTENT)) {
inc_rs_pending(mdev);
ok = drbd_send_block(mdev, P_RS_DATA_REPLY, peer_req);
ok = !drbd_send_block(mdev, P_RS_DATA_REPLY, peer_req);
} else {
if (__ratelimit(&drbd_ratelimit_state))
dev_err(DEV, "Not sending RSDataReply, "
Expand Down Expand Up @@ -1040,7 +1040,7 @@ int w_e_end_csum_rs_req(struct drbd_work *w, int cancel)
peer_req->block_id = ID_SYNCER; /* By setting block_id, digest pointer becomes invalid! */
peer_req->flags &= ~EE_HAS_DIGEST; /* This peer request no longer has a digest pointer */
kfree(di);
ok = drbd_send_block(mdev, P_RS_DATA_REPLY, peer_req);
ok = !drbd_send_block(mdev, P_RS_DATA_REPLY, peer_req);
}
} else {
ok = !drbd_send_ack(mdev, P_NEG_RS_DREPLY, peer_req);
Expand Down

0 comments on commit f9534e5

Please sign in to comment.