From: kernel test robot <lkp@intel.com>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 10184/10591] mm/gup.c:3446 pin_user_pages_fd() warn: unsigned 'start' is never less than zero.
Date: Tue, 10 Oct 2023 04:07:04 +0800 [thread overview]
Message-ID: <202310100409.LrBAYpmk-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 2a860505b617cf8fda4ebff6cf05d3f774145440
commit: ad999eeb01ea4bd5c667d80e5c2cea4ef9c47e3e [10184/10591] mm/gup: introduce pin_user_pages_fd() for pinning shmem/hugetlbfs file pages
config: i386-randconfig-141-20231008 (https://download.01.org/0day-ci/archive/20231010/202310100409.LrBAYpmk-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231010/202310100409.LrBAYpmk-lkp@intel.com/reproduce)
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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310100409.LrBAYpmk-lkp@intel.com/
smatch warnings:
mm/gup.c:3446 pin_user_pages_fd() warn: unsigned 'start' is never less than zero.
vim +/start +3446 mm/gup.c
3413
3414 /**
3415 * pin_user_pages_fd() - pin user pages associated with a file
3416 * @fd: the fd whose pages are to be pinned
3417 * @start: starting file offset
3418 * @nr_pages: number of pages from start to pin
3419 * @gup_flags: flags modifying pin behaviour
3420 * @pages: array that receives pointers to the pages pinned.
3421 * Should be at least nr_pages long.
3422 *
3423 * Attempt to pin (and migrate) pages associated with a file belonging to
3424 * either shmem or hugetlbfs. An error is returned if pages associated with
3425 * hugetlbfs files are not present in the page cache. However, shmem pages
3426 * are swapped in or allocated if they are not present in the page cache.
3427 *
3428 * Returns number of pages pinned. This would be equal to the number of
3429 * pages requested.
3430 * If nr_pages is 0 or negative, returns 0. If no pages were pinned, returns
3431 * -errno.
3432 */
3433 long pin_user_pages_fd(int fd, pgoff_t start, unsigned long nr_pages,
3434 unsigned int gup_flags, struct page **pages)
3435 {
3436 struct page *page;
3437 struct file *filep;
3438 unsigned int flags, i;
3439 long ret;
3440
3441 if (nr_pages <= 0)
3442 return 0;
3443 if (!is_valid_gup_args(pages, NULL, &gup_flags, FOLL_PIN))
3444 return 0;
3445
> 3446 if (start < 0)
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-10-09 20:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202310100409.LrBAYpmk-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=vivek.kasireddy@intel.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