xfs: avoid IO issues unaligned memory allocation
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 40 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | xfs: add kmem allocation trace pointsfs/ fs/ fs/ +1 more | +50 | 2 replies | |
| 2/3 | xfs: add kmem_alloc_io()fs/ fs/ fs/ +3 more | +50 | 20 replies | |
| 3/3 | xfs: alignment check bio buffersfs/ fs/ fs/ +1 more | +38 | 18 replies |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by.
| Patch | Brian Foster | Christoph Hellwig |
|---|---|---|
| 1/3 | R-b | R-b |
| 2/3 | ||
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] xfs: avoid IO issues unaligned memory allocation
Hi folks,
These patches fix the issue reported by Vishal on 5.3-rc1 with pmem, reproduced on brd, and previously seen with xenblk.
The core issue is that when memory allocation debugging is turned on, heap memory is no longer naturally aligned and that means we attach memory with large memory regions with random alignment to bios. Some block drivers only support 512 byte aligned memory buffers, and these then silently break when fed an unaligned buffers.
This happens silently because nothing in the block or driver layers actually validates that memory buffers containing kernel memory are correctly aligned. Buffers may be bounced in the drivers if they are unaligned, but not all driver support this, hence the breakage.
This patchset added memory allocation tracing, 512 byte aligned allocation support via kmem_alloc_io(), and a re-implementation of bio_add_page() to add memory buffer alignment verification. The last patch causes unaligned allocations to fail fast, noisily and safely, such that any developer running KASAN will immediately notice if XFS attaches an unaligned mmemory buffer to a bio....
Cheers,
Dave.