diff mbox series

[1/3] block: mark bounce buffering as incompatible with integrity

Message ID 20250218182207.3982214-2-hch@lst.de (mailing list archive)
State New
Headers show
Series [1/3] block: mark bounce buffering as incompatible with integrity | expand

Commit Message

Christoph Hellwig Feb. 18, 2025, 6:21 p.m. UTC
None of the few drivers still using the legacy block layer bounce
buffering support integrity metadata.  Explicitly mark the features as
incompatible and stop creating the slab and mempool for integrity
buffers for the bounce bio_set.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
---
 block/blk-settings.c | 5 +++++
 block/bounce.c       | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Johannes Thumshirn Feb. 18, 2025, 6:30 p.m. UTC | #1
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Hannes Reinecke Feb. 19, 2025, 4:35 p.m. UTC | #2
On 2/18/25 19:21, Christoph Hellwig wrote:
> None of the few drivers still using the legacy block layer bounce
> buffering support integrity metadata.  Explicitly mark the features as
> incompatible and stop creating the slab and mempool for integrity
> buffers for the bounce bio_set.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> ---
>   block/blk-settings.c | 5 +++++
>   block/bounce.c       | 2 --
>   2 files changed, 5 insertions(+), 2 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Anuj gupta Feb. 21, 2025, 6:04 a.m. UTC | #3
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
diff mbox series

Patch

diff --git a/block/blk-settings.c b/block/blk-settings.c
index c44dadc35e1e..2763a34a9d56 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -117,6 +117,11 @@  static int blk_validate_integrity_limits(struct queue_limits *lim)
 		return 0;
 	}
 
+	if (lim->features & BLK_FEAT_BOUNCE_HIGH) {
+		pr_warn("no bounce buffer support for integrity metadata\n");
+		return -EINVAL;
+	}
+
 	if (!IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY)) {
 		pr_warn("integrity support disabled.\n");
 		return -EINVAL;
diff --git a/block/bounce.c b/block/bounce.c
index 0d898cd5ec49..09a9616cf209 100644
--- a/block/bounce.c
+++ b/block/bounce.c
@@ -41,8 +41,6 @@  static void init_bounce_bioset(void)
 
 	ret = bioset_init(&bounce_bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
 	BUG_ON(ret);
-	if (bioset_integrity_create(&bounce_bio_set, BIO_POOL_SIZE))
-		BUG_ON(1);
 
 	ret = bioset_init(&bounce_bio_split, BIO_POOL_SIZE, 0, 0);
 	BUG_ON(ret);