Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223453
b: refs/heads/master
c: a115413
h: refs/heads/master
i:
  223451: eb2282b
v: v3
  • Loading branch information
Lars Ellenberg authored and Jens Axboe committed Nov 27, 2010
1 parent c281e4a commit 275f3f5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 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: c13f7e1a94007c4381814e7daf033e3e8f0663f3
refs/heads/master: a115413de13ae6beb0cbfc198afe385a261ab284
3 changes: 2 additions & 1 deletion trunk/drivers/block/drbd/drbd_req.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ static inline int _req_mod(struct drbd_request *req, enum drbd_req_event what)
}

/* completion of master bio is outside of spinlock.
* If you need it irqsave, do it your self! */
* If you need it irqsave, do it your self!
* Which means: don't use from bio endio callback. */
static inline int req_mod(struct drbd_request *req,
enum drbd_req_event what)
{
Expand Down
10 changes: 9 additions & 1 deletion trunk/drivers/block/drbd/drbd_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ void drbd_endio_sec(struct bio *bio, int error)
*/
void drbd_endio_pri(struct bio *bio, int error)
{
unsigned long flags;
struct drbd_request *req = bio->bi_private;
struct drbd_conf *mdev = req->mdev;
struct bio_and_error m;
enum drbd_req_event what;
int uptodate = bio_flagged(bio, BIO_UPTODATE);

Expand All @@ -220,7 +222,13 @@ void drbd_endio_pri(struct bio *bio, int error)
bio_put(req->private_bio);
req->private_bio = ERR_PTR(error);

req_mod(req, what);
/* not req_mod(), we need irqsave here! */
spin_lock_irqsave(&mdev->req_lock, flags);
__req_mod(req, what, &m);
spin_unlock_irqrestore(&mdev->req_lock, flags);

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

int w_read_retry_remote(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
Expand Down

0 comments on commit 275f3f5

Please sign in to comment.