summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-10-24 12:48:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-10-24 12:48:19 -0700
commitd2818517e3486d11c9bd55aca3e14059e4c69886 (patch)
tree12d04a3fa952178b20119df6a0ac13653502af08 /block
parent812e7eb2b0741bb4a94f2b8c9b789ba5d693eedf (diff)
parent4c8cf6bd28d6fea23819f082ddc8063fd6fa963a (diff)
downloadlwn-d2818517e3486d11c9bd55aca3e14059e4c69886.tar.gz
lwn-d2818517e3486d11c9bd55aca3e14059e4c69886.zip
Merge tag 'block-6.18-20251023' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux
Pull block fixes from Jens Axboe: - Fix dma alignment for PI - Fix selinux bogosity with nbd, where sendmsg would get rejected * tag 'block-6.18-20251023' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux: block: require LBA dma_alignment when using PI nbd: override creds to kernel when calling sock_{send,recv}msg()
Diffstat (limited to 'block')
-rw-r--r--block/blk-settings.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 54cffaae4df4..d74b13ec8e54 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -184,6 +184,16 @@ static int blk_validate_integrity_limits(struct queue_limits *lim)
if (!bi->interval_exp)
bi->interval_exp = ilog2(lim->logical_block_size);
+ /*
+ * The PI generation / validation helpers do not expect intervals to
+ * straddle multiple bio_vecs. Enforce alignment so that those are
+ * never generated, and that each buffer is aligned as expected.
+ */
+ if (bi->csum_type) {
+ lim->dma_alignment = max(lim->dma_alignment,
+ (1U << bi->interval_exp) - 1);
+ }
+
return 0;
}