Re: [PATCH v5 1/4] sgl_alloc_order: remove 4 GiB limit, sgl_free() warning

2021-01-11 Thread Jason Gunthorpe
On Sat, Jan 09, 2021 at 05:58:50PM -0500, Douglas Gilbert wrote: > On 2021-01-07 12:44 p.m., Jason Gunthorpe wrote: > > On Mon, Dec 28, 2020 at 06:49:52PM -0500, Douglas Gilbert wrote: > > > diff --git a/lib/scatterlist.c b/lib/scatterlist.c > > > index a59778946404..4986545beef9 100644 > > > +++ b

Re: [PATCH v5 1/4] sgl_alloc_order: remove 4 GiB limit, sgl_free() warning

2021-01-09 Thread Douglas Gilbert
On 2021-01-07 12:44 p.m., Jason Gunthorpe wrote: On Mon, Dec 28, 2020 at 06:49:52PM -0500, Douglas Gilbert wrote: diff --git a/lib/scatterlist.c b/lib/scatterlist.c index a59778946404..4986545beef9 100644 +++ b/lib/scatterlist.c @@ -554,13 +554,15 @@ EXPORT_SYMBOL(sg_alloc_table_from_pages); #

Re: [PATCH v5 1/4] sgl_alloc_order: remove 4 GiB limit, sgl_free() warning

2021-01-07 Thread Jason Gunthorpe
On Mon, Dec 28, 2020 at 06:49:52PM -0500, Douglas Gilbert wrote: > diff --git a/lib/scatterlist.c b/lib/scatterlist.c > index a59778946404..4986545beef9 100644 > +++ b/lib/scatterlist.c > @@ -554,13 +554,15 @@ EXPORT_SYMBOL(sg_alloc_table_from_pages); > #ifdef CONFIG_SGL_ALLOC > > /** > - * sgl

[PATCH v5 1/4] sgl_alloc_order: remove 4 GiB limit, sgl_free() warning

2020-12-28 Thread Douglas Gilbert
This patch fixes a check done by sgl_alloc_order() before it starts any allocations. The comment in the original said: "Check for integer overflow" but the check itself contained an integer overflow! The right hand side (rhs) of the expression in the condition is resolved as u32 so it could not exc