malloc: Fix transposed arguments in sysmalloc_mmap_fallback call

Message ID Y/5wFE+YCYJ/yr0j@morell
State Committed
Commit 6a734e62f1557de3449c689effd2b37066ea34eb
Headers
Series malloc: Fix transposed arguments in sysmalloc_mmap_fallback call |

Checks

Context Check Description
dj/TryBot-apply_patch fail Patch failed to apply to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Robert Morell Feb. 28, 2023, 9:20 p.m. UTC
  git commit 0849eed45daa ("malloc: Move MORECORE fallback mmap to
sysmalloc_mmap_fallback") moved a block of code from sysmalloc to a
new helper function sysmalloc_mmap_fallback(), but 'pagesize' is used
for the 'minsize' argument and 'MMAP_AS_MORECORE_SIZE' for the
'pagesize' argument.

Fixes: 0849eed45daa ("malloc: Move MORECORE fallback mmap to sysmalloc_mmap_fallback")
Signed-off-by: Robert Morell <rmorell@nvidia.com>
---
 malloc/malloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Adhemerval Zanella Netto March 7, 2023, 1:13 p.m. UTC | #1
On 28/02/23 18:20, Robert Morell wrote:
> git commit 0849eed45daa ("malloc: Move MORECORE fallback mmap to
> sysmalloc_mmap_fallback") moved a block of code from sysmalloc to a
> new helper function sysmalloc_mmap_fallback(), but 'pagesize' is used
> for the 'minsize' argument and 'MMAP_AS_MORECORE_SIZE' for the
> 'pagesize' argument.
> 
> Fixes: 0849eed45daa ("malloc: Move MORECORE fallback mmap to sysmalloc_mmap_fallback")
> Signed-off-by: Robert Morell <rmorell@nvidia.com>

LGTM, I am not sure why patchwork has failed to apply this patch
(I works manually).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  malloc/malloc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/malloc/malloc.c b/malloc/malloc.c
> index 5829f3fa9b4b..76c50e3f5817 100644
> --- a/malloc/malloc.c
> +++ b/malloc/malloc.c
> @@ -2725,8 +2725,8 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
>  					    mp_.hp_flags, av);
>  #endif
>  	  if (mbrk == MAP_FAILED)
> -	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, pagesize,
> -					    MMAP_AS_MORECORE_SIZE, 0, av);
> +	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, MMAP_AS_MORECORE_SIZE,
> +					    pagesize, 0, av);
>  	  if (mbrk != MAP_FAILED)
>  	    {
>  	      /* We do not need, and cannot use, another sbrk call to find end */
  
DJ Delorie March 7, 2023, 6:43 p.m. UTC | #2
Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> writes:
> LGTM, I am not sure why patchwork has failed to apply this patch
> (I works manually).

The Message-ID has slashes in it, and while patchwork knows this is
possible, it seems its coverage of quoting them is incomplete.  Thus,
the CI machines are unable to download the patch from patchwork to test
it.  The "32bit" tests download the whole series, which doesn't have
this problem.  So if that test passes, ignore any "apply-patch"
failures.
  
Robert Morell March 7, 2023, 6:53 p.m. UTC | #3
On Tue, Mar 07, 2023 at 01:43:02PM -0500, DJ Delorie wrote:
> Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> writes:
> > LGTM, I am not sure why patchwork has failed to apply this patch
> > (I works manually).
> 
> The Message-ID has slashes in it, and while patchwork knows this is
> possible, it seems its coverage of quoting them is incomplete.

Apologies, that's what I get for not heeding this PSA:
https://people.kernel.org/monsieuricon/fix-your-mutt

> Thus, the CI machines are unable to download the patch from patchwork
> to test it.  The "32bit" tests download the whole series, which
> doesn't have this problem.  So if that test passes, ignore any
> "apply-patch" failures.

I've now applied the suggested workaround for mutt's Message-ID, so let
me know if you'd like me to resend the patch so it applies cleanly.
  

Patch

diff --git a/malloc/malloc.c b/malloc/malloc.c
index 5829f3fa9b4b..76c50e3f5817 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2725,8 +2725,8 @@  sysmalloc (INTERNAL_SIZE_T nb, mstate av)
 					    mp_.hp_flags, av);
 #endif
 	  if (mbrk == MAP_FAILED)
-	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, pagesize,
-					    MMAP_AS_MORECORE_SIZE, 0, av);
+	    mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, MMAP_AS_MORECORE_SIZE,
+					    pagesize, 0, av);
 	  if (mbrk != MAP_FAILED)
 	    {
 	      /* We do not need, and cannot use, another sbrk call to find end */