[rcu:willy-maple 166/202] ipc/shm.c:1717:18: error: 'mas' undeclared; did you mean

From: kernel test robot
Date: Wed Feb 03 2021 - 08:38:15 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git willy-maple
head: 7e346d2845b4bd77663394f39fa70456e0084c86
commit: 33a8e095b173365f8adf8cb7fda5224d514f0359 [166/202] ipc/shm: Stop using the vma linked list
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-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://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=33a8e095b173365f8adf8cb7fda5224d514f0359
git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
git fetch --no-tags rcu willy-maple
git checkout 33a8e095b173365f8adf8cb7fda5224d514f0359
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=c6x

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from include/linux/mm_types.h:11,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from ipc/shm.c:28:
include/linux/maple_tree.h:79:22: error: 'MAPLE_RANGE64_SLOTS' undeclared here (not in a function)
79 | unsigned long pivot[MAPLE_RANGE64_SLOTS - 1];
| ^~~~~~~~~~~~~~~~~~~
include/linux/maple_tree.h:85:22: error: 'MAPLE_ARANGE64_SLOTS' undeclared here (not in a function)
85 | unsigned long pivot[MAPLE_ARANGE64_SLOTS - 1];
| ^~~~~~~~~~~~~~~~~~~~
include/linux/maple_tree.h:91:28: error: 'MAPLE_NODE_SLOTS' undeclared here (not in a function); did you mean 'MAPLE_ALLOC_SLOTS'?
91 | #define MAPLE_ALLOC_SLOTS (MAPLE_NODE_SLOTS - 1)
| ^~~~~~~~~~~~~~~~
include/linux/maple_tree.h:96:27: note: in expansion of macro 'MAPLE_ALLOC_SLOTS'
96 | struct maple_alloc *slot[MAPLE_ALLOC_SLOTS];
| ^~~~~~~~~~~~~~~~~
In file included from ipc/shm.c:29:
include/linux/mm.h:2595:6: warning: no previous prototype for 'mm_populate_vma' [-Wmissing-prototypes]
2595 | void mm_populate_vma(struct vm_area_struct *vma, unsigned long start,
| ^~~~~~~~~~~~~~~
ipc/shm.c: In function 'ksys_shmdt':
>> ipc/shm.c:1717:18: error: 'mas' undeclared (first use in this function); did you mean 'max'?
1717 | vma = mas_walk(&mas);
| ^~~
| max
ipc/shm.c:1717:18: note: each undeclared identifier is reported only once for each function it appears in


vim +1717 ipc/shm.c

1636
1637 if (addr & ~PAGE_MASK)
1638 return retval;
1639
1640 if (mmap_write_lock_killable(mm))
1641 return -EINTR;
1642
1643 /*
1644 * This function tries to be smart and unmap shm segments that
1645 * were modified by partial mlock or munmap calls:
1646 * - It first determines the size of the shm segment that should be
1647 * unmapped: It searches for a vma that is backed by shm and that
1648 * started at address shmaddr. It records it's size and then unmaps
1649 * it.
1650 * - Then it unmaps all shm vmas that started at shmaddr and that
1651 * are within the initially determined size and that are from the
1652 * same shm segment from which we determined the size.
1653 * Errors from do_munmap are ignored: the function only fails if
1654 * it's called with invalid parameters or if it's called to unmap
1655 * a part of a vma. Both calls in this function are for full vmas,
1656 * the parameters are directly copied from the vma itself and always
1657 * valid - therefore do_munmap cannot fail. (famous last words?)
1658 */
1659 /*
1660 * If it had been mremap()'d, the starting address would not
1661 * match the usual checks anyway. So assume all vma's are
1662 * above the starting address given.
1663 */
1664
1665 #ifdef CONFIG_MMU
1666 vma = mas_find(&mas, ULONG_MAX);
1667 while (vma) {
1668 next = mas_find(&mas, ULONG_MAX);
1669
1670 /*
1671 * Check if the starting address would match, i.e. it's
1672 * a fragment created by mprotect() and/or munmap(), or it
1673 * otherwise it starts at this address with no hassles.
1674 */
1675 if ((vma->vm_ops == &shm_vm_ops) &&
1676 (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) {
1677
1678 /*
1679 * Record the file of the shm segment being
1680 * unmapped. With mremap(), someone could place
1681 * page from another segment but with equal offsets
1682 * in the range we are unmapping.
1683 */
1684 file = vma->vm_file;
1685 size = i_size_read(file_inode(vma->vm_file));
1686 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start, NULL);
1687 /*
1688 * We discovered the size of the shm segment, so
1689 * break out of here and fall through to the next
1690 * loop that uses the size information to stop
1691 * searching for matching vma's.
1692 */
1693 retval = 0;
1694 vma = next;
1695 break;
1696 }
1697 vma = next;
1698 }
1699
1700 /*
1701 * We need look no further than the maximum address a fragment
1702 * could possibly have landed at. Also cast things to loff_t to
1703 * prevent overflows and make comparisons vs. equal-width types.
1704 */
1705 size = PAGE_ALIGN(size);
1706 while (vma && (loff_t)(vma->vm_end - addr) <= size) {
1707 /* finding a matching vma now does not alter retval */
1708 if ((vma->vm_ops == &shm_vm_ops) &&
1709 ((vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) &&
1710 (vma->vm_file == file))
1711 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start, NULL);
1712
1713 vma = mas_find(&mas, addr + size - 1);
1714 }
1715
1716 #else /* CONFIG_MMU */
> 1717 vma = mas_walk(&mas);
1718 /* under NOMMU conditions, the exact address to be destroyed must be
1719 * given
1720 */
1721 if (vma && vma->vm_ops == &shm_vm_ops) {
1722 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start, NULL);
1723 retval = 0;
1724 }
1725

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

Attachment: .config.gz
Description: application/gzip