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)
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)
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)
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. */
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)