Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345990
b: refs/heads/master
c: 8599767
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent bc94c59 commit 8667626
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 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: b55d84ba17e90491ac2046583327d4756159efd6
refs/heads/master: 859976758dc6f33ed76c21365bb49a4af9e2dd59
26 changes: 13 additions & 13 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4587,14 +4587,14 @@ validate_req_change_req_state(struct drbd_conf *mdev, u64 id, sector_t sector,
req = find_request(mdev, root, id, sector, missing_ok, func);
if (unlikely(!req)) {
spin_unlock_irq(&mdev->tconn->req_lock);
return false;
return -EIO;
}
__req_mod(req, what, &m);
spin_unlock_irq(&mdev->tconn->req_lock);

if (m.bio)
complete_master_bio(mdev, &m);
return true;
return 0;
}

static int got_BlockAck(struct drbd_tconn *tconn, struct packet_info *pi)
Expand Down Expand Up @@ -4642,9 +4642,9 @@ static int got_BlockAck(struct drbd_tconn *tconn, struct packet_info *pi)
return false;
}

return validate_req_change_req_state(mdev, p->block_id, sector,
&mdev->write_requests, __func__,
what, false);
return !validate_req_change_req_state(mdev, p->block_id, sector,
&mdev->write_requests, __func__,
what, false);
}

static int got_NegAck(struct drbd_tconn *tconn, struct packet_info *pi)
Expand All @@ -4655,7 +4655,7 @@ static int got_NegAck(struct drbd_tconn *tconn, struct packet_info *pi)
int size = be32_to_cpu(p->blksize);
bool missing_ok = tconn->net_conf->wire_protocol == DRBD_PROT_A ||
tconn->net_conf->wire_protocol == DRBD_PROT_B;
bool found;
int err;

mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
Expand All @@ -4669,10 +4669,10 @@ static int got_NegAck(struct drbd_tconn *tconn, struct packet_info *pi)
return true;
}

found = validate_req_change_req_state(mdev, p->block_id, sector,
&mdev->write_requests, __func__,
NEG_ACKED, missing_ok);
if (!found) {
err = validate_req_change_req_state(mdev, p->block_id, sector,
&mdev->write_requests, __func__,
NEG_ACKED, missing_ok);
if (err) {
/* Protocol A has no P_WRITE_ACKs, but has P_NEG_ACKs.
The master bio might already be completed, therefore the
request is no longer in the collision hash. */
Expand Down Expand Up @@ -4700,9 +4700,9 @@ static int got_NegDReply(struct drbd_tconn *tconn, struct packet_info *pi)
dev_err(DEV, "Got NegDReply; Sector %llus, len %u; Fail original request.\n",
(unsigned long long)sector, be32_to_cpu(p->blksize));

return validate_req_change_req_state(mdev, p->block_id, sector,
&mdev->read_requests, __func__,
NEG_ACKED, false);
return !validate_req_change_req_state(mdev, p->block_id, sector,
&mdev->read_requests, __func__,
NEG_ACKED, false);
}

static int got_NegRSDReply(struct drbd_tconn *tconn, struct packet_info *pi)
Expand Down

0 comments on commit 8667626

Please sign in to comment.