]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Fix noop elevator request merging
authorJens Axboe <axboe@suse.de>
Mon, 8 Sep 2003 04:09:12 +0000 (21:09 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 8 Sep 2003 04:09:12 +0000 (21:09 -0700)
From: Oleg Drokin <green@namesys.com>

Without this, if elv_try_last_merge() returns nonzero, we do not
initialise *req.  That results in a subsequent BUG_ON() in
__make_request() because req is NULL (or is just uninitialised).

drivers/block/noop-iosched.c

index 7511b955de70bb1e87a2dc78abb4de3afe6ef9da..ffef40be1f927afee43ffae4ad1285212d141652 100644 (file)
@@ -24,8 +24,10 @@ int elevator_noop_merge(request_queue_t *q, struct request **req,
        struct request *__rq;
        int ret;
 
-       if ((ret = elv_try_last_merge(q, bio)))
+       if ((ret = elv_try_last_merge(q, bio))) {
+               *req = q->last_merge;
                return ret;
+       }
 
        while ((entry = entry->prev) != &q->queue_head) {
                __rq = list_entry_rq(entry);