From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [hch-block:block-api 11/15] drivers/md/raid10.c:4156:46: error: 'dev' undeclared; did you mean 'rdev'?
Date: Tue, 15 Feb 2022 21:26:34 +0800 [thread overview]
Message-ID: <202202152151.aV08HWVq-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 8360 bytes --]
tree: git://git.infradead.org/users/hch/block.git block-api
head: b2927488e4b27601e6724de62e4dd144fa52d02e
commit: 7287dbe367d69aca4c1216af60fe32a0e4bddedd [11/15] block: add a bdev_discard_granularity helper
config: alpha-randconfig-r022-20220214 (https://download.01.org/0day-ci/archive/20220215/202202152151.aV08HWVq-lkp(a)intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.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
git remote add hch-block git://git.infradead.org/users/hch/block.git
git fetch --no-tags hch-block block-api
git checkout 7287dbe367d69aca4c1216af60fe32a0e4bddedd
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/md/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/md/raid10.c: In function 'raid10_run':
>> drivers/md/raid10.c:4156:46: error: 'dev' undeclared (first use in this function); did you mean 'rdev'?
4156 | if (bdev_discard_granularity(dev->bdev))
| ^~~
| rdev
drivers/md/raid10.c:4156:46: note: each undeclared identifier is reported only once for each function it appears in
vim +4156 drivers/md/raid10.c
4073
4074 static int raid10_run(struct mddev *mddev)
4075 {
4076 struct r10conf *conf;
4077 int i, disk_idx;
4078 struct raid10_info *disk;
4079 struct md_rdev *rdev;
4080 sector_t size;
4081 sector_t min_offset_diff = 0;
4082 int first = 1;
4083 bool discard_supported = false;
4084
4085 if (mddev_init_writes_pending(mddev) < 0)
4086 return -ENOMEM;
4087
4088 if (mddev->private == NULL) {
4089 conf = setup_conf(mddev);
4090 if (IS_ERR(conf))
4091 return PTR_ERR(conf);
4092 mddev->private = conf;
4093 }
4094 conf = mddev->private;
4095 if (!conf)
4096 goto out;
4097
4098 if (mddev_is_clustered(conf->mddev)) {
4099 int fc, fo;
4100
4101 fc = (mddev->layout >> 8) & 255;
4102 fo = mddev->layout & (1<<16);
4103 if (fc > 1 || fo > 0) {
4104 pr_err("only near layout is supported by clustered"
4105 " raid10\n");
4106 goto out_free_conf;
4107 }
4108 }
4109
4110 mddev->thread = conf->thread;
4111 conf->thread = NULL;
4112
4113 if (mddev->queue) {
4114 blk_queue_max_discard_sectors(mddev->queue,
4115 UINT_MAX);
4116 blk_queue_max_write_same_sectors(mddev->queue, 0);
4117 blk_queue_max_write_zeroes_sectors(mddev->queue, 0);
4118 blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
4119 raid10_set_io_opt(conf);
4120 }
4121
4122 rdev_for_each(rdev, mddev) {
4123 long long diff;
4124
4125 disk_idx = rdev->raid_disk;
4126 if (disk_idx < 0)
4127 continue;
4128 if (disk_idx >= conf->geo.raid_disks &&
4129 disk_idx >= conf->prev.raid_disks)
4130 continue;
4131 disk = conf->mirrors + disk_idx;
4132
4133 if (test_bit(Replacement, &rdev->flags)) {
4134 if (disk->replacement)
4135 goto out_free_conf;
4136 disk->replacement = rdev;
4137 } else {
4138 if (disk->rdev)
4139 goto out_free_conf;
4140 disk->rdev = rdev;
4141 }
4142 diff = (rdev->new_data_offset - rdev->data_offset);
4143 if (!mddev->reshape_backwards)
4144 diff = -diff;
4145 if (diff < 0)
4146 diff = 0;
4147 if (first || diff < min_offset_diff)
4148 min_offset_diff = diff;
4149
4150 if (mddev->gendisk)
4151 disk_stack_limits(mddev->gendisk, rdev->bdev,
4152 rdev->data_offset << 9);
4153
4154 disk->head_position = 0;
4155
> 4156 if (bdev_discard_granularity(dev->bdev))
4157 discard_supported = true;
4158 first = 0;
4159 }
4160
4161 if (mddev->queue) {
4162 if (discard_supported)
4163 blk_queue_flag_set(QUEUE_FLAG_DISCARD,
4164 mddev->queue);
4165 else
4166 blk_queue_flag_clear(QUEUE_FLAG_DISCARD,
4167 mddev->queue);
4168 }
4169 /* need to check that every block has at least one working mirror */
4170 if (!enough(conf, -1)) {
4171 pr_err("md/raid10:%s: not enough operational mirrors.\n",
4172 mdname(mddev));
4173 goto out_free_conf;
4174 }
4175
4176 if (conf->reshape_progress != MaxSector) {
4177 /* must ensure that shape change is supported */
4178 if (conf->geo.far_copies != 1 &&
4179 conf->geo.far_offset == 0)
4180 goto out_free_conf;
4181 if (conf->prev.far_copies != 1 &&
4182 conf->prev.far_offset == 0)
4183 goto out_free_conf;
4184 }
4185
4186 mddev->degraded = 0;
4187 for (i = 0;
4188 i < conf->geo.raid_disks
4189 || i < conf->prev.raid_disks;
4190 i++) {
4191
4192 disk = conf->mirrors + i;
4193
4194 if (!disk->rdev && disk->replacement) {
4195 /* The replacement is all we have - use it */
4196 disk->rdev = disk->replacement;
4197 disk->replacement = NULL;
4198 clear_bit(Replacement, &disk->rdev->flags);
4199 }
4200
4201 if (!disk->rdev ||
4202 !test_bit(In_sync, &disk->rdev->flags)) {
4203 disk->head_position = 0;
4204 mddev->degraded++;
4205 if (disk->rdev &&
4206 disk->rdev->saved_raid_disk < 0)
4207 conf->fullsync = 1;
4208 }
4209
4210 if (disk->replacement &&
4211 !test_bit(In_sync, &disk->replacement->flags) &&
4212 disk->replacement->saved_raid_disk < 0) {
4213 conf->fullsync = 1;
4214 }
4215
4216 disk->recovery_disabled = mddev->recovery_disabled - 1;
4217 }
4218
4219 if (mddev->recovery_cp != MaxSector)
4220 pr_notice("md/raid10:%s: not clean -- starting background reconstruction\n",
4221 mdname(mddev));
4222 pr_info("md/raid10:%s: active with %d out of %d devices\n",
4223 mdname(mddev), conf->geo.raid_disks - mddev->degraded,
4224 conf->geo.raid_disks);
4225 /*
4226 * Ok, everything is just fine now
4227 */
4228 mddev->dev_sectors = conf->dev_sectors;
4229 size = raid10_size(mddev, 0, 0);
4230 md_set_array_sectors(mddev, size);
4231 mddev->resync_max_sectors = size;
4232 set_bit(MD_FAILFAST_SUPPORTED, &mddev->flags);
4233
4234 if (md_integrity_register(mddev))
4235 goto out_free_conf;
4236
4237 if (conf->reshape_progress != MaxSector) {
4238 unsigned long before_length, after_length;
4239
4240 before_length = ((1 << conf->prev.chunk_shift) *
4241 conf->prev.far_copies);
4242 after_length = ((1 << conf->geo.chunk_shift) *
4243 conf->geo.far_copies);
4244
4245 if (max(before_length, after_length) > min_offset_diff) {
4246 /* This cannot work */
4247 pr_warn("md/raid10: offset difference not enough to continue reshape\n");
4248 goto out_free_conf;
4249 }
4250 conf->offset_diff = min_offset_diff;
4251
4252 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
4253 clear_bit(MD_RECOVERY_CHECK, &mddev->recovery);
4254 set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
4255 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
4256 mddev->sync_thread = md_register_thread(md_do_sync, mddev,
4257 "reshape");
4258 if (!mddev->sync_thread)
4259 goto out_free_conf;
4260 }
4261
4262 return 0;
4263
4264 out_free_conf:
4265 md_unregister_thread(&mddev->thread);
4266 mempool_exit(&conf->r10bio_pool);
4267 safe_put_page(conf->tmppage);
4268 kfree(conf->mirrors);
4269 kfree(conf);
4270 mddev->private = NULL;
4271 out:
4272 return -EIO;
4273 }
4274
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
reply other threads:[~2022-02-15 13:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202202152151.aV08HWVq-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.