Re: [PATCH v2] block: limit the extract size to align queue limit
From: Christoph Hellwig
Date: Fri Nov 10 2023 - 13:37:26 EST
On Fri, Nov 10, 2023 at 01:19:49PM +0800, ed.tsai@xxxxxxxxxxxx wrote:
> + if (bdev && blk_queue_pci_p2pdma(bdev->bd_disk->queue))
> extraction_flags |= ITER_ALLOW_P2PDMA;
As pointed out in reply to Ming, you really need to first figure out
if we can assume we have a valid bdev or not, and if not pass all the
relevant information separately.
> + if (bdev && bio_op(bio) != REQ_OP_ZONE_APPEND) {
> + unsigned int max = queue_max_bytes(bdev_get_queue(bdev));
The higher level code must not look at queue_max_bytes, that is only
used for splitting and might not even be initialized.