tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: cb004e127a5500466043986dbc4cc43ec63d849e [17157/23714] Add traffic policy for low cache available. config: x86_64-randconfig-123-20240915 (https://download.01.org/0day-ci/archive/20240916/202409162232.mD47BzHq-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409162232.mD47BzHq-lkp@i...)
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/202409162232.mD47BzHq-lkp@intel.com/
sparse warnings: (new ones prefixed by >>) drivers/md/bcache/request.c: note: in included file (through drivers/md/bcache/bcache.h): include/uapi/linux/bcache.h:294:38: sparse: sparse: array of flexible structures drivers/md/bcache/request.c: note: in included file (through drivers/md/bcache/bcache.h): drivers/md/bcache/bset.h:231:36: sparse: sparse: array of flexible structures
drivers/md/bcache/request.c:1333:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] asn:1 *to @@ got struct get_bcache_status * @@
drivers/md/bcache/request.c:1333:27: sparse: expected void [noderef] asn:1 *to drivers/md/bcache/request.c:1333:27: sparse: got struct get_bcache_status *
drivers/md/bcache/request.c:1346:33: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] asn:1 *from @@ got struct set_bcache_status * @@
drivers/md/bcache/request.c:1346:33: sparse: expected void const [noderef] asn:1 *from drivers/md/bcache/request.c:1346:33: sparse: got struct set_bcache_status *
vim +1333 drivers/md/bcache/request.c
1315 1316 static int bcache_get_write_status(struct cached_dev *dc, unsigned long arg) 1317 { 1318 struct get_bcache_status a; 1319 uint64_t cache_sectors; 1320 struct cache_set *c = dc->disk.c; 1321 1322 if (c == NULL) 1323 return -ENODEV; 1324 1325 a.writeback_sector_size_per_sec = dc->writeback_sector_size_per_sec; 1326 a.writeback_io_num_per_sec = dc->writeback_io_num_per_sec; 1327 a.front_io_num_per_sec = dc->front_io_num_per_sec; 1328 cache_sectors = c->nbuckets * c->sb.bucket_size - 1329 atomic_long_read(&c->flash_dev_dirty_sectors); 1330 a.dirty_rate = div64_u64(bcache_dev_sectors_dirty(&dc->disk) * 100, 1331 cache_sectors); 1332 a.available = 100 - c->gc_stats.in_use;
1333 if (copy_to_user((struct get_bcache_status *)arg, &a,
1334 sizeof(struct get_bcache_status))) 1335 return -EFAULT; 1336 return 0; 1337 } 1338 1339 static int bcache_set_write_status(struct cached_dev *dc, unsigned long arg) 1340 { 1341 struct set_bcache_status a; 1342 struct cache_set *c = dc->disk.c; 1343 1344 if (c == NULL) 1345 return -ENODEV;
1346 if (copy_from_user(&a, (struct set_bcache_status *)arg,
1347 sizeof(struct set_bcache_status))) 1348 return -EFAULT; 1349 1350 if (c->traffic_policy_start != a.traffic_policy_start) 1351 pr_info("%s traffic policy %s", dc->disk.disk->disk_name, 1352 (a.traffic_policy_start == true) ? "enable" : "disable"); 1353 if (c->force_write_through != a.force_write_through) 1354 pr_info("%s force write through %s", dc->disk.disk->disk_name, 1355 (a.force_write_through == true) ? "enable" : "disable"); 1356 if (a.trigger_gc) { 1357 pr_info("trigger %s gc", dc->disk.disk->disk_name); 1358 atomic_set(&c->sectors_to_gc, -1); 1359 wake_up_gc(c); 1360 } 1361 if ((a.cutoff_writeback_sync >= MIN_CUTOFF_WRITEBACK_SYNC) && 1362 (a.cutoff_writeback_sync <= MAX_CUTOFF_WRITEBACK_SYNC)) { 1363 c->cutoff_writeback_sync = a.cutoff_writeback_sync; 1364 } 1365 1366 dc->max_sector_size = a.write_token_sector_size; 1367 dc->max_io_num = a.write_token_io_num; 1368 c->traffic_policy_start = a.traffic_policy_start; 1369 c->force_write_through = a.force_write_through; 1370 c->gc_sectors = a.gc_sectors; 1371 dc->writeback_state = a.writeback_state; 1372 return 0; 1373 } 1374