|
|
Log in / Subscribe / Register

make block layer auto-PI deadlock safe

From:  Christoph Hellwig <hch-AT-lst.de>
To:  Jens Axboe <axboe-AT-kernel.dk>
Subject:  make block layer auto-PI deadlock safe
Date:  Thu, 23 Oct 2025 10:08:53 +0200
Message-ID:  <20251023080919.9209-1-hch@lst.de>
Cc:  Vlastimil Babka <vbabka-AT-suse.cz>, Andrew Morton <akpm-AT-linux-foundation.org>, Christoph Lameter <cl-AT-gentwo.org>, David Rientjes <rientjes-AT-google.com>, Roman Gushchin <roman.gushchin-AT-linux.dev>, Harry Yoo <harry.yoo-AT-oracle.com>, "Martin K. Petersen" <martin.petersen-AT-oracle.com>, linux-block-AT-vger.kernel.org, linux-mm-AT-kvack.org
Archive-link:  Article

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(-)



Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds