btrfs / btrfs-todo

An issues only repo to organize our TODO items
21 stars 2 forks source link

loop back with O_DIRECT breaks with unaligned offsets #24

Open josefbacik opened 3 years ago

josefbacik commented 3 years ago

We have squashfs images that get mounted with loopback. The change to not fall back to buffered IO with unaligned offsets breaks loopback's O_DIRECT support. The reason for this is loop back checks the inode->i_sb->s_bdev logical alignment, and if it's on a 512 byte device it assumes 512 byte alignment. But btrfs needs pagesize alignment. We need to have a way to indicate this to loopback so that it doesn't fail if you try to use the O_DIRECT mode with loopback.