Skip to contentSkip to conversation

block: early return from blk_queue_split() if q->bio_split is NULL

PATCH In review Mike Snitzer 1 participant 2 messages Nov 20, 2017 – Nov 21, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: early return from blk_queue_split() if q->bio_split is NULL

DM appears to be the only block driver that doesn't lean on the block core's bio splitting. My hope is to fix that but in the meantime it doesn't make sense for a device that doesn't need blk_queue_split() to go through the associated work.

---
 block/blk-merge.c | 3 +++
 1 file changed, 3 insertions(+)
block/blk-merge.c +3 -0
index f5dedd5..212004c 100644
@@ -186,6 +186,9 @@ void blk_queue_split(struct request_queue *q, struct bio **bio)
 	struct bio *split, *res;
 	unsigned nsegs;
 
+	if (!q->bio_split)
+		return;
+
 	switch (bio_op(*bio)) {
 	case REQ_OP_DISCARD:
 	case REQ_OP_SECURE_ERASE:
Signature · 1 line
2.10.1
#1 lore raw
Quoted 27 lines · Mike Snitzer

DM appears to be the only block driver that doesn't lean on the block core's bio splitting. My hope is to fix that but in the meantime it doesn't make sense for a device that doesn't need blk_queue_split() to go through the associated work.

---
 block/blk-merge.c | 3 +++
 1 file changed, 3 insertions(+)
block/blk-merge.c +3 -0
index f5dedd5..212004c 100644
@@ -186,6 +186,9 @@ void blk_queue_split(struct request_queue *q, struct bio **bio)
 	struct bio *split, *res;
 	unsigned nsegs;
 
+	if (!q->bio_split)
+		return;
+
 	switch (bio_op(*bio)) {
 	case REQ_OP_DISCARD:
 	case REQ_OP_SECURE_ERASE:
Signature · 1 line
2.10.1

Please ignore this patch. While the patch is perfectly valid, it doesn't have an existing consumer. Ming pointed out that, in constrat to blk_queue_bio(), bio-based DM's dm_make_request() makes it so that DM never calls blk_queue_split().

Mike