Re: [PATCH v2] f2fs: add iostat latency statistics support for discard

From: kernel test robot
Date: Mon Mar 20 2023 - 22:18:20 EST


Hi Yangtao,

I love your patch! Perhaps something to improve:

[auto build test WARNING on jaegeuk-f2fs/dev-test]
[also build test WARNING on jaegeuk-f2fs/dev linus/master v6.3-rc3 next-20230320]
[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/Yangtao-Li/f2fs-add-iostat-latency-statistics-support-for-discard/20230321-020736
base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
patch link: https://lore.kernel.org/r/20230320175529.39129-1-frank.li%40vivo.com
patch subject: [PATCH v2] f2fs: add iostat latency statistics support for discard
config: x86_64-randconfig-s023 (https://download.01.org/0day-ci/archive/20230321/202303211005.RGxljvli-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/a094ea0014763420eb8e3577552baac00c63efad
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yangtao-Li/f2fs-add-iostat-latency-statistics-support-for-discard/20230321-020736
git checkout a094ea0014763420eb8e3577552baac00c63efad
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 olddefconfig
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash fs/f2fs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202303211005.RGxljvli-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> fs/f2fs/iostat.c:259:29: sparse: sparse: mixing different enum types:
>> fs/f2fs/iostat.c:259:29: sparse: unsigned int enum iostat_lat_type
>> fs/f2fs/iostat.c:259:29: sparse: unsigned int enum page_type
fs/f2fs/iostat.c:262:29: sparse: sparse: mixing different enum types:
fs/f2fs/iostat.c:262:29: sparse: unsigned int enum iostat_lat_type
fs/f2fs/iostat.c:262:29: sparse: unsigned int enum page_type

vim +259 fs/f2fs/iostat.c

246
247 void iostat_update_submit_ctx(struct bio *bio, enum page_type type)
248 {
249 struct bio_iostat_ctx *iostat_ctx = bio->bi_private;
250 enum iostat_lat_type lat_type;
251
252 iostat_ctx->submit_ts = jiffies;
253
254 if (type == DISCARD) {
255 lat_type = DISCARD_LAT;
256 } else if (op_is_write(bio_op(bio))) {
257 lat_type = bio->bi_opf & REQ_SYNC ?
258 WRITE_SYNC_DATA_LAT : WRITE_ASYNC_DATA_LAT;
> 259 lat_type += type;
260 } else {
261 lat_type = READ_DATA_LAT;
262 lat_type += type;
263 }
264
265 iostat_ctx->lat_type = lat_type;
266 }
267

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests