Skip to content

block: fix GFP_ flags confusion in bio_integrity_alloc_buf#990

Open
blktests-ci[bot] wants to merge 2 commits into
linus-master_basefrom
series/1115442=>linus-master
Open

block: fix GFP_ flags confusion in bio_integrity_alloc_buf#990
blktests-ci[bot] wants to merge 2 commits into
linus-master_basefrom
series/1115442=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown

Pull request for series with
subject: block: fix GFP_ flags confusion in bio_integrity_alloc_buf
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1115442

@blktests-ci

blktests-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown
Author

Upstream branch: 66affa3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1115442
version: 1

@blktests-ci

blktests-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: bade58e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1115442
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1115442=>linus-master branch from 551d431 to 92f3ac4 Compare June 24, 2026 01:16
@blktests-ci

blktests-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: bade58e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1115736
version: 1

Christoph Hellwig added 2 commits June 24, 2026 08:41
bio_integrity_alloc_buf usage of GFP_ flags is messed up.  For one it
mixes GFP_NOFS and GFP_NOIO for neighbouring allocations, but it also
makes the allocations fail more often than needed.  That code was copied
from bio_alloc_bioset which needs to do that so that it can punt to the
rescuer workqueue, but none of that is needed for the integrity
allocations that either sits in the file system or at the very bottom
of the I/O stack.  Failing early means we'll do a fully waiting
allocation from the mempool ->alloc callback which is usually much
larger than required.

Fix this by passing a gfp_t so that the file system path can pass
GFP_NOFS and the auto-integrity code can pass GFP_NOIO, and don't
modify the allocation type except for disabling warnings.

Fixes: ec7f31b ("block: make bio auto-integrity deadlock safe")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Otherwise zone append commands will miss their integrity data.  While
this works "fine" for auto-PI, it break file system PI and non-PI
metadata.

With this XFS on ZNS namespace with non-PI metadata and 512 byte sectors
with PI work, while PI 4k sector formats with PI work only when Caleb's
"block: fix integrity offset/length conversions" is applied as well.

Note that unlike regular writes, zone append does need remapping as
partitions are not supported on zoned block devices.

Fixes: df3c485 ("block: switch on bio operation in bio_integrity_prep")
Signed-off-by: Christoph Hellwig <hch@lst.de>
@blktests-ci blktests-ci Bot force-pushed the series/1115442=>linus-master branch from 92f3ac4 to 1f56ecb Compare June 24, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants