On Tue, May 31, 2022 at 12:11:26PM -0700, Keith Busch wrote: > From: Keith Busch <kbusch@xxxxxxxxxx> > > The most significant change from v4 is the alignment is now checked > prior to building the bio. This gets the expected EINVAL error for > misaligned userspace iovecs in all cases now (Eric Biggers). > > I've removed the legacy fs change, so only iomap filesystems get to use > this alignement capability (Christoph Hellwig). > > The block fops check for alignment returns a bool now (Damien). > > Adjusted some comments, docs, and other minor style issues. > > Reviews added for unchanged or trivially changed patches, removed > reviews for ones that changed more significantly. > > As before, I tested using 'fio' with forced misaligned user buffers on > raw block, xfs, and ext4 (example raw block profile below). > I still don't think you've taken care of all the assumptions that bv_len is a multiple of logical block size, or at least SECTOR_SIZE. Try this: git grep -E 'bv_len (>>|/)' Also: git grep '<.*bv_len;' Also take a look at bio_for_each_segment(), specifically how iter->bi_sector is updated. - Eric