make block layer auto-PI deadlock safe

Christoph Hellwig
2025-10-23T08:09:27Z

Hi all,

currently the automatic block layer PI generation allocates the integrity
buffer using kmalloc, and thus could deadlock, or fail I/O request due
to memory pressure.

Fix this by adding a mempool, and capping the maximum I/O size on PI
capable devices to not exceed the allocation size of the mempool.

This is against the block-6.18 branch as it has a contextual dependency
on the PI fix merged there yesterday.

Diffstat:
block/bio-integrity-auto.c | 26 ++---------------------
block/bio-integrity.c | 47 ++++++++++++++++++++++++++++++++++++++++++
block/bio.c | 13 +----------
block/blk-settings.c | 11 +++++++++
include/linux/bio-integrity.h | 6 +++++
include/linux/blk-integrity.h | 5 ++++
include/linux/slab.h | 10 ++++++++
7 files changed, 84 insertions(+), 34 deletions(-)