From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1804649604574750261==" MIME-Version: 1.0 From: kernel test robot 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 Message-ID: <202202152151.aV08HWVq-lkp@intel.com> List-Id: --===============1804649604574750261== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/arc= hive/20220215/202202152151.aV08HWVq-lkp(a)intel.com/config) compiler: alpha-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 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=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dalpha SHELL=3D/bin/bash drivers/md/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot 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 reporte= d 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 =3D 0; 4082 int first =3D 1; 4083 bool discard_supported =3D false; 4084 = 4085 if (mddev_init_writes_pending(mddev) < 0) 4086 return -ENOMEM; 4087 = 4088 if (mddev->private =3D=3D NULL) { 4089 conf =3D setup_conf(mddev); 4090 if (IS_ERR(conf)) 4091 return PTR_ERR(conf); 4092 mddev->private =3D conf; 4093 } 4094 conf =3D mddev->private; 4095 if (!conf) 4096 goto out; 4097 = 4098 if (mddev_is_clustered(conf->mddev)) { 4099 int fc, fo; 4100 = 4101 fc =3D (mddev->layout >> 8) & 255; 4102 fo =3D 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 =3D conf->thread; 4111 conf->thread =3D 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 =3D rdev->raid_disk; 4126 if (disk_idx < 0) 4127 continue; 4128 if (disk_idx >=3D conf->geo.raid_disks && 4129 disk_idx >=3D conf->prev.raid_disks) 4130 continue; 4131 disk =3D conf->mirrors + disk_idx; 4132 = 4133 if (test_bit(Replacement, &rdev->flags)) { 4134 if (disk->replacement) 4135 goto out_free_conf; 4136 disk->replacement =3D rdev; 4137 } else { 4138 if (disk->rdev) 4139 goto out_free_conf; 4140 disk->rdev =3D rdev; 4141 } 4142 diff =3D (rdev->new_data_offset - rdev->data_offset); 4143 if (!mddev->reshape_backwards) 4144 diff =3D -diff; 4145 if (diff < 0) 4146 diff =3D 0; 4147 if (first || diff < min_offset_diff) 4148 min_offset_diff =3D diff; 4149 = 4150 if (mddev->gendisk) 4151 disk_stack_limits(mddev->gendisk, rdev->bdev, 4152 rdev->data_offset << 9); 4153 = 4154 disk->head_position =3D 0; 4155 = > 4156 if (bdev_discard_granularity(dev->bdev)) 4157 discard_supported =3D true; 4158 first =3D 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 !=3D MaxSector) { 4177 /* must ensure that shape change is supported */ 4178 if (conf->geo.far_copies !=3D 1 && 4179 conf->geo.far_offset =3D=3D 0) 4180 goto out_free_conf; 4181 if (conf->prev.far_copies !=3D 1 && 4182 conf->prev.far_offset =3D=3D 0) 4183 goto out_free_conf; 4184 } 4185 = 4186 mddev->degraded =3D 0; 4187 for (i =3D 0; 4188 i < conf->geo.raid_disks 4189 || i < conf->prev.raid_disks; 4190 i++) { 4191 = 4192 disk =3D conf->mirrors + i; 4193 = 4194 if (!disk->rdev && disk->replacement) { 4195 /* The replacement is all we have - use it */ 4196 disk->rdev =3D disk->replacement; 4197 disk->replacement =3D 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 =3D 0; 4204 mddev->degraded++; 4205 if (disk->rdev && 4206 disk->rdev->saved_raid_disk < 0) 4207 conf->fullsync =3D 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 =3D 1; 4214 } 4215 = 4216 disk->recovery_disabled =3D mddev->recovery_disabled - 1; 4217 } 4218 = 4219 if (mddev->recovery_cp !=3D MaxSector) 4220 pr_notice("md/raid10:%s: not clean -- starting background reconstr= uction\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 =3D conf->dev_sectors; 4229 size =3D raid10_size(mddev, 0, 0); 4230 md_set_array_sectors(mddev, size); 4231 mddev->resync_max_sectors =3D 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 !=3D MaxSector) { 4238 unsigned long before_length, after_length; 4239 = 4240 before_length =3D ((1 << conf->prev.chunk_shift) * 4241 conf->prev.far_copies); 4242 after_length =3D ((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 resh= ape\n"); 4248 goto out_free_conf; 4249 } 4250 conf->offset_diff =3D 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 =3D 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 =3D 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 --===============1804649604574750261==--