Hi Alexey,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kselftest/next]
[also build test ERROR on linux/master linus/master v5.11 next-20210212]
[cannot apply to hnaz-linux-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Alexey-Gladkov/Count-rlimits-in-each-user-namespace/20210215-204524
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
config: openrisc-randconfig-r001-20210215 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.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/f009495a8def89a71b9e0b9025a39379d6f9097d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Alexey-Gladkov/Count-rlimits-in-each-user-namespace/20210215-204524
        git checkout f009495a8def89a71b9e0b9025a39379d6f9097d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=openrisc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <l...@intel.com>

All errors (new ones prefixed by >>):

   mm/mmap.c: In function 'ksys_mmap_pgoff':
>> mm/mmap.c:1626:5: error: passing argument 4 of 'hugetlb_file_setup' from 
>> incompatible pointer type [-Werror=incompatible-pointer-types]
    1626 |     &cred, HUGETLB_ANONHUGE_INODE,
         |     ^~~~~
         |     |
         |     const struct cred **
   In file included from mm/mmap.c:28:
   include/linux/hugetlb.h:457:17: note: expected 'struct cred **' but argument 
is of type 'const struct cred **'
     457 |   struct cred **cred, int creat_flags,
         |   ~~~~~~~~~~~~~~^~~~
   cc1: some warnings being treated as errors
--
   mm/memfd.c: In function '__do_sys_memfd_create':
>> mm/memfd.c:301:52: error: passing argument 4 of 'hugetlb_file_setup' from 
>> incompatible pointer type [-Werror=incompatible-pointer-types]
     301 |   file = hugetlb_file_setup(name, 0, VM_NORESERVE, &cred,
         |                                                    ^~~~~
         |                                                    |
         |                                                    const struct cred 
**
   In file included from mm/memfd.c:18:
   include/linux/hugetlb.h:457:17: note: expected 'struct cred **' but argument 
is of type 'const struct cred **'
     457 |   struct cred **cred, int creat_flags,
         |   ~~~~~~~~~~~~~~^~~~
   cc1: some warnings being treated as errors
--
   ipc/shm.c: In function 'newseg':
>> ipc/shm.c:653:5: error: passing argument 4 of 'hugetlb_file_setup' from 
>> incompatible pointer type [-Werror=incompatible-pointer-types]
     653 |     &shp->mlock_cred, HUGETLB_SHMFS_INODE,
         |     ^~~~~~~~~~~~~~~~
         |     |
         |     const struct cred **
   In file included from ipc/shm.c:30:
   include/linux/hugetlb.h:457:17: note: expected 'struct cred **' but argument 
is of type 'const struct cred **'
     457 |   struct cred **cred, int creat_flags,
         |   ~~~~~~~~~~~~~~^~~~
   cc1: some warnings being treated as errors


vim +/hugetlb_file_setup +1626 mm/mmap.c

  1590  
  1591  unsigned long ksys_mmap_pgoff(unsigned long addr, unsigned long len,
  1592                                unsigned long prot, unsigned long flags,
  1593                                unsigned long fd, unsigned long pgoff)
  1594  {
  1595          struct file *file = NULL;
  1596          unsigned long retval;
  1597  
  1598          if (!(flags & MAP_ANONYMOUS)) {
  1599                  audit_mmap_fd(fd, flags);
  1600                  file = fget(fd);
  1601                  if (!file)
  1602                          return -EBADF;
  1603                  if (is_file_hugepages(file)) {
  1604                          len = ALIGN(len, 
huge_page_size(hstate_file(file)));
  1605                  } else if (unlikely(flags & MAP_HUGETLB)) {
  1606                          retval = -EINVAL;
  1607                          goto out_fput;
  1608                  }
  1609          } else if (flags & MAP_HUGETLB) {
  1610                  const struct cred *cred;
  1611                  struct hstate *hs;
  1612  
  1613                  hs = hstate_sizelog((flags >> MAP_HUGE_SHIFT) & 
MAP_HUGE_MASK);
  1614                  if (!hs)
  1615                          return -EINVAL;
  1616  
  1617                  len = ALIGN(len, huge_page_size(hs));
  1618                  /*
  1619                   * VM_NORESERVE is used because the reservations will be
  1620                   * taken when vm_ops->mmap() is called
  1621                   * A dummy user value is used because we are not locking
  1622                   * memory so no accounting is necessary
  1623                   */
  1624                  file = hugetlb_file_setup(HUGETLB_ANON_FILE, len,
  1625                                  VM_NORESERVE,
> 1626                                  &cred, HUGETLB_ANONHUGE_INODE,
  1627                                  (flags >> MAP_HUGE_SHIFT) & 
MAP_HUGE_MASK);
  1628                  if (IS_ERR(file))
  1629                          return PTR_ERR(file);
  1630          }
  1631  
  1632          flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
  1633  
  1634          retval = vm_mmap_pgoff(file, addr, len, prot, flags, pgoff);
  1635  out_fput:
  1636          if (file)
  1637                  fput(file);
  1638          return retval;
  1639  }
  1640  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org

Attachment: .config.gz
Description: application/gzip

Reply via email to