]> git.hungrycats.org Git - linux/commitdiff
[PATCH] set request fastfail bit correctly
authorJens Axboe <axboe@suse.de>
Tue, 9 Mar 2004 23:58:22 +0000 (15:58 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 9 Mar 2004 23:58:22 +0000 (15:58 -0800)
From Mike Christie <michaelc@cs.wisc.edu>

The first three bio and request flags are no longer identical.  The bio
barrier and rw flags are getting set in __make_request and get_request
respectively, and failfast is getting left out.

This sets the request's failfast flag in __make_request when the bio's
flag is set.

drivers/block/ll_rw_blk.c

index 9e8b6e35b213b7c608871a2b480d6f5730d20c24..58566fbb830373349f3296287303392985e146c8 100644 (file)
@@ -2121,11 +2121,14 @@ get_rq:
                goto again;
        }
 
+       req->flags |= REQ_CMD;
+
        /*
-        * first three bits are identical in rq->flags and bio->bi_rw,
-        * see bio.h and blkdev.h
+        * inherit FAILFAST from bio and don't stack up
+        * retries for read ahead
         */
-       req->flags = (bio->bi_rw & 7) | REQ_CMD;
+       if (ra || test_bit(BIO_RW_FAILFAST, &bio->bi_rw))       
+               req->flags |= REQ_FAILFAST;
 
        /*
         * REQ_BARRIER implies no merging, but lets make it explicit
@@ -2133,12 +2136,6 @@ get_rq:
        if (barrier)
                req->flags |= (REQ_HARDBARRIER | REQ_NOMERGE);
 
-       /*
-        * don't stack up retries for read ahead
-        */
-       if (ra)
-               req->flags |= REQ_FAILFAST;
-
        req->errors = 0;
        req->hard_sector = req->sector = sector;
        req->hard_nr_sectors = req->nr_sectors = nr_sectors;