From: kernel test robot <lkp@intel.com>
To: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 6850/7915] mm/mmap.c:1991:25: error: passing argument 1 of 'vma_find' from incompatible pointer type
Date: Thu, 24 Feb 2022 14:06:32 +0800 [thread overview]
Message-ID: <202202241403.qvb02FgB-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: d4a0ae62a277377de396850ed4b709b6bd9b7326
commit: b3d7ba3cdf23cae36715a695c7569f617e57d39d [6850/7915] mm: Remove the vma linked list
config: parisc-randconfig-r015-20220223 (https://download.01.org/0day-ci/archive/20220224/202202241403.qvb02FgB-lkp@intel.com/config)
compiler: hppa-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b3d7ba3cdf23cae36715a695c7569f617e57d39d
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout b3d7ba3cdf23cae36715a695c7569f617e57d39d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
mm/mmap.c:515:6: warning: no previous prototype for 'vma_store' [-Wmissing-prototypes]
515 | void vma_store(struct mm_struct *mm, struct vm_area_struct *vma)
| ^~~~~~~~~
mm/mmap.c: In function 'expand_upwards':
>> mm/mmap.c:1991:25: error: passing argument 1 of 'vma_find' from incompatible pointer type [-Werror=incompatible-pointer-types]
1991 | next = vma_find(mm, vma->vm_end);
| ^~
| |
| struct mm_struct *
In file included from arch/parisc/include/asm/cacheflush.h:5,
from include/linux/cacheflush.h:5,
from include/linux/highmem.h:8,
from include/linux/bvec.h:10,
from include/linux/blk_types.h:10,
from include/linux/writeback.h:13,
from include/linux/backing-dev.h:16,
from mm/mmap.c:14:
include/linux/mm.h:659:54: note: expected 'struct vma_iterator *' but argument is of type 'struct mm_struct *'
659 | struct vm_area_struct *vma_find(struct vma_iterator *vmi, unsigned long max)
| ~~~~~~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors
vim +/vma_find +1991 mm/mmap.c
1962
1963 #if defined(CONFIG_STACK_GROWSUP) || defined(CONFIG_IA64)
1964 /*
1965 * PA-RISC uses this for its stack; IA64 for its Register Backing Store.
1966 * vma is the last one with address > vma->vm_end. Have to extend vma.
1967 */
1968 int expand_upwards(struct vm_area_struct *vma, unsigned long address)
1969 {
1970 struct mm_struct *mm = vma->vm_mm;
1971 struct vm_area_struct *next;
1972 unsigned long gap_addr;
1973 int error = 0;
1974
1975 if (!(vma->vm_flags & VM_GROWSUP))
1976 return -EFAULT;
1977
1978 /* Guard against exceeding limits of the address space. */
1979 address &= PAGE_MASK;
1980 if (address >= (TASK_SIZE & PAGE_MASK))
1981 return -ENOMEM;
1982 address += PAGE_SIZE;
1983
1984 /* Enforce stack_guard_gap */
1985 gap_addr = address + stack_guard_gap;
1986
1987 /* Guard against overflow */
1988 if (gap_addr < address || gap_addr > TASK_SIZE)
1989 gap_addr = TASK_SIZE;
1990
> 1991 next = vma_find(mm, vma->vm_end);
1992 if (next && next->vm_start < gap_addr && vma_is_accessible(next)) {
1993 if (!(next->vm_flags & VM_GROWSUP))
1994 return -ENOMEM;
1995 /* Check that both stack segments have the same anon_vma? */
1996 }
1997
1998 /* We must make sure the anon_vma is allocated. */
1999 if (unlikely(anon_vma_prepare(vma)))
2000 return -ENOMEM;
2001
2002 /*
2003 * vma->vm_start/vm_end cannot change under us because the caller
2004 * is required to hold the mmap_lock in read mode. We need the
2005 * anon_vma lock to serialize against concurrent expand_stacks.
2006 */
2007 anon_vma_lock_write(vma->anon_vma);
2008
2009 /* Somebody else might have raced and expanded it already */
2010 if (address > vma->vm_end) {
2011 unsigned long size, grow;
2012
2013 size = address - vma->vm_start;
2014 grow = (address - vma->vm_end) >> PAGE_SHIFT;
2015
2016 error = -ENOMEM;
2017 if (vma->vm_pgoff + (size >> PAGE_SHIFT) >= vma->vm_pgoff) {
2018 error = acct_stack_growth(vma, size, grow);
2019 if (!error) {
2020 /*
2021 * We only hold a shared mmap_lock lock here, so
2022 * we need to protect against concurrent vma
2023 * expansions. anon_vma_lock_write() doesn't
2024 * help here, as we don't guarantee that all
2025 * growable vmas in a mm share the same root
2026 * anon vma. So, we reuse mm->page_table_lock
2027 * to guard against concurrent vma expansions.
2028 */
2029 spin_lock(&mm->page_table_lock);
2030 if (vma->vm_flags & VM_LOCKED)
2031 mm->locked_vm += grow;
2032 vm_stat_account(mm, vma->vm_flags, grow);
2033 anon_vma_interval_tree_pre_update_vma(vma);
2034 vma->vm_end = address;
2035 vma_store(mm, vma);
2036 anon_vma_interval_tree_post_update_vma(vma);
2037 spin_unlock(&mm->page_table_lock);
2038
2039 perf_event_mmap(vma);
2040 }
2041 }
2042 }
2043 anon_vma_unlock_write(vma->anon_vma);
2044 khugepaged_enter_vma_merge(vma, vma->vm_flags);
2045 return error;
2046 }
2047 #endif /* CONFIG_STACK_GROWSUP || CONFIG_IA64 */
2048
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next reply other threads:[~2022-02-24 6:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 6:06 kernel test robot [this message]
2022-02-24 17:46 ` [linux-next:master 6850/7915] mm/mmap.c:1991:25: error: passing argument 1 of 'vma_find' from incompatible pointer type Liam Howlett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202202241403.qvb02FgB-lkp@intel.com \
--to=lkp@intel.com \
--cc=Liam.Howlett@Oracle.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox