From: kernel test robot <lkp@intel.com>
To: Damien Le Moal <dlemoal@kernel.org>, Song Liu <song@kernel.org>,
Yu Kuai <yukuai3@huawei.com>,
linux-raid@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH] md: Correctly disable write zeroes for raid 1, 10 and 5
Date: Wed, 3 Sep 2025 09:16:49 +0800 [thread overview]
Message-ID: <202509030804.BSCTfNfn-lkp@intel.com> (raw)
In-Reply-To: <20250902093843.187767-1-dlemoal@kernel.org>
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@intel.com/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@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509030804.BSCTfNfn-lkp@intel.com/
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
prev parent reply other threads:[~2025-09-03 1:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 9:38 [PATCH] md: Correctly disable write zeroes for raid 1, 10 and 5 Damien Le Moal
2025-09-02 10:58 ` Yu Kuai
2025-09-03 2:46 ` Damien Le Moal
2025-09-03 1:16 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202509030804.BSCTfNfn-lkp@intel.com \
--to=lkp@intel.com \
--cc=dlemoal@kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=song@kernel.org \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox