Hi Christoph,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20230120]
[cannot apply to akpm-mm/mm-everything tytso-ext4/dev kdave/for-next
xfs-linux/for-next konis-nilfs2/upstream linus/master v6.2-rc4 v6.2-rc3
v6.2-rc2 v6.2-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/Christoph-Hellwig/mm-make-mapping_get_entry-available-outside-of-filemap-c/20230121-155847
patch link:https://lore.kernel.org/r/20230121065755.1140136-8-hch%40lst.de
patch subject: [PATCH 7/7] mm: return an ERR_PTR from __filemap_get_folio
config: riscv-randconfig-r013-20230119
(https://download.01.org/0day-ci/archive/20230121/202301211944.5t9l1rga-...@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project
4196ca3278f78c6e19246e54ab0ecb364e37d66a)
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
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv-linux-gnu
#
https://github.com/intel-lab-lkp/linux/commit/3c8a98fd03b82ace84668b3f8bb48d48e9f34af2
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review
Christoph-Hellwig/mm-make-mapping_get_entry-available-outside-of-filemap-c/20230121-155847
git checkout 3c8a98fd03b82ace84668b3f8bb48d48e9f34af2
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1
O=build_dir ARCH=riscv olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1
O=build_dir ARCH=riscv SHELL=/bin/bash fs/iomap/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot
All warnings (new ones prefixed by >>):
>> fs/iomap/buffered-io.c:669:28: warning: variable 'folio' is uninitialized
>> when used here [-Wuninitialized]
if (pos + len > folio_pos(folio) + folio_size(folio))
^
fs/iomap/buffered-io.c:636:21: note: initialize the variable 'folio' to
silence this warning
struct folio *folio;
^
= NULL
fs/iomap/buffered-io.c:598:22: warning: unused function '__iomap_get_folio'
[-Wunused-function]
static struct folio *__iomap_get_folio(struct iomap_iter *iter, loff_t pos,
^
2 warnings generated.
vim +/folio +669 fs/iomap/buffered-io.c
69f4a26c1e0c7c Gao Xiang 2021-08-03 630
d7b64041164ca1 Dave Chinner2022-11-29 631 static int
iomap_write_begin(struct iomap_iter *iter, loff_t pos,
bc6123a84a71b5 Matthew Wilcox (Oracle 2021-05-02 632) size_t
len, struct folio **foliop)
afc51aaa22f26c Darrick J. Wong 2019-07-15 633 {
471859f57d4253 Andreas Gruenbacher 2023-01-15 634 const struct
iomap_folio_ops *folio_ops = iter->iomap.folio_ops;
fad0a1ab34f777 Christoph Hellwig 2021-08-10 635 const struct
iomap *srcmap = iomap_iter_srcmap(iter);
d1bd0b4ebfe052 Matthew Wilcox (Oracle 2021-11-03 636) struct folio
*folio;
afc51aaa22f26c Darrick J. Wong 2019-07-15 637 int status = 0;
afc51aaa22f26c Darrick J. Wong 2019-07-15 638
1b5c1e36dc0e0f Christoph Hellwig 2021-08-10 639 BUG_ON(pos +
len > iter->iomap.offset + iter->iomap.length);
1b5c1e36dc0e0f Christoph Hellwig 2021-08-10 640 if (srcmap !=
&iter->iomap)
c039b997927263 Goldwyn Rodrigues 2019-10-18 641
BUG_ON(pos + len > srcmap->offset + srcmap->length);
afc51aaa22f26c Darrick J. Wong 2019-07-15 642
afc51aaa22f26c Darrick J. Wong 2019-07-15 643 if
(fatal_signal_pending(current))
afc51aaa22f26c Darrick J. Wong 2019-07-15 644 return
-EINTR;
afc51aaa22f26c Darrick J. Wong 2019-07-15 645
d454ab82bc7f4a Matthew Wilcox (Oracle 2021-12-09 646) if
(!mapping_large_folio_support(iter->inode->i_mapping))
d454ab82bc7f4a Matthew Wilcox (Oracle 2021-12-09 647) len =
min_t(size_t, len, PAGE_SIZE - offset_in_page(pos));
d454ab82bc7f4a Matthew Wilcox (Oracle 2021-12-09 648)
d7b64041164ca1 Dave Chinner2022-11-29 649 /*
d7b64041164ca1 Dave Chinner2022-11-29 650 * Now we have
a locked folio, before we do anything with it we need to
d7b64041164ca1 Dave Chinner2022-11-29 651 * check that
th