[lkml]   [2009]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH #tj-block-for-linus] block: fix failfast merge testing in elv_rq_merge_ok()
Commit ab0fd1debe730ec9998678a0c53caefbd121ed10 tries to prevent merge
of requests with different failfast settings. In elv_rq_merge_ok(),
it compares new bio's failfast flags against the merge target
request's. However, the flag testing accessors for bio and blk don't
return boolean but the tested bit value directly and FAILFAST on bio
and blk don't match, so directly comparing them with == results in
false negative unnecessary preventing merge of readahead requests.

This patch convert the results to boolean by negating them before

Signed-off-by: Tejun Heo <>
Cc: Jens Axboe <>
Cc: Boaz Harrosh <>
Cc: FUJITA Tomonori <>
Cc: James Bottomley <>
Cc: Jeff Garzik <>
Eh... talk about being obscure. :-( I've put this onto the following
temp block tree I'm running and will push toward Linus in a few days.

git:// tj-block-for-linus


block/elevator.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index 6f23753..977aa7c 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -103,9 +103,9 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio)
* Don't merge if failfast settings don't match
- if (bio_failfast_dev(bio) != blk_failfast_dev(rq) ||
- bio_failfast_transport(bio) != blk_failfast_transport(rq) ||
- bio_failfast_driver(bio) != blk_failfast_driver(rq))
+ if (!bio_failfast_dev(bio) != !blk_failfast_dev(rq) ||
+ !bio_failfast_transport(bio) != !blk_failfast_transport(rq) ||
+ !bio_failfast_driver(bio) != !blk_failfast_driver(rq))
return 0;

if (!elv_iosched_allow_merge(rq, bio))

 \ /
  Last update: 2009-07-16 08:49    [W:0.053 / U:2.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site