From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:38489 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726924AbeJRW3o (ORCPT ); Thu, 18 Oct 2018 18:29:44 -0400 Date: Thu, 18 Oct 2018 16:28:26 +0200 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, Vitaly Kuznetsov , Dave Chinner , Linux FS Devel , "Darrick J . Wong" , xfs@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Matthew Wilcox Subject: Re: [PATCH 1/5] block: warn on un-aligned DMA IO buffer Message-ID: <20181018142826.GA26828@lst.de> References: <20181018131817.11813-1-ming.lei@redhat.com> <20181018131817.11813-2-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181018131817.11813-2-ming.lei@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > 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); I'd write this the other way around, although I have no good argument for that. Otherwise this looks fine: Reviewed-by: Christoph Hellwig