orig_nents should represent the number of entries with pages,
but __sg_alloc_table_from_pages sets orig_nents as the number of
total entries in the table. This is wrong when the API is used for
dynamic allocation where not all the table entries are mapped with
pages. It wasn't observed until now, s
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 +
On 8/24/2021 10:12 PM, Jason Gunthorpe wrote:
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
On Wed, Aug 25, 2021 at 07:59:27AM +0300, Maor Gottlieb wrote:
>
> On 8/24/2021 10:12 PM, Jason Gunthorpe wrote:
> > 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,
> > >