lkml.org 
[lkml]   [2021]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm/mempolicy: do not allow illegal MPOL_F_NUMA_BALANCING | MPOL_LOCAL in mbind()
On Fri, Oct 1, 2021 at 1:25 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Eric,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on hnaz-mm/master]
>
> url: https://github.com/0day-ci/linux/commits/Eric-Dumazet/mm-mempolicy-do-not-allow-illegal-MPOL_F_NUMA_BALANCING-MPOL_LOCAL-in-mbind/20211002-015054
> base: https://github.com/hnaz/linux-mm master
> config: ia64-defconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/0day-ci/linux/commit/fe87354835a4bf5cad6d885f0ba558c767fee6f1
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review Eric-Dumazet/mm-mempolicy-do-not-allow-illegal-MPOL_F_NUMA_BALANCING-MPOL_LOCAL-in-mbind/20211002-015054
> git checkout fe87354835a4bf5cad6d885f0ba558c767fee6f1
> # save the attached .config to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> mm/mempolicy.c: In function 'sanitize_mpol_flags':
> >> mm/mempolicy.c:1452:26: warning: comparison between pointer and integer
> 1452 | if (mode != MPOL_BIND)
> | ^~

Oh well, last minute changes, and indeed my compiler warned me while I
was away :/

mm/mempolicy.c:1452:12: warning: comparison between pointer and
integer ('int *' and 'int') [-Wpointer-integer-compare]
if (mode != MPOL_BIND)
~~~~ ^ ~~~~~~~~~

I am sending a v2, thanks.

>
>
> vim +1452 mm/mempolicy.c
>
> 1440
> 1441 /* Basic parameter sanity check used by both mbind() and set_mempolicy() */
> 1442 static inline int sanitize_mpol_flags(int *mode, unsigned short *flags)
> 1443 {
> 1444 *flags = *mode & MPOL_MODE_FLAGS;
> 1445 *mode &= ~MPOL_MODE_FLAGS;
> 1446
> 1447 if ((unsigned int)(*mode) >= MPOL_MAX)
> 1448 return -EINVAL;
> 1449 if ((*flags & MPOL_F_STATIC_NODES) && (*flags & MPOL_F_RELATIVE_NODES))
> 1450 return -EINVAL;
> 1451 if (*flags & MPOL_F_NUMA_BALANCING) {
> > 1452 if (mode != MPOL_BIND)
> 1453 return -EINVAL;
> 1454 *flags |= (MPOL_F_MOF | MPOL_F_MORON);
> 1455 }
> 1456 return 0;
> 1457 }
> 1458
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

\
 
 \ /
  Last update: 2021-10-01 23:53    [W:0.045 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site