Re: [PATCH] block: support zone append bvecs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 23, 2021 at 08:06:56PM +0900, Johannes Thumshirn wrote:
> diff --git a/block/bio.c b/block/bio.c
> index 26b7f721cda8..215fe24a01ee 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -1094,8 +1094,14 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
>  	int ret = 0;
>  
>  	if (iov_iter_is_bvec(iter)) {
> -		if (WARN_ON_ONCE(bio_op(bio) == REQ_OP_ZONE_APPEND))
> -			return -EINVAL;
> +		if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
> +			struct request_queue *q = bio->bi_bdev->bd_disk->queue;
> +			unsigned int max_append =
> +				queue_max_zone_append_sectors(q) << 9;
> +
> +			if (WARN_ON_ONCE(iter->count > max_append))
> +				return -EINVAL;
> +		}

That is not correct.  bio_iov_iter_get_pages just fills the bio as far
as we can, and then returns 0 for the next call to continue.  Basically
what you want here is a partial version of bio_iov_bvec_set.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux