Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213116
b: refs/heads/master
c: d28fd09
h: refs/heads/master
v: v3
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Oct 14, 2010
1 parent 77279a1 commit 5b19c96
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 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: e756414f7daa93b862f1670dd0a6aaa676ea71e3
refs/heads/master: d28fd092a55b504a0d699b65802a995086d70647
42 changes: 17 additions & 25 deletions trunk/drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,31 +917,8 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio)
/* check this request on the collision detection hash tables.
* if we have a conflict, just complete it here.
* THINK do we want to check reads, too? (I don't think so...) */
if (rw == WRITE && _req_conflicts(req)) {
/* this is a conflicting request.
* even though it may have been only _partially_
* overlapping with one of the currently pending requests,
* without even submitting or sending it, we will
* pretend that it was successfully served right now.
*/
if (local) {
bio_put(req->private_bio);
req->private_bio = NULL;
drbd_al_complete_io(mdev, req->sector);
put_ldev(mdev);
local = 0;
}
if (remote)
dec_ap_pending(mdev);
_drbd_end_io_acct(mdev, req);
/* THINK: do we want to fail it (-EIO), or pretend success? */
bio_endio(req->master_bio, 0);
req->master_bio = NULL;
dec_ap_bio(mdev);
drbd_req_free(req);
remote = 0;
}

if (rw == WRITE && _req_conflicts(req))
goto fail_conflicting;

list_add_tail(&req->tl_requests, &mdev->newest_tle->requests);

Expand Down Expand Up @@ -976,6 +953,21 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio)

return 0;

fail_conflicting:
/* this is a conflicting request.
* even though it may have been only _partially_
* overlapping with one of the currently pending requests,
* without even submitting or sending it, we will
* pretend that it was successfully served right now.
*/
_drbd_end_io_acct(mdev, req);
spin_unlock_irq(&mdev->req_lock);
if (remote)
dec_ap_pending(mdev);
/* THINK: do we want to fail it (-EIO), or pretend success?
* this pretends success. */
err = 0;

fail_free_complete:
if (rw == WRITE && local)
drbd_al_complete_io(mdev, sector);
Expand Down

0 comments on commit 5b19c96

Please sign in to comment.