From: kernel test robot <lkp@intel.com>
To: Joanne Koong <joannelkoong@gmail.com>,
miklos@szeredi.hu, linux-fsdevel@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
josef@toxicpanda.com, bernd.schubert@fastmail.fm,
willy@infradead.org, kernel-team@meta.com
Subject: Re: [PATCH v2 09/13] fuse: convert retrieves to use folios
Date: Thu, 24 Oct 2024 04:53:16 +0800 [thread overview]
Message-ID: <202410240414.YVec3s6S-lkp@intel.com> (raw)
In-Reply-To: <20241022185443.1891563-10-joannelkoong@gmail.com>
Hi Joanne,
kernel test robot noticed the following build warnings:
[auto build test WARNING on mszeredi-fuse/for-next]
[also build test WARNING on next-20241023]
[cannot apply to akpm-mm/mm-everything linus/master v6.12-rc4]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Joanne-Koong/fuse-support-folios-in-struct-fuse_args_pages-and-fuse_copy_pages/20241023-025923
base: https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git for-next
patch link: https://lore.kernel.org/r/20241022185443.1891563-10-joannelkoong%40gmail.com
patch subject: [PATCH v2 09/13] fuse: convert retrieves to use folios
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20241024/202410240414.YVec3s6S-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241024/202410240414.YVec3s6S-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/202410240414.YVec3s6S-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/fuse/dev.c:1773:43: warning: variable 'num_folios' is uninitialized when used here [-Wuninitialized]
1773 | ap->folio_descs = (void *) (ap->folios + num_folios);
| ^~~~~~~~~~
fs/fuse/dev.c:1745:25: note: initialize the variable 'num_folios' to silence this warning
1745 | unsigned int num_folios;
| ^
| = 0
1 warning generated.
vim +/num_folios +1773 fs/fuse/dev.c
1734
1735 static int fuse_retrieve(struct fuse_mount *fm, struct inode *inode,
1736 struct fuse_notify_retrieve_out *outarg)
1737 {
1738 int err;
1739 struct address_space *mapping = inode->i_mapping;
1740 pgoff_t index;
1741 loff_t file_size;
1742 unsigned int num;
1743 unsigned int offset;
1744 size_t total_len = 0;
1745 unsigned int num_folios;
1746 unsigned int num_pages, cur_pages = 0;
1747 struct fuse_conn *fc = fm->fc;
1748 struct fuse_retrieve_args *ra;
1749 size_t args_size = sizeof(*ra);
1750 struct fuse_args_pages *ap;
1751 struct fuse_args *args;
1752
1753 offset = outarg->offset & ~PAGE_MASK;
1754 file_size = i_size_read(inode);
1755
1756 num = min(outarg->size, fc->max_write);
1757 if (outarg->offset > file_size)
1758 num = 0;
1759 else if (outarg->offset + num > file_size)
1760 num = file_size - outarg->offset;
1761
1762 num_pages = (num + offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
1763 num_pages = min(num_pages, fc->max_pages);
1764
1765 args_size += num_pages * (sizeof(ap->folios[0]) + sizeof(ap->folio_descs[0]));
1766
1767 ra = kzalloc(args_size, GFP_KERNEL);
1768 if (!ra)
1769 return -ENOMEM;
1770
1771 ap = &ra->ap;
1772 ap->folios = (void *) (ra + 1);
> 1773 ap->folio_descs = (void *) (ap->folios + num_folios);
1774 ap->uses_folios = true;
1775
1776 args = &ap->args;
1777 args->nodeid = outarg->nodeid;
1778 args->opcode = FUSE_NOTIFY_REPLY;
1779 args->in_numargs = 2;
1780 args->in_pages = true;
1781 args->end = fuse_retrieve_end;
1782
1783 index = outarg->offset >> PAGE_SHIFT;
1784
1785 while (num && cur_pages < num_pages) {
1786 struct folio *folio;
1787 unsigned int this_num;
1788
1789 folio = filemap_get_folio(mapping, index);
1790 if (IS_ERR(folio))
1791 break;
1792
1793 this_num = min_t(unsigned, num, PAGE_SIZE - offset);
1794 ap->folios[ap->num_folios] = folio;
1795 ap->folio_descs[ap->num_folios].offset = offset;
1796 ap->folio_descs[ap->num_folios].length = this_num;
1797 ap->num_folios++;
1798 cur_pages++;
1799
1800 offset = 0;
1801 num -= this_num;
1802 total_len += this_num;
1803 index++;
1804 }
1805 ra->inarg.offset = outarg->offset;
1806 ra->inarg.size = total_len;
1807 args->in_args[0].size = sizeof(ra->inarg);
1808 args->in_args[0].value = &ra->inarg;
1809 args->in_args[1].size = total_len;
1810
1811 err = fuse_simple_notify_reply(fm, args, outarg->notify_unique);
1812 if (err)
1813 fuse_retrieve_end(fm, args, err);
1814
1815 return err;
1816 }
1817
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
parent reply other threads:[~2024-10-23 20:54 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20241022185443.1891563-10-joannelkoong@gmail.com>]
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=202410240414.YVec3s6S-lkp@intel.com \
--to=lkp@intel.com \
--cc=bernd.schubert@fastmail.fm \
--cc=joannelkoong@gmail.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@meta.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=miklos@szeredi.hu \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=willy@infradead.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