Hi Gao,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on xiang-erofs/dev-test]
[also build test WARNING on v5.15]
[cannot apply to next-20211112]
[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]
url:
https://github.com/0day-ci/linux/commits/Gao-Xiang/erofs-add-multiple-dev...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git dev-test
config: i386-randconfig-s002-20210928 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
#
https://github.com/0day-ci/linux/commit/5fd2e534e5f1ed05de1b7c46d55830c42...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Gao-Xiang/erofs-add-multiple-device-support/20210928-161752
git checkout 5fd2e534e5f1ed05de1b7c46d55830c422b09a3d
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir
ARCH=i386 SHELL=/bin/bash fs/erofs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> fs/erofs/data.c:139:38: sparse: sparse: restricted __le16
degrades to integer
vim +139 fs/erofs/data.c
79
80 static int erofs_map_blocks(struct inode *inode,
81 struct erofs_map_blocks *map, int flags)
82 {
83 struct super_block *sb = inode->i_sb;
84 struct erofs_inode *vi = EROFS_I(inode);
85 struct erofs_inode_chunk_index *idx;
86 struct page *page;
87 u64 chunknr;
88 unsigned int unit;
89 erofs_off_t pos;
90 int err = 0;
91
92 map->m_deviceid = 0;
93 if (map->m_la >= inode->i_size) {
94 /* leave out-of-bound access unmapped */
95 map->m_flags = 0;
96 map->m_plen = 0;
97 goto out;
98 }
99
100 if (vi->datalayout != EROFS_INODE_CHUNK_BASED)
101 return erofs_map_blocks_flatmode(inode, map, flags);
102
103 if (vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES)
104 unit = sizeof(*idx); /* chunk index */
105 else
106 unit = EROFS_BLOCK_MAP_ENTRY_SIZE; /* block map */
107
108 chunknr = map->m_la >> vi->chunkbits;
109 pos = ALIGN(iloc(EROFS_SB(sb), vi->nid) + vi->inode_isize +
110 vi->xattr_isize, unit) + unit * chunknr;
111
112 page = erofs_get_meta_page(inode->i_sb, erofs_blknr(pos));
113 if (IS_ERR(page))
114 return PTR_ERR(page);
115
116 map->m_la = chunknr << vi->chunkbits;
117 map->m_plen = min_t(erofs_off_t, 1UL << vi->chunkbits,
118 roundup(inode->i_size - map->m_la, EROFS_BLKSIZ));
119
120 /* handle block map */
121 if (!(vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES)) {
122 __le32 *blkaddr = page_address(page) + erofs_blkoff(pos);
123
124 if (le32_to_cpu(*blkaddr) == EROFS_NULL_ADDR) {
125 map->m_flags = 0;
126 } else {
127 map->m_pa = blknr_to_addr(le32_to_cpu(*blkaddr));
128 map->m_flags = EROFS_MAP_MAPPED;
129 }
130 goto out_unlock;
131 }
132 /* parse chunk indexes */
133 idx = page_address(page) + erofs_blkoff(pos);
134 switch (le32_to_cpu(idx->blkaddr)) {
135 case EROFS_NULL_ADDR:
136 map->m_flags = 0;
137 break;
138 default:
139 map->m_deviceid = idx->device_id &
EROFS_SB(sb)->device_id_mask;
140 map->m_pa =
blknr_to_addr(le32_to_cpu(idx->blkaddr));
141 map->m_flags = EROFS_MAP_MAPPED;
142 break;
143 }
144 out_unlock:
145 unlock_page(page);
146 put_page(page);
147 out:
148 map->m_llen = map->m_plen;
149 return err;
150 }
151
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org