Hi Damien, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on v6.17-rc4 next-20250902] [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/Damien-Le-Moal/md-Correctly-disable-write-zeroes-for-raid-1-10-and-5/20250902-174321 base: linus/master patch link: https://lore.kernel.org/r/20250902093843.187767-1-dlemoal%40kernel.org patch subject: [PATCH] md: Correctly disable write zeroes for raid 1, 10 and 5 config: i386-buildonly-randconfig-004-20250903 (https://download.01.org/0day-ci/archive/20250903/202509030804.BSCTfNfn-lkp@xxxxxxxxx/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250903/202509030804.BSCTfNfn-lkp@xxxxxxxxx/reproduce) 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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202509030804.BSCTfNfn-lkp@xxxxxxxxx/ All errors (new ones prefixed by >>): drivers/md/raid5.c:4207:7: warning: variable 'qread' set but not used [-Wunused-but-set-variable] 4207 | int qread =0; | ^ >> drivers/md/raid5.c:7735:38: error: expected ';' after expression 7735 | lim.max_hw_wzeroes_unmap_sectors = 0 | ^ | ; 1 warning and 1 error generated. vim +7735 drivers/md/raid5.c 7709 7710 static int raid5_set_limits(struct mddev *mddev) 7711 { 7712 struct r5conf *conf = mddev->private; 7713 struct queue_limits lim; 7714 int data_disks, stripe; 7715 struct md_rdev *rdev; 7716 7717 /* 7718 * The read-ahead size must cover two whole stripes, which is 7719 * 2 * (datadisks) * chunksize where 'n' is the number of raid devices. 7720 */ 7721 data_disks = conf->previous_raid_disks - conf->max_degraded; 7722 7723 /* 7724 * We can only discard a whole stripe. It doesn't make sense to 7725 * discard data disk but write parity disk 7726 */ 7727 stripe = roundup_pow_of_two(data_disks * (mddev->chunk_sectors << 9)); 7728 7729 md_init_stacking_limits(&lim); 7730 lim.io_min = mddev->chunk_sectors << 9; 7731 lim.io_opt = lim.io_min * (conf->raid_disks - conf->max_degraded); 7732 lim.features |= BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE; 7733 lim.discard_granularity = stripe; 7734 lim.max_write_zeroes_sectors = 0; > 7735 lim.max_hw_wzeroes_unmap_sectors = 0 7736 mddev_stack_rdev_limits(mddev, &lim, 0); 7737 rdev_for_each(rdev, mddev) 7738 queue_limits_stack_bdev(&lim, rdev->bdev, rdev->new_data_offset, 7739 mddev->gendisk->disk_name); 7740 7741 /* 7742 * Zeroing is required for discard, otherwise data could be lost. 7743 * 7744 * Consider a scenario: discard a stripe (the stripe could be 7745 * inconsistent if discard_zeroes_data is 0); write one disk of the 7746 * stripe (the stripe could be inconsistent again depending on which 7747 * disks are used to calculate parity); the disk is broken; The stripe 7748 * data of this disk is lost. 7749 * 7750 * We only allow DISCARD if the sysadmin has confirmed that only safe 7751 * devices are in use by setting a module parameter. A better idea 7752 * might be to turn DISCARD into WRITE_ZEROES requests, as that is 7753 * required to be safe. 7754 */ 7755 if (!devices_handle_discard_safely || 7756 lim.max_discard_sectors < (stripe >> 9) || 7757 lim.discard_granularity < stripe) 7758 lim.max_hw_discard_sectors = 0; 7759 7760 /* 7761 * Requests require having a bitmap for each stripe. 7762 * Limit the max sectors based on this. 7763 */ 7764 lim.max_hw_sectors = RAID5_MAX_REQ_STRIPES << RAID5_STRIPE_SHIFT(conf); 7765 7766 /* No restrictions on the number of segments in the request */ 7767 lim.max_segments = USHRT_MAX; 7768 7769 return queue_limits_set(mddev->gendisk->queue, &lim); 7770 } 7771 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki