Skip to contentSkip to conversation

block: Check bio can merge before call attempt_plug_merge.

PATCH In review majianpeng 1 participant 1 message Oct 30, 2013

Subsystems (2)
lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 2/3 block: Check bio can merge before call attempt_plug_merge.

---
 block/blk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-core.c +1 -1
index 0a00e4e..fb970fd 100644
@@ -1492,7 +1492,7 @@ void blk_queue_bio(struct request_queue *q, struct bio *bio)
 	 * Check if we can merge with the plugged list before grabbing
 	 * any locks.
 	 */
-	if (attempt_plug_merge(q, bio, &request_count))
+	if (likely(bio_mergeable(bio)) && attempt_plug_merge(q, bio, &request_count))
 		return;
 
 	spin_lock_irq(q->queue_lock);
Signature · 1 line
1.8.4