linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Suren Baghdasaryan <surenb@google.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 2565/2825] mm/userfaultfd.c:983 move_zeropage_pte() warn: inconsistent returns 'dst_ptl'.
Date: Tue, 30 Jan 2024 08:13:00 +0300	[thread overview]
Message-ID: <1a42e4fc-54a0-49f1-94ba-f075e0ef29a8@moroto.mountain> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   596764183be8ebb13352b281a442a1f1151c9b06
commit: ea4df6a5ea81105879ca5549555e231c4596fbc4 [2565/2825] userfaultfd: handle zeropage moves by UFFDIO_MOVE
config: x86_64-randconfig-161-20240129 (https://download.01.org/0day-ci/archive/20240130/202401300107.U8iMAkTl-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202401300107.U8iMAkTl-lkp@intel.com/

smatch warnings:
mm/userfaultfd.c:983 move_zeropage_pte() warn: inconsistent returns 'dst_ptl'.

vim +/dst_ptl +983 mm/userfaultfd.c

ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  962  static int move_zeropage_pte(struct mm_struct *mm,
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  963  			     struct vm_area_struct *dst_vma,
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  964  			     struct vm_area_struct *src_vma,
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  965  			     unsigned long dst_addr, unsigned long src_addr,
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  966  			     pte_t *dst_pte, pte_t *src_pte,
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  967  			     pte_t orig_dst_pte, pte_t orig_src_pte,
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  968  			     spinlock_t *dst_ptl, spinlock_t *src_ptl)
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  969  {
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  970  	pte_t zero_pte;
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  971  
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  972  	double_pt_lock(dst_ptl, src_ptl);
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  973  	if (!pte_same(ptep_get(src_pte), orig_src_pte) ||
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  974  	    !pte_same(ptep_get(dst_pte), orig_dst_pte))
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  975  		return -EAGAIN;

double_pt_unlock(dst_ptl, src_ptl) before returning?

ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  976  
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  977  	zero_pte = pte_mkspecial(pfn_pte(my_zero_pfn(dst_addr),
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  978  					 dst_vma->vm_page_prot));
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  979  	ptep_clear_flush(src_vma, src_addr, src_pte);
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  980  	set_pte_at(mm, dst_addr, dst_pte, zero_pte);
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  981  	double_pt_unlock(dst_ptl, src_ptl);
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  982  
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24 @983  	return 0;
ea4df6a5ea8110 Suren Baghdasaryan 2024-01-24  984  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



             reply	other threads:[~2024-01-30  5:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  5:13 Dan Carpenter [this message]
2024-01-31  2:37 ` Suren Baghdasaryan
2024-01-31 18:03   ` Suren Baghdasaryan

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=1a42e4fc-54a0-49f1-94ba-f075e0ef29a8@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=surenb@google.com \
    /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