Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345950
b: refs/heads/master
c: deebe19
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent 0acdd08 commit e14aba5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: 79ed9bd0532e672fde29281ca2801e6f70307205
refs/heads/master: deebe195798ef1f19df8c509414d936da8b38d6a
16 changes: 9 additions & 7 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3945,18 +3945,20 @@ static void drbdd(struct drbd_tconn *tconn)
int err;

while (get_t_state(&tconn->receiver) == RUNNING) {
struct data_cmd *cmd;

drbd_thread_current_set_cpu(&tconn->receiver);
if (drbd_recv_header(tconn, &pi))
goto err_out;

if (unlikely(pi.cmd >= ARRAY_SIZE(drbd_cmd_handler) ||
!drbd_cmd_handler[pi.cmd].mdev_fn)) {
cmd = &drbd_cmd_handler[pi.cmd];
if (unlikely(pi.cmd >= ARRAY_SIZE(drbd_cmd_handler) || !cmd->mdev_fn)) {
conn_err(tconn, "unknown packet type %d, l: %d!\n", pi.cmd, pi.size);
goto err_out;
}

shs = drbd_cmd_handler[pi.cmd].pkt_size - sizeof(struct p_header);
if (pi.size - shs > 0 && !drbd_cmd_handler[pi.cmd].expect_payload) {
shs = cmd->pkt_size - sizeof(struct p_header);
if (pi.size - shs > 0 && !cmd->expect_payload) {
conn_err(tconn, "No payload expected %s l:%d\n", cmdname(pi.cmd), pi.size);
goto err_out;
}
Expand All @@ -3967,12 +3969,12 @@ static void drbdd(struct drbd_tconn *tconn)
goto err_out;
}

if (drbd_cmd_handler[pi.cmd].fa_type == CONN) {
err = drbd_cmd_handler[pi.cmd].conn_fn(tconn, pi.cmd, pi.size - shs);
if (cmd->fa_type == CONN) {
err = cmd->conn_fn(tconn, pi.cmd, pi.size - shs);
} else {
struct drbd_conf *mdev = vnr_to_mdev(tconn, pi.vnr);
err = mdev ?
drbd_cmd_handler[pi.cmd].mdev_fn(mdev, pi.cmd, pi.size - shs) :
cmd->mdev_fn(mdev, pi.cmd, pi.size - shs) :
tconn_receive_skip(tconn, pi.cmd, pi.size - shs);
}

Expand Down

0 comments on commit e14aba5

Please sign in to comment.