[Intel-gfx] [PATCH rdma-next v4 2/3] lib/scatterlist: Fix wrong update of orig_nents

Jason Gunthorpe jgg at nvidia.com
Tue Aug 24 19:12:48 UTC 2021


On Tue, Aug 24, 2021 at 05:25:30PM +0300, Maor Gottlieb wrote:
> @@ -514,11 +531,13 @@ struct scatterlist *sg_alloc_append_table_from_pages(struct sg_table *sgt,
>  		offset = 0;
>  		cur_page = j;
>  	}
> -	sgt->nents += added_nents;
> +	sgt_append->sgt.nents += added_nents;
> +	sgt_append->sgt.orig_nents = sgt_append->sgt.nents;
> +	sgt_append->prv = s;

Why is nents being touched here?

Shouldn't it just be

    sgt_append->sgt.orig_nents += added_nents; 
    sgt_append->prv = s;

?

Let me know I can fix it

Jason


More information about the Intel-gfx mailing list