On Mon, Nov 14, 2022 at 06:31:36AM -0500, Mikulas Patocka wrote: > > > On Fri, 11 Nov 2022, Keith Busch wrote: > > > > There are other DM targets that override logical_block_size in their > > > .io_hints hook (writecache, ebs, zoned). Have you reasoned through why > > > those do _not_ need updating too? > > > > Yeah, that's a good question. The ones that have a problem all make > > assumptions about a bio's bv_offset being logical block size aligned, > > and each of those is accounted for here. Everything else looks fine with > > respect to handling offsets. > > Unaligned bv_offset should work - because XFS is sending such bios. If you > compile the kernel with memory debugging, kmalloc returns unaligned > memory. XFS will allocate a buffer with kmalloc, test if it crosses a page > boundary, if not, use the buffer, if yes, free the buffer and allocate a > full page. > > There have been device mapper problems about unaligned bv_offset in the > past and I have fixed them. > > Unaligned bv_length is a problem for the affected targets. kmalloc is physically contiguous, and bio's support multi-page bvecs for these, so the bv_len is always aligned if the kmalloc is sized correctly. The unaligned offsets become a problem with virtually contiguous buffers since individual bv lengths might not be block size aligned when bv offsets exist. -- dm-devel mailing list dm-devel@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/dm-devel