From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 0/1] iomap: Direct I/O for inline data Date: Fri, 29 Jun 2018 10:43:13 +0200 Message-ID: <20180629084313.GA16042@lst.de> References: <20180627003906.15571-1-agruenba@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: cluster-devel , linux-fsdevel , linux-ext4 , Christoph Hellwig To: Andreas Gruenbacher Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: cluster-devel-bounces@redhat.com Errors-To: cluster-devel-bounces@redhat.com List-Id: linux-ext4.vger.kernel.org > A possible fix is to change the alignment check in iomap_dio_actor as follows: > > - if ((pos | length | align) & ((1 << blkbits) - 1)) > + if ((pos | align) & ((1 << blkbits) - 1)) > + return -EINVAL; > + if (length & ((1 << blkbits) - 1) && > + pos + length != iomap->offset + iomap->length) > return -EINVAL; > > Moving the alignment check from iomap_dio_actor to iomap_dio_rw isn't > that easy because iomap->bdev isn't known there. Just make the check conditional on iomap->type != IOMAP_INLINE as alignment checks on inline data don't make much sense.