Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345923
b: refs/heads/master
c: 8172f3e
h: refs/heads/master
i:
  345921: bca5c08
  345919: 9dc3f12
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent d258014 commit 1416df7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 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: e2b3032b902f600980dab9516d12e955c68aa1f4
refs/heads/master: 8172f3e9bf9bc239caec96382573b8d9b01baa09
10 changes: 5 additions & 5 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ static int drbd_connect(struct drbd_tconn *tconn)
return -1;
}

static bool decode_header(struct drbd_tconn *tconn, struct p_header *h, struct packet_info *pi)
static int decode_header(struct drbd_tconn *tconn, struct p_header *h, struct packet_info *pi)
{
if (h->h80.magic == cpu_to_be32(DRBD_MAGIC)) {
pi->cmd = be16_to_cpu(h->h80.command);
Expand All @@ -963,9 +963,9 @@ static bool decode_header(struct drbd_tconn *tconn, struct p_header *h, struct p
be32_to_cpu(h->h80.magic),
be16_to_cpu(h->h80.command),
be16_to_cpu(h->h80.length));
return false;
return -EINVAL;
}
return true;
return 0;
}

static int drbd_recv_header(struct drbd_tconn *tconn, struct packet_info *pi)
Expand All @@ -980,7 +980,7 @@ static int drbd_recv_header(struct drbd_tconn *tconn, struct packet_info *pi)
return false;
}

r = decode_header(tconn, h, pi);
r = !decode_header(tconn, h, pi);
tconn->last_received = jiffies;

return r;
Expand Down Expand Up @@ -4845,7 +4845,7 @@ int drbd_asender(struct drbd_thread *thi)
}

if (received == expect && cmd == NULL) {
if (!decode_header(tconn, h, &pi))
if (decode_header(tconn, h, &pi))
goto reconnect;
cmd = &asender_tbl[pi.cmd];
if (pi.cmd >= ARRAY_SIZE(asender_tbl) || !cmd) {
Expand Down

0 comments on commit 1416df7

Please sign in to comment.