From: kernel test robot <lkp@intel.com>
To: "Mike Rapoport (IBM)" <rppt@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, Mike Rapoport <rppt@kernel.org>
Subject: [rppt:unmapped-alloc/rfc-v1 5/5] mm/secretmem.c:56:23: warning: unused variable 'addr'
Date: Tue, 7 Mar 2023 22:15:25 +0800 [thread overview]
Message-ID: <202303072217.EtTWF7gn-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git unmapped-alloc/rfc-v1
head: c10ae02315f6ea2dd0b6c74a8ba82ea7ca33cda2
commit: c10ae02315f6ea2dd0b6c74a8ba82ea7ca33cda2 [5/5] EXPERIMENTAL: mm/secretmem: use __GFP_UNMAPPED
config: x86_64-buildonly-randconfig-r001-20230306 (https://download.01.org/0day-ci/archive/20230307/202303072217.EtTWF7gn-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id=c10ae02315f6ea2dd0b6c74a8ba82ea7ca33cda2
git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
git fetch --no-tags rppt unmapped-alloc/rfc-v1
git checkout c10ae02315f6ea2dd0b6c74a8ba82ea7ca33cda2
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303072217.EtTWF7gn-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/secretmem.c: In function 'secretmem_fault':
>> mm/secretmem.c:56:23: warning: unused variable 'addr' [-Wunused-variable]
56 | unsigned long addr;
| ^~~~
vim +/addr +56 mm/secretmem.c
9a436f8ff6316c Mike Rapoport 2021-07-07 49
1507f51255c9ff Mike Rapoport 2021-07-07 50 static vm_fault_t secretmem_fault(struct vm_fault *vmf)
1507f51255c9ff Mike Rapoport 2021-07-07 51 {
1507f51255c9ff Mike Rapoport 2021-07-07 52 struct address_space *mapping = vmf->vma->vm_file->f_mapping;
1507f51255c9ff Mike Rapoport 2021-07-07 53 struct inode *inode = file_inode(vmf->vma->vm_file);
1507f51255c9ff Mike Rapoport 2021-07-07 54 pgoff_t offset = vmf->pgoff;
1507f51255c9ff Mike Rapoport 2021-07-07 55 gfp_t gfp = vmf->gfp_mask;
1507f51255c9ff Mike Rapoport 2021-07-07 @56 unsigned long addr;
1507f51255c9ff Mike Rapoport 2021-07-07 57 struct page *page;
84ac013046ccc4 Mike Rapoport 2022-07-07 58 vm_fault_t ret;
1507f51255c9ff Mike Rapoport 2021-07-07 59 int err;
1507f51255c9ff Mike Rapoport 2021-07-07 60
1507f51255c9ff Mike Rapoport 2021-07-07 61 if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))
1507f51255c9ff Mike Rapoport 2021-07-07 62 return vmf_error(-EINVAL);
1507f51255c9ff Mike Rapoport 2021-07-07 63
84ac013046ccc4 Mike Rapoport 2022-07-07 64 filemap_invalidate_lock_shared(mapping);
84ac013046ccc4 Mike Rapoport 2022-07-07 65
1507f51255c9ff Mike Rapoport 2021-07-07 66 retry:
1507f51255c9ff Mike Rapoport 2021-07-07 67 page = find_lock_page(mapping, offset);
1507f51255c9ff Mike Rapoport 2021-07-07 68 if (!page) {
c10ae02315f6ea Mike Rapoport (IBM 2022-11-17 69) page = alloc_page(gfp | __GFP_ZERO | __GFP_UNMAPPED);
84ac013046ccc4 Mike Rapoport 2022-07-07 70 if (!page) {
84ac013046ccc4 Mike Rapoport 2022-07-07 71 ret = VM_FAULT_OOM;
84ac013046ccc4 Mike Rapoport 2022-07-07 72 goto out;
84ac013046ccc4 Mike Rapoport 2022-07-07 73 }
1507f51255c9ff Mike Rapoport 2021-07-07 74
1507f51255c9ff Mike Rapoport 2021-07-07 75 __SetPageUptodate(page);
1507f51255c9ff Mike Rapoport 2021-07-07 76 err = add_to_page_cache_lru(page, mapping, offset, gfp);
1507f51255c9ff Mike Rapoport 2021-07-07 77 if (unlikely(err)) {
1507f51255c9ff Mike Rapoport 2021-07-07 78 put_page(page);
1507f51255c9ff Mike Rapoport 2021-07-07 79 if (err == -EEXIST)
1507f51255c9ff Mike Rapoport 2021-07-07 80 goto retry;
1507f51255c9ff Mike Rapoport 2021-07-07 81
84ac013046ccc4 Mike Rapoport 2022-07-07 82 ret = vmf_error(err);
84ac013046ccc4 Mike Rapoport 2022-07-07 83 goto out;
1507f51255c9ff Mike Rapoport 2021-07-07 84 }
1507f51255c9ff Mike Rapoport 2021-07-07 85 }
1507f51255c9ff Mike Rapoport 2021-07-07 86
1507f51255c9ff Mike Rapoport 2021-07-07 87 vmf->page = page;
84ac013046ccc4 Mike Rapoport 2022-07-07 88 ret = VM_FAULT_LOCKED;
84ac013046ccc4 Mike Rapoport 2022-07-07 89
84ac013046ccc4 Mike Rapoport 2022-07-07 90 out:
84ac013046ccc4 Mike Rapoport 2022-07-07 91 filemap_invalidate_unlock_shared(mapping);
84ac013046ccc4 Mike Rapoport 2022-07-07 92 return ret;
1507f51255c9ff Mike Rapoport 2021-07-07 93 }
1507f51255c9ff Mike Rapoport 2021-07-07 94
:::::: The code at line 56 was first introduced by commit
:::::: 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49 mm: introduce memfd_secret system call to create "secret" memory areas
:::::: TO: Mike Rapoport <rppt@linux.ibm.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next reply other threads:[~2023-03-07 14:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 14:15 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-03-06 22:33 [rppt:unmapped-alloc/rfc-v1 5/5] mm/secretmem.c:56:23: warning: unused variable 'addr' kernel test robot
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=202303072217.EtTWF7gn-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rppt@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.