On Mon, Oct 17, 2022 at 11:17 AM kernel test robot lkp@intel.com wrote:
Hi Jack,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on song-md/md-next] [also build test WARNING on linus/master v6.1-rc1 next-20221017] [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/Jack-Wang/md-bitmap-Fix-bitma... base: git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next patch link: https://lore.kernel.org/r/20221014122032.47784-1-jinpu.wang%40ionos.com patch subject: [PATCH] md/bitmap: Fix bitmap chunk size overflow issues. config: microblaze-randconfig-r032-20221017 compiler: microblaze-linux-gcc (GCC) 12.1.0 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 # https://github.com/intel-lab-lkp/linux/commit/68927a99dc7197ea076a3b40d87633... git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jack-Wang/md-bitmap-Fix-bitmap-chunk-size-overflow-issues/20221017-103245 git checkout 68927a99dc7197ea076a3b40d876337073f70a58 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/md/
If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot lkp@intel.com
All warnings (new ones prefixed by >>):
drivers/md/md-bitmap.c: In function 'chunksize_store':
drivers/md/md-bitmap.c:2538:27: warning: left shift count >= width of type [-Wshift-count-overflow]
2538 | if (csize >= (1UL << (BITS_PER_BYTE * | ^~
Thanks will fix in v2.
vim +2538 drivers/md/md-bitmap.c
2523 2524 static ssize_t 2525 chunksize_store(struct mddev *mddev, const char *buf, size_t len) 2526 { 2527 /* Can only be changed when no bitmap is active */ 2528 int rv; 2529 unsigned long csize; 2530 if (mddev->bitmap) 2531 return -EBUSY; 2532 rv = kstrtoul(buf, 10, &csize); 2533 if (rv) 2534 return rv; 2535 if (csize < 512 || 2536 !is_power_of_2(csize)) 2537 return -EINVAL;
2538 if (csize >= (1UL << (BITS_PER_BYTE *
2539 sizeof(((bitmap_super_t *)0)->chunksize)))) 2540 return -EOVERFLOW; 2541 mddev->bitmap_info.chunksize = csize; 2542 return len; 2543 } 2544
-- 0-DAY CI Kernel Test Service https://01.org/lkp