lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180621073334.GA11407@techadventures.net>
Date:   Thu, 21 Jun 2018 09:33:34 +0200
From:   Oscar Salvador <osalvador@...hadventures.net>
To:     Pavel Tatashin <pasha.tatashin@...cle.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Michal Hocko <mhocko@...e.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Linux Memory Management List <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>, osalvador@...e.de
Subject: Re: [PATCH 1/4] mm/memory_hotplug: Make add_memory_resource use
 __try_online_node

On Wed, Jun 20, 2018 at 09:41:35PM -0400, Pavel Tatashin wrote:
> > I don't think __try_online_node() will ever return a value greater than
> > zero.  I assume what was meant was
> 
> Hi Andrew and Oscar,
> 
> Actually, the new __try_online_node()  returns:
> 1 -> a new node was allocated
> 0 -> node is already online
> -error -> an error encountered.
> 
> The function simply missing the return comment at the beginning.
> 
> Oscar, please check it via ./scripts/checkpatch.pl
> 
> Add comment explaining the return values.
> 
> And change:
>         ret = __try_online_node (nid, start, false);
>         new_node = !!(ret > 0);
>         if (ret < 0)
>                 goto error;
> To:
>         ret = __try_online_node (nid, start, false);
>         if (ret < 0)
>                 goto error;
>         new_node = ret;
> 
> Other than that the patch looks good to me, it simplifies the code.
> So, if the above is addressed:
> 
> Reviewed-by: Pavel Tatashin <pasha.tatashin@...cle.com>

Hi Pavel,

I'll do so, thanks!

> 
> Thank you,
> Pavel
> 
> >
> >         new_node = !!(ret >= 0);
> >
> > which may as well be
> >
> >         new_node = (ret >= 0);
> >
> > since both sides have bool type.
> >
> > The fact that testing didn't detect this is worrisome....
> >
> > > +     if (ret < 0)
> > > +             goto error;
> > > +
> > >
> > >       /* call arch's memory hotadd */
> > >       ret = arch_add_memory(nid, start, size, NULL, true);
> > > -
> > >       if (ret < 0)
> > >               goto error;
> > >
> > >
> > > ...
> > >
> >
> 

-- 
Oscar Salvador
SUSE L3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ