From: Kanchan Joshi <joshi.k@samsung.com>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Harry Yoo <harry.yoo@oracle.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-block@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 3/3] block: make bio auto-integrity deadlock safe
Date: Mon, 27 Oct 2025 11:33:02 +0530 [thread overview]
Message-ID: <03b69a96-161f-4c5c-90f9-9be55d58d8ff@samsung.com> (raw)
In-Reply-To: <20251023080919.9209-4-hch@lst.de>
On 10/23/2025 1:38 PM, Christoph Hellwig wrote:
> @@ -194,6 +194,17 @@ static int blk_validate_integrity_limits(struct queue_limits *lim)
> (1U << bi->interval_exp) - 1);
> }
>
> + /*
> + * The block layer automatically adds integrity data for bios that don't
> + * already have it. It allocates a single segment. Limit the I/O size
> + * so that a single maximum size metadata segment can cover the
> + * integrity data for the entire I/O.
> + */
> + lim->max_sectors = min3(lim->max_sectors,
> + BLK_INTEGRITY_MAX_SIZE /
> + bi->pi_tuple_size * lim->logical_block_size,
> + lim->max_segment_size >> SECTOR_SHIFT);
Two issues:
- When underlying device has pi-type 0, pi_tuple_size will be 0 and this
will cause divide-by-zero.
- The second value in above min3() is in bytes, and other two in
sectors. So this clamping may not be happening correctly.
prev parent reply other threads:[~2025-10-27 6:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 8:08 make block layer auto-PI " Christoph Hellwig
2025-10-23 8:08 ` [PATCH 1/3] slab, block: generalize bvec_alloc_gfp Christoph Hellwig
2025-10-24 1:44 ` Martin K. Petersen
2025-10-24 8:38 ` Vlastimil Babka
2025-10-24 9:05 ` Christoph Hellwig
2025-10-26 21:19 ` Matthew Wilcox
2025-10-27 6:47 ` Christoph Hellwig
2025-10-27 13:09 ` Matthew Wilcox
2025-10-27 13:14 ` Christoph Hellwig
2025-10-23 8:08 ` [PATCH 2/3] block: blocking mempool_alloc doesn't fail Christoph Hellwig
2025-10-24 1:45 ` Martin K. Petersen
2025-10-23 8:08 ` [PATCH 3/3] block: make bio auto-integrity deadlock safe Christoph Hellwig
2025-10-24 1:47 ` Martin K. Petersen
2025-10-27 6:03 ` Kanchan Joshi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03b69a96-161f-4c5c-90f9-9be55d58d8ff@samsung.com \
--to=joshi.k@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cl@gentwo.org \
--cc=harry.yoo@oracle.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=martin.petersen@oracle.com \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox