Re: [PATCH 03/11] block: introduce bio_add_append_page

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

 



On 10/03/2020 10:47, Johannes Thumshirn wrote:
[...]
> @@ -945,8 +955,15 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
>   
>   		len = min_t(size_t, PAGE_SIZE - offset, left);
>   
> -		if (__bio_try_merge_page(bio, page, len, offset, &same_page)) {
> -			if (same_page)
> +		if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
> +			size = bio_add_append_page(bio->bi_disk->queue, bio,
> +						   page, len, offset);
> +
> +			if (size != len)
> +				return -E2BIG;


Converting zonefs/iomap to zone-append found a bug here, should've been:

if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
	int ret;

	ret = bio_add_append_page(bio->bi_disk->queue, bio,
				  page, len, offset);
	if (ret != len)
		return -E2BIG;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux