From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Fri, 29 Jun 2018 10:43:13 +0200 Subject: [Cluster-devel] [PATCH 0/1] iomap: Direct I/O for inline data In-Reply-To: References: <20180627003906.15571-1-agruenba@redhat.com> Message-ID: <20180629084313.GA16042@lst.de> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > 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.