* [xiang-erofs:dev-test 2/2] fs/erofs/data.c:45 erofs_bread() warn: passing positive error code '(-4095)-(-1),1-4096' to 'ERR_PTR'
@ 2026-03-30 9:04 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-30 9:04 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Xiang Gao <xiang@kernel.org>
CC: linux-erofs@lists.ozlabs.org
TO: Gao Xiang <hsiangkao@linux.alibaba.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git dev-test
head: eabeee4332ac9b5d87ab602f845dbf0e9f854978
commit: eabeee4332ac9b5d87ab602f845dbf0e9f854978 [2/2] erofs: verify metadata accesses for file-backed mounts
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: arm-randconfig-r073-20260330 (https://download.01.org/0day-ci/archive/20260330/202603301620.6HyDa5ME-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.5.0
smatch: v0.5.0-9004-gb810ac53
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 <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202603301620.6HyDa5ME-lkp@intel.com/
smatch warnings:
fs/erofs/data.c:45 erofs_bread() warn: passing positive error code '(-4095)-(-1),1-4096' to 'ERR_PTR'
vim +45 fs/erofs/data.c
fdf80a4793021c2 Gao Xiang 2022-01-02 28
706e50e46af810f Bo Liu 2025-02-17 29 void *erofs_bread(struct erofs_buf *buf, erofs_off_t offset, bool need_kmap)
fdf80a4793021c2 Gao Xiang 2022-01-02 30 {
c36ec00d7f67590 Sheng Yong 2025-05-17 31 pgoff_t index = (buf->off + offset) >> PAGE_SHIFT;
5d3bb77e5fce1d2 Gao Xiang 2024-07-23 32 struct folio *folio = NULL;
eabeee4332ac9b5 Gao Xiang 2026-03-30 33 loff_t fpos;
eabeee4332ac9b5 Gao Xiang 2026-03-30 34 int err;
eabeee4332ac9b5 Gao Xiang 2026-03-30 35
eabeee4332ac9b5 Gao Xiang 2026-03-30 36 /*
eabeee4332ac9b5 Gao Xiang 2026-03-30 37 * Metadata access for file-backed mounts reuses page cache of backing
eabeee4332ac9b5 Gao Xiang 2026-03-30 38 * fs inodes (only folio data will be needed) to prevent double caching.
eabeee4332ac9b5 Gao Xiang 2026-03-30 39 * However, the data access range must be verified here in advance.
eabeee4332ac9b5 Gao Xiang 2026-03-30 40 */
eabeee4332ac9b5 Gao Xiang 2026-03-30 41 if (buf->file) {
eabeee4332ac9b5 Gao Xiang 2026-03-30 42 fpos = index << PAGE_SHIFT;
eabeee4332ac9b5 Gao Xiang 2026-03-30 43 err = rw_verify_area(READ, buf->file, &fpos, PAGE_SIZE);
eabeee4332ac9b5 Gao Xiang 2026-03-30 44 if (err)
eabeee4332ac9b5 Gao Xiang 2026-03-30 @45 return ERR_PTR(err);
eabeee4332ac9b5 Gao Xiang 2026-03-30 46 }
fdf80a4793021c2 Gao Xiang 2022-01-02 47
5d3bb77e5fce1d2 Gao Xiang 2024-07-23 48 if (buf->page) {
5d3bb77e5fce1d2 Gao Xiang 2024-07-23 49 folio = page_folio(buf->page);
5d3bb77e5fce1d2 Gao Xiang 2024-07-23 50 if (folio_file_page(folio, index) != buf->page)
5d3bb77e5fce1d2 Gao Xiang 2024-07-23 51 erofs_unmap_metabuf(buf);
5d3bb77e5fce1d2 Gao Xiang 2024-07-23 52 }
5d3bb77e5fce1d2 Gao Xiang 2024-07-23 53 if (!folio || !folio_contains(folio, index)) {
fdf80a4793021c2 Gao Xiang 2022-01-02 54 erofs_put_metabuf(buf);
3a23787ca875692 Gao Xiang 2024-11-15 55 folio = read_mapping_folio(buf->mapping, index, buf->file);
5375e7c8b0fef11 Jeffle Xu 2022-04-25 56 if (IS_ERR(folio))
5375e7c8b0fef11 Jeffle Xu 2022-04-25 57 return folio;
fdf80a4793021c2 Gao Xiang 2022-01-02 58 }
5d3bb77e5fce1d2 Gao Xiang 2024-07-23 59 buf->page = folio_file_page(folio, index);
706e50e46af810f Bo Liu 2025-02-17 60 if (!need_kmap)
fdf80a4793021c2 Gao Xiang 2022-01-02 61 return NULL;
706e50e46af810f Bo Liu 2025-02-17 62 if (!buf->base)
706e50e46af810f Bo Liu 2025-02-17 63 buf->base = kmap_local_page(buf->page);
fdf80a4793021c2 Gao Xiang 2022-01-02 64 return buf->base + (offset & ~PAGE_MASK);
fdf80a4793021c2 Gao Xiang 2022-01-02 65 }
fdf80a4793021c2 Gao Xiang 2022-01-02 66
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-30 9:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 9:04 [xiang-erofs:dev-test 2/2] fs/erofs/data.c:45 erofs_bread() warn: passing positive error code '(-4095)-(-1),1-4096' to 'ERR_PTR' kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox