Thread (30 messages) 30 messages, 6 authors, 2018-10-19
STALE2811d

[PATCH 1/5] block: warn on un-aligned DMA IO buffer

From: Ming Lei <hidden>
Date: 2018-10-18 21:19:32
Also in: linux-fsdevel
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds

Now we only check if DMA IO buffer is aligned to queue_dma_alignment()
for pass-through request, and it isn't done for normal IO request.

Given the check has to be done on each bvec, it isn't efficient to add the
check in generic_make_request_checks().

This patch addes one WARN in blk_queue_split() for capturing this issue.

Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Dave Chinner <redacted>
Cc: Linux FS Devel <redacted>
Cc: Darrick J. Wong <redacted>
Cc: xfs@vger.kernel.org
Cc: Dave Chinner <redacted>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Ming Lei <redacted>
---
 block/blk-merge.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 42a46744c11b..d2dbd508cb6d 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -174,6 +174,8 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
 	const unsigned max_sectors = get_max_io_size(q, bio);
 
 	bio_for_each_segment(bv, bio, iter) {
+		WARN_ON_ONCE(queue_dma_alignment(q) & bv.bv_offset);
+
 		/*
 		 * If the queue doesn't support SG gaps and adding this
 		 * offset would create a gap, disallow it.
-- 
2.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help