diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-25 12:51:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-25 12:51:54 -0400 |
commit | 56162badadb91aae93843d8d6558c7d7780e3cb2 (patch) | |
tree | 6ec96e5b1e41672b45cacf9080d5f3f0db97118a | |
parent | e7553b19da07fffbefe83119f25738e2cc90c426 (diff) | |
parent | f281fb5fe54e15a7ab802945e42f8e24fceb56b2 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: prevent merges of discard and write requests
-rw-r--r-- | block/blk-merge.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c index 3b0cd4249671..eafc94f68d79 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
@@ -362,6 +362,18 @@ static int attempt_merge(struct request_queue *q, struct request *req, | |||
362 | return 0; | 362 | return 0; |
363 | 363 | ||
364 | /* | 364 | /* |
365 | * Don't merge file system requests and discard requests | ||
366 | */ | ||
367 | if ((req->cmd_flags & REQ_DISCARD) != (next->cmd_flags & REQ_DISCARD)) | ||
368 | return 0; | ||
369 | |||
370 | /* | ||
371 | * Don't merge discard requests and secure discard requests | ||
372 | */ | ||
373 | if ((req->cmd_flags & REQ_SECURE) != (next->cmd_flags & REQ_SECURE)) | ||
374 | return 0; | ||
375 | |||
376 | /* | ||
365 | * not contiguous | 377 | * not contiguous |
366 | */ | 378 | */ |
367 | if (blk_rq_pos(req) + blk_rq_sectors(req) != blk_rq_pos(next)) | 379 | if (blk_rq_pos(req) + blk_rq_sectors(req) != blk_rq_pos(next)) |