diff options
Diffstat (limited to 'drivers/block/drbd/drbd_worker.c')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index b0551ba7ad0c..34f224b018b3 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/drbd.h> | 27 | #include <linux/drbd.h> |
28 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
29 | #include <linux/smp_lock.h> | ||
30 | #include <linux/wait.h> | 29 | #include <linux/wait.h> |
31 | #include <linux/mm.h> | 30 | #include <linux/mm.h> |
32 | #include <linux/memcontrol.h> | 31 | #include <linux/memcontrol.h> |
@@ -194,8 +193,10 @@ void drbd_endio_sec(struct bio *bio, int error) | |||
194 | */ | 193 | */ |
195 | void drbd_endio_pri(struct bio *bio, int error) | 194 | void drbd_endio_pri(struct bio *bio, int error) |
196 | { | 195 | { |
196 | unsigned long flags; | ||
197 | struct drbd_request *req = bio->bi_private; | 197 | struct drbd_request *req = bio->bi_private; |
198 | struct drbd_conf *mdev = req->mdev; | 198 | struct drbd_conf *mdev = req->mdev; |
199 | struct bio_and_error m; | ||
199 | enum drbd_req_event what; | 200 | enum drbd_req_event what; |
200 | int uptodate = bio_flagged(bio, BIO_UPTODATE); | 201 | int uptodate = bio_flagged(bio, BIO_UPTODATE); |
201 | 202 | ||
@@ -221,7 +222,13 @@ void drbd_endio_pri(struct bio *bio, int error) | |||
221 | bio_put(req->private_bio); | 222 | bio_put(req->private_bio); |
222 | req->private_bio = ERR_PTR(error); | 223 | req->private_bio = ERR_PTR(error); |
223 | 224 | ||
224 | req_mod(req, what); | 225 | /* not req_mod(), we need irqsave here! */ |
226 | spin_lock_irqsave(&mdev->req_lock, flags); | ||
227 | __req_mod(req, what, &m); | ||
228 | spin_unlock_irqrestore(&mdev->req_lock, flags); | ||
229 | |||
230 | if (m.bio) | ||
231 | complete_master_bio(mdev, &m); | ||
225 | } | 232 | } |
226 | 233 | ||
227 | int w_read_retry_remote(struct drbd_conf *mdev, struct drbd_work *w, int cancel) | 234 | int w_read_retry_remote(struct drbd_conf *mdev, struct drbd_work *w, int cancel) |