[hare-scsi-devel:ata-trace.v4 16/68] drivers/ata/sata_mv.c:1276:30: warning: 'dw' is used uninitialized
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git ata-trace.v4
head: 543d0f43ed9c7b04ab463b52f2e59fd406b4bde8
commit: f3e85aba1ba67f2efcc34413ed9546be69229179 [16/68] sata_mv: replace DPRINTK with dynamic debugging
config: m68k-randconfig-r006-20211210 (https://download.01.org/0day-ci/archive/20211210/202112102158.vl74bmsi-lk...)
compiler: m68k-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
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel ata-trace.v4
git checkout f3e85aba1ba67f2efcc34413ed9546be69229179
# 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=m68k SHELL=/bin/bash drivers/ata/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/ata/sata_mv.c:790:35: warning: 'mv_pci_tbl' defined but not used [-Wunused-const-variable=]
790 | static const struct pci_device_id mv_pci_tbl[] = {
| ^~~~~~~~~~
drivers/ata/sata_mv.c: In function 'mv_pci_error':
>> drivers/ata/sata_mv.c:1276:30: warning: 'dw' is used uninitialized [-Wuninitialized]
1276 | o += snprintf(linebuf + o, 38 - o,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1277 | "%08x ", dw);
| ~~~~~~~~~~~~
drivers/ata/sata_mv.c:1270:13: note: 'dw' was declared here
1270 | u32 dw;
| ^~
vim +/dw +1276 drivers/ata/sata_mv.c
1266
1267 static void mv_dump_pci_cfg(struct pci_dev *pdev, unsigned bytes)
1268 {
1269 int b, w, o;
1270 u32 dw;
1271 unsigned char linebuf[38];
1272
1273 for (b = 0; b < bytes; ) {
1274 for (w = 0, o = 0; b < bytes && w < 4; w++) {
1275 (void) pci_read_config_dword(pdev, b, &dw);
> 1276 o += snprintf(linebuf + o, 38 - o,
1277 "%08x ", dw);
1278 b += sizeof(u32);
1279 }
1280 dev_dbg(&pdev->dev, "%s: %02x: %s\n",
1281 __func__, b, linebuf);
1282 }
1283 }
1284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
Re: [PATCH v2] btrfs: zoned: free zone_cache when freeing zone_info
by Dan Carpenter
Hi Johannes,
url: https://github.com/0day-ci/linux/commits/Johannes-Thumshirn/btrfs-zoned-f...
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: i386-randconfig-m021-20211207 (https://download.01.org/0day-ci/archive/20211209/202112090657.BflsS2SD-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
fs/btrfs/zoned.c:597 btrfs_get_dev_zone_info() warn: possible memory leak of 'zone_info'
Old smatch warnings:
fs/btrfs/zoned.c:169 sb_zone_number() error: uninitialized symbol 'zone'.
fs/btrfs/zoned.c:1452 btrfs_load_block_group_zone_info() error: uninitialized symbol 'ret'.
vim +/zone_info +597 fs/btrfs/zoned.c
1c0066baa869433 Naohiro Aota 2021-11-11 348 int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
5b316468983dfa9 Naohiro Aota 2020-11-10 349 {
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 350 struct btrfs_fs_info *fs_info = device->fs_info;
5b316468983dfa9 Naohiro Aota 2020-11-10 351 struct btrfs_zoned_device_info *zone_info = NULL;
5b316468983dfa9 Naohiro Aota 2020-11-10 352 struct block_device *bdev = device->bdev;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 353 struct request_queue *queue = bdev_get_queue(bdev);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 354 unsigned int max_active_zones;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 355 unsigned int nactive;
5b316468983dfa9 Naohiro Aota 2020-11-10 356 sector_t nr_sectors;
5b316468983dfa9 Naohiro Aota 2020-11-10 357 sector_t sector = 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 358 struct blk_zone *zones = NULL;
5b316468983dfa9 Naohiro Aota 2020-11-10 359 unsigned int i, nreported = 0, nr_zones;
d734492a14a2da6 Naohiro Aota 2021-03-03 360 sector_t zone_sectors;
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 361 char *model, *emulated;
5b316468983dfa9 Naohiro Aota 2020-11-10 362 int ret;
5b316468983dfa9 Naohiro Aota 2020-11-10 363
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 364 /*
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 365 * Cannot use btrfs_is_zoned here, since fs_info::zone_size might not
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 366 * yet be set.
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 367 */
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 368 if (!btrfs_fs_incompat(fs_info, ZONED))
5b316468983dfa9 Naohiro Aota 2020-11-10 369 return 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 370
5b316468983dfa9 Naohiro Aota 2020-11-10 371 if (device->zone_info)
5b316468983dfa9 Naohiro Aota 2020-11-10 372 return 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 373
5b316468983dfa9 Naohiro Aota 2020-11-10 374 zone_info = kzalloc(sizeof(*zone_info), GFP_KERNEL);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5b316468983dfa9 Naohiro Aota 2020-11-10 375 if (!zone_info)
5b316468983dfa9 Naohiro Aota 2020-11-10 376 return -ENOMEM;
5b316468983dfa9 Naohiro Aota 2020-11-10 377
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 378 if (!bdev_is_zoned(bdev)) {
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 379 if (!fs_info->zone_size) {
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 380 ret = calculate_emulated_zone_size(fs_info);
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 381 if (ret)
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 382 goto out;
^^^^^^^^^
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 383 }
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 384
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 385 ASSERT(fs_info->zone_size);
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 386 zone_sectors = fs_info->zone_size >> SECTOR_SHIFT;
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 387 } else {
5b316468983dfa9 Naohiro Aota 2020-11-10 388 zone_sectors = bdev_zone_sectors(bdev);
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 389 }
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 390
5b316468983dfa9 Naohiro Aota 2020-11-10 391 /* Check if it's power of 2 (see is_power_of_2) */
5b316468983dfa9 Naohiro Aota 2020-11-10 392 ASSERT(zone_sectors != 0 && (zone_sectors & (zone_sectors - 1)) == 0);
5b316468983dfa9 Naohiro Aota 2020-11-10 393 zone_info->zone_size = zone_sectors << SECTOR_SHIFT;
53b74fa990bf76f Naohiro Aota 2021-04-08 394
53b74fa990bf76f Naohiro Aota 2021-04-08 395 /* We reject devices with a zone size larger than 8GB */
53b74fa990bf76f Naohiro Aota 2021-04-08 396 if (zone_info->zone_size > BTRFS_MAX_ZONE_SIZE) {
53b74fa990bf76f Naohiro Aota 2021-04-08 397 btrfs_err_in_rcu(fs_info,
53b74fa990bf76f Naohiro Aota 2021-04-08 398 "zoned: %s: zone size %llu larger than supported maximum %llu",
53b74fa990bf76f Naohiro Aota 2021-04-08 399 rcu_str_deref(device->name),
53b74fa990bf76f Naohiro Aota 2021-04-08 400 zone_info->zone_size, BTRFS_MAX_ZONE_SIZE);
53b74fa990bf76f Naohiro Aota 2021-04-08 401 ret = -EINVAL;
53b74fa990bf76f Naohiro Aota 2021-04-08 402 goto out;
53b74fa990bf76f Naohiro Aota 2021-04-08 403 }
53b74fa990bf76f Naohiro Aota 2021-04-08 404
53b74fa990bf76f Naohiro Aota 2021-04-08 405 nr_sectors = bdev_nr_sectors(bdev);
5b316468983dfa9 Naohiro Aota 2020-11-10 406 zone_info->zone_size_shift = ilog2(zone_info->zone_size);
5b316468983dfa9 Naohiro Aota 2020-11-10 407 zone_info->nr_zones = nr_sectors >> ilog2(zone_sectors);
5b316468983dfa9 Naohiro Aota 2020-11-10 408 if (!IS_ALIGNED(nr_sectors, zone_sectors))
5b316468983dfa9 Naohiro Aota 2020-11-10 409 zone_info->nr_zones++;
5b316468983dfa9 Naohiro Aota 2020-11-10 410
ea6f8ddcde63812 Naohiro Aota 2021-08-19 411 max_active_zones = queue_max_active_zones(queue);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 412 if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
ea6f8ddcde63812 Naohiro Aota 2021-08-19 413 btrfs_err_in_rcu(fs_info,
ea6f8ddcde63812 Naohiro Aota 2021-08-19 414 "zoned: %s: max active zones %u is too small, need at least %u active zones",
ea6f8ddcde63812 Naohiro Aota 2021-08-19 415 rcu_str_deref(device->name), max_active_zones,
ea6f8ddcde63812 Naohiro Aota 2021-08-19 416 BTRFS_MIN_ACTIVE_ZONES);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 417 ret = -EINVAL;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 418 goto out;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 419 }
ea6f8ddcde63812 Naohiro Aota 2021-08-19 420 zone_info->max_active_zones = max_active_zones;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 421
5b316468983dfa9 Naohiro Aota 2020-11-10 422 zone_info->seq_zones = bitmap_zalloc(zone_info->nr_zones, GFP_KERNEL);
5b316468983dfa9 Naohiro Aota 2020-11-10 423 if (!zone_info->seq_zones) {
5b316468983dfa9 Naohiro Aota 2020-11-10 424 ret = -ENOMEM;
5b316468983dfa9 Naohiro Aota 2020-11-10 425 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 426 }
5b316468983dfa9 Naohiro Aota 2020-11-10 427
5b316468983dfa9 Naohiro Aota 2020-11-10 428 zone_info->empty_zones = bitmap_zalloc(zone_info->nr_zones, GFP_KERNEL);
5b316468983dfa9 Naohiro Aota 2020-11-10 429 if (!zone_info->empty_zones) {
5b316468983dfa9 Naohiro Aota 2020-11-10 430 ret = -ENOMEM;
5b316468983dfa9 Naohiro Aota 2020-11-10 431 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 432 }
5b316468983dfa9 Naohiro Aota 2020-11-10 433
ea6f8ddcde63812 Naohiro Aota 2021-08-19 434 zone_info->active_zones = bitmap_zalloc(zone_info->nr_zones, GFP_KERNEL);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 435 if (!zone_info->active_zones) {
ea6f8ddcde63812 Naohiro Aota 2021-08-19 436 ret = -ENOMEM;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 437 goto out;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 438 }
ea6f8ddcde63812 Naohiro Aota 2021-08-19 439
5b316468983dfa9 Naohiro Aota 2020-11-10 440 zones = kcalloc(BTRFS_REPORT_NR_ZONES, sizeof(struct blk_zone), GFP_KERNEL);
5b316468983dfa9 Naohiro Aota 2020-11-10 441 if (!zones) {
5b316468983dfa9 Naohiro Aota 2020-11-10 442 ret = -ENOMEM;
5b316468983dfa9 Naohiro Aota 2020-11-10 443 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 444 }
5b316468983dfa9 Naohiro Aota 2020-11-10 445
1c0066baa869433 Naohiro Aota 2021-11-11 446 /*
1c0066baa869433 Naohiro Aota 2021-11-11 447 * Enable zone cache only for a zoned device. On a non-zoned device, we
1c0066baa869433 Naohiro Aota 2021-11-11 448 * fill the zone info with emulated CONVENTIONAL zones, so no need to
1c0066baa869433 Naohiro Aota 2021-11-11 449 * use the cache.
1c0066baa869433 Naohiro Aota 2021-11-11 450 */
1c0066baa869433 Naohiro Aota 2021-11-11 451 if (populate_cache && bdev_is_zoned(device->bdev)) {
1c0066baa869433 Naohiro Aota 2021-11-11 452 zone_info->zone_cache = vzalloc(sizeof(struct blk_zone) *
1c0066baa869433 Naohiro Aota 2021-11-11 453 zone_info->nr_zones);
1c0066baa869433 Naohiro Aota 2021-11-11 454 if (!zone_info->zone_cache) {
1c0066baa869433 Naohiro Aota 2021-11-11 455 btrfs_err_in_rcu(device->fs_info,
1c0066baa869433 Naohiro Aota 2021-11-11 456 "zoned: failed to allocate zone cache for %s",
1c0066baa869433 Naohiro Aota 2021-11-11 457 rcu_str_deref(device->name));
1c0066baa869433 Naohiro Aota 2021-11-11 458 ret = -ENOMEM;
1c0066baa869433 Naohiro Aota 2021-11-11 459 goto out;
1c0066baa869433 Naohiro Aota 2021-11-11 460 }
1c0066baa869433 Naohiro Aota 2021-11-11 461 }
1c0066baa869433 Naohiro Aota 2021-11-11 462
1c0066baa869433 Naohiro Aota 2021-11-11 463 device->zone_info = zone_info;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error paths after this point will free zone_info and the bitmaps.
1c0066baa869433 Naohiro Aota 2021-11-11 464
5b316468983dfa9 Naohiro Aota 2020-11-10 465 /* Get zones type */
ea6f8ddcde63812 Naohiro Aota 2021-08-19 466 nactive = 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 467 while (sector < nr_sectors) {
5b316468983dfa9 Naohiro Aota 2020-11-10 468 nr_zones = BTRFS_REPORT_NR_ZONES;
5b316468983dfa9 Naohiro Aota 2020-11-10 469 ret = btrfs_get_dev_zones(device, sector << SECTOR_SHIFT, zones,
5b316468983dfa9 Naohiro Aota 2020-11-10 470 &nr_zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 471 if (ret)
5b316468983dfa9 Naohiro Aota 2020-11-10 472 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 473
5b316468983dfa9 Naohiro Aota 2020-11-10 474 for (i = 0; i < nr_zones; i++) {
5b316468983dfa9 Naohiro Aota 2020-11-10 475 if (zones[i].type == BLK_ZONE_TYPE_SEQWRITE_REQ)
5b316468983dfa9 Naohiro Aota 2020-11-10 476 __set_bit(nreported, zone_info->seq_zones);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 477 switch (zones[i].cond) {
ea6f8ddcde63812 Naohiro Aota 2021-08-19 478 case BLK_ZONE_COND_EMPTY:
5b316468983dfa9 Naohiro Aota 2020-11-10 479 __set_bit(nreported, zone_info->empty_zones);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 480 break;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 481 case BLK_ZONE_COND_IMP_OPEN:
ea6f8ddcde63812 Naohiro Aota 2021-08-19 482 case BLK_ZONE_COND_EXP_OPEN:
ea6f8ddcde63812 Naohiro Aota 2021-08-19 483 case BLK_ZONE_COND_CLOSED:
ea6f8ddcde63812 Naohiro Aota 2021-08-19 484 __set_bit(nreported, zone_info->active_zones);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 485 nactive++;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 486 break;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 487 }
5b316468983dfa9 Naohiro Aota 2020-11-10 488 nreported++;
5b316468983dfa9 Naohiro Aota 2020-11-10 489 }
5b316468983dfa9 Naohiro Aota 2020-11-10 490 sector = zones[nr_zones - 1].start + zones[nr_zones - 1].len;
5b316468983dfa9 Naohiro Aota 2020-11-10 491 }
5b316468983dfa9 Naohiro Aota 2020-11-10 492
5b316468983dfa9 Naohiro Aota 2020-11-10 493 if (nreported != zone_info->nr_zones) {
5b316468983dfa9 Naohiro Aota 2020-11-10 494 btrfs_err_in_rcu(device->fs_info,
5b316468983dfa9 Naohiro Aota 2020-11-10 495 "inconsistent number of zones on %s (%u/%u)",
5b316468983dfa9 Naohiro Aota 2020-11-10 496 rcu_str_deref(device->name), nreported,
5b316468983dfa9 Naohiro Aota 2020-11-10 497 zone_info->nr_zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 498 ret = -EIO;
5b316468983dfa9 Naohiro Aota 2020-11-10 499 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 500 }
5b316468983dfa9 Naohiro Aota 2020-11-10 501
ea6f8ddcde63812 Naohiro Aota 2021-08-19 502 if (max_active_zones) {
ea6f8ddcde63812 Naohiro Aota 2021-08-19 503 if (nactive > max_active_zones) {
ea6f8ddcde63812 Naohiro Aota 2021-08-19 504 btrfs_err_in_rcu(device->fs_info,
ea6f8ddcde63812 Naohiro Aota 2021-08-19 505 "zoned: %u active zones on %s exceeds max_active_zones %u",
ea6f8ddcde63812 Naohiro Aota 2021-08-19 506 nactive, rcu_str_deref(device->name),
ea6f8ddcde63812 Naohiro Aota 2021-08-19 507 max_active_zones);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 508 ret = -EIO;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 509 goto out;
ea6f8ddcde63812 Naohiro Aota 2021-08-19 510 }
ea6f8ddcde63812 Naohiro Aota 2021-08-19 511 atomic_set(&zone_info->active_zones_left,
ea6f8ddcde63812 Naohiro Aota 2021-08-19 512 max_active_zones - nactive);
ea6f8ddcde63812 Naohiro Aota 2021-08-19 513 }
ea6f8ddcde63812 Naohiro Aota 2021-08-19 514
12659251ca5df05 Naohiro Aota 2020-11-10 515 /* Validate superblock log */
12659251ca5df05 Naohiro Aota 2020-11-10 516 nr_zones = BTRFS_NR_SB_LOG_ZONES;
12659251ca5df05 Naohiro Aota 2020-11-10 517 for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
12659251ca5df05 Naohiro Aota 2020-11-10 518 u32 sb_zone;
12659251ca5df05 Naohiro Aota 2020-11-10 519 u64 sb_wp;
12659251ca5df05 Naohiro Aota 2020-11-10 520 int sb_pos = BTRFS_NR_SB_LOG_ZONES * i;
12659251ca5df05 Naohiro Aota 2020-11-10 521
12659251ca5df05 Naohiro Aota 2020-11-10 522 sb_zone = sb_zone_number(zone_info->zone_size_shift, i);
12659251ca5df05 Naohiro Aota 2020-11-10 523 if (sb_zone + 1 >= zone_info->nr_zones)
12659251ca5df05 Naohiro Aota 2020-11-10 524 continue;
12659251ca5df05 Naohiro Aota 2020-11-10 525
5b434df8778771d Naohiro Aota 2021-05-27 526 ret = btrfs_get_dev_zones(device,
5b434df8778771d Naohiro Aota 2021-05-27 527 zone_start_physical(sb_zone, zone_info),
12659251ca5df05 Naohiro Aota 2020-11-10 528 &zone_info->sb_zones[sb_pos],
12659251ca5df05 Naohiro Aota 2020-11-10 529 &nr_zones);
12659251ca5df05 Naohiro Aota 2020-11-10 530 if (ret)
12659251ca5df05 Naohiro Aota 2020-11-10 531 goto out;
12659251ca5df05 Naohiro Aota 2020-11-10 532
12659251ca5df05 Naohiro Aota 2020-11-10 533 if (nr_zones != BTRFS_NR_SB_LOG_ZONES) {
12659251ca5df05 Naohiro Aota 2020-11-10 534 btrfs_err_in_rcu(device->fs_info,
12659251ca5df05 Naohiro Aota 2020-11-10 535 "zoned: failed to read super block log zone info at devid %llu zone %u",
12659251ca5df05 Naohiro Aota 2020-11-10 536 device->devid, sb_zone);
12659251ca5df05 Naohiro Aota 2020-11-10 537 ret = -EUCLEAN;
12659251ca5df05 Naohiro Aota 2020-11-10 538 goto out;
12659251ca5df05 Naohiro Aota 2020-11-10 539 }
12659251ca5df05 Naohiro Aota 2020-11-10 540
12659251ca5df05 Naohiro Aota 2020-11-10 541 /*
1a9fd4172d5c8ba David Sterba 2021-05-21 542 * If zones[0] is conventional, always use the beginning of the
12659251ca5df05 Naohiro Aota 2020-11-10 543 * zone to record superblock. No need to validate in that case.
12659251ca5df05 Naohiro Aota 2020-11-10 544 */
12659251ca5df05 Naohiro Aota 2020-11-10 545 if (zone_info->sb_zones[BTRFS_NR_SB_LOG_ZONES * i].type ==
12659251ca5df05 Naohiro Aota 2020-11-10 546 BLK_ZONE_TYPE_CONVENTIONAL)
12659251ca5df05 Naohiro Aota 2020-11-10 547 continue;
12659251ca5df05 Naohiro Aota 2020-11-10 548
12659251ca5df05 Naohiro Aota 2020-11-10 549 ret = sb_write_pointer(device->bdev,
12659251ca5df05 Naohiro Aota 2020-11-10 550 &zone_info->sb_zones[sb_pos], &sb_wp);
12659251ca5df05 Naohiro Aota 2020-11-10 551 if (ret != -ENOENT && ret) {
12659251ca5df05 Naohiro Aota 2020-11-10 552 btrfs_err_in_rcu(device->fs_info,
12659251ca5df05 Naohiro Aota 2020-11-10 553 "zoned: super block log zone corrupted devid %llu zone %u",
12659251ca5df05 Naohiro Aota 2020-11-10 554 device->devid, sb_zone);
12659251ca5df05 Naohiro Aota 2020-11-10 555 ret = -EUCLEAN;
12659251ca5df05 Naohiro Aota 2020-11-10 556 goto out;
12659251ca5df05 Naohiro Aota 2020-11-10 557 }
12659251ca5df05 Naohiro Aota 2020-11-10 558 }
12659251ca5df05 Naohiro Aota 2020-11-10 559
12659251ca5df05 Naohiro Aota 2020-11-10 560
5b316468983dfa9 Naohiro Aota 2020-11-10 561 kfree(zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 562
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 563 switch (bdev_zoned_model(bdev)) {
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 564 case BLK_ZONED_HM:
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 565 model = "host-managed zoned";
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 566 emulated = "";
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 567 break;
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 568 case BLK_ZONED_HA:
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 569 model = "host-aware zoned";
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 570 emulated = "";
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 571 break;
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 572 case BLK_ZONED_NONE:
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 573 model = "regular";
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 574 emulated = "emulated ";
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 575 break;
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 576 default:
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 577 /* Just in case */
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 578 btrfs_err_in_rcu(fs_info, "zoned: unsupported model %d on %s",
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 579 bdev_zoned_model(bdev),
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 580 rcu_str_deref(device->name));
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 581 ret = -EOPNOTSUPP;
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 582 goto out_free_zone_info;
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 583 }
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 584
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 585 btrfs_info_in_rcu(fs_info,
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 586 "%s block device %s, %u %szones of %llu bytes",
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 587 model, rcu_str_deref(device->name), zone_info->nr_zones,
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 588 emulated, zone_info->zone_size);
5b316468983dfa9 Naohiro Aota 2020-11-10 589
5b316468983dfa9 Naohiro Aota 2020-11-10 590 return 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 591
5b316468983dfa9 Naohiro Aota 2020-11-10 592 out:
5b316468983dfa9 Naohiro Aota 2020-11-10 593 kfree(zones);
3c9daa09ccd43f6 Johannes Thumshirn 2021-02-04 594 out_free_zone_info:
0a2a39576fa1dd6 Johannes Thumshirn 2021-12-07 595 btrfs_destroy_dev_zone_info(device);
5b316468983dfa9 Naohiro Aota 2020-11-10 596
5b316468983dfa9 Naohiro Aota 2020-11-10 @597 return ret;
^^^^^^^^^^
leaks
5b316468983dfa9 Naohiro Aota 2020-11-10 598 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
[drm-msm:msm-next-plus-fixes 69/72] drivers/gpu/drm/msm/dp/dp_drm.c:246:2-7: WARNING: invalid free of devm_ allocated data
by kernel test robot
tree: https://gitlab.freedesktop.org/drm/msm.git msm-next-plus-fixes
head: 1c1dcb9d8883f42ea116d99f78e42a7c399f8278
commit: 8a3b4c17f863cde8e8743edd8faffe916c49b960 [69/72] drm/msm/dp: employ bridge mechanism for display enable and disable
config: nds32-randconfig-c004-20211208 (https://download.01.org/0day-ci/archive/20211210/202112101918.adnak8vR-lk...)
compiler: nds32le-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/msm/dp/dp_drm.c:246:2-7: WARNING: invalid free of devm_ allocated data
vim +246 drivers/gpu/drm/msm/dp/dp_drm.c
225
226 struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev,
227 struct drm_encoder *encoder)
228 {
229 int rc;
230 struct msm_dp_bridge *dp_bridge;
231 struct drm_bridge *bridge;
232
233 dp_bridge = devm_kzalloc(dev->dev, sizeof(*dp_bridge), GFP_KERNEL);
234 if (!dp_bridge)
235 return ERR_PTR(-ENOMEM);
236
237 dp_bridge->dp_display = dp_display;
238
239 bridge = &dp_bridge->bridge;
240 bridge->funcs = &dp_bridge_ops;
241 bridge->encoder = encoder;
242
243 rc = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
244 if (rc) {
245 DRM_ERROR("failed to attach bridge, rc=%d\n", rc);
> 246 kfree(dp_bridge);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
[jpirko-mlxsw:petrm_soft_counters 9/10] net/core/rtnetlink.c:5509:51: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int')
by kernel test robot
tree: https://github.com/jpirko/linux_mlxsw petrm_soft_counters
head: 38ca0aa04554a994a5ab769f0c07b37484b5f4c9
commit: 0839ffb5b56fb6f5e67545c77bf6151fe606835d [9/10] wip
config: i386-randconfig-r026-20211210 (https://download.01.org/0day-ci/archive/20211210/202112101827.NH71OPJw-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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
# https://github.com/jpirko/linux_mlxsw/commit/0839ffb5b56fb6f5e67545c77bf6...
git remote add jpirko-mlxsw https://github.com/jpirko/linux_mlxsw
git fetch --no-tags jpirko-mlxsw petrm_soft_counters
git checkout 0839ffb5b56fb6f5e67545c77bf6151fe606835d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/core/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> net/core/rtnetlink.c:5509:51: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
printk(KERN_WARNING "if_nlmsg_stats_size %ld\n", size);
~~~ ^~~~
%u
include/linux/printk.h:446:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
~~~~ ^~~~~~~~~~~
1 warning generated.
vim +5509 net/core/rtnetlink.c
5442
5443 static size_t if_nlmsg_stats_size(const struct net_device *dev,
5444 const struct rtnl_stats_dump_filters *filters)
5445 {
5446 size_t size = NLMSG_ALIGN(sizeof(struct if_stats_msg));
5447 unsigned int filter_mask = filters->mask[0];
5448
5449 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_64, 0))
5450 size += nla_total_size_64bit(sizeof(struct rtnl_link_stats64));
5451
5452 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_XSTATS, 0)) {
5453 const struct rtnl_link_ops *ops = dev->rtnl_link_ops;
5454 int attr = IFLA_STATS_LINK_XSTATS;
5455
5456 if (ops && ops->get_linkxstats_size) {
5457 size += nla_total_size(ops->get_linkxstats_size(dev,
5458 attr));
5459 /* for IFLA_STATS_LINK_XSTATS */
5460 size += nla_total_size(0);
5461 }
5462 }
5463
5464 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_XSTATS_SLAVE, 0)) {
5465 struct net_device *_dev = (struct net_device *)dev;
5466 const struct rtnl_link_ops *ops = NULL;
5467 const struct net_device *master;
5468
5469 /* netdev_master_upper_dev_get can't take const */
5470 master = netdev_master_upper_dev_get(_dev);
5471 if (master)
5472 ops = master->rtnl_link_ops;
5473 if (ops && ops->get_linkxstats_size) {
5474 int attr = IFLA_STATS_LINK_XSTATS_SLAVE;
5475
5476 size += nla_total_size(ops->get_linkxstats_size(dev,
5477 attr));
5478 /* for IFLA_STATS_LINK_XSTATS_SLAVE */
5479 size += nla_total_size(0);
5480 }
5481 }
5482
5483 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS, 0)) {
5484 u32 off_filter_mask;
5485
5486 off_filter_mask = filters->mask[IFLA_STATS_LINK_OFFLOAD_XSTATS];
5487 size += rtnl_get_offload_stats_size(dev, off_filter_mask);
5488 }
5489
5490 if (stats_attr_valid(filter_mask, IFLA_STATS_AF_SPEC, 0)) {
5491 struct rtnl_af_ops *af_ops;
5492
5493 /* for IFLA_STATS_AF_SPEC */
5494 size += nla_total_size(0);
5495
5496 rcu_read_lock();
5497 list_for_each_entry_rcu(af_ops, &rtnl_af_ops, list) {
5498 if (af_ops->get_stats_af_size) {
5499 size += nla_total_size(
5500 af_ops->get_stats_af_size(dev));
5501
5502 /* for AF_* */
5503 size += nla_total_size(0);
5504 }
5505 }
5506 rcu_read_unlock();
5507 }
5508
> 5509 printk(KERN_WARNING "if_nlmsg_stats_size %ld\n", size);
5510 return size;
5511 }
5512
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
arch/powerpc/mm/ptdump/hashpagetable.c:264:29: sparse: sparse: restricted __be64 degrades to integer
by kernel test robot
Hi Christophe,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c741e49150dbb0c0aebe234389f4aa8b47958fa8
commit: e084728393a58e7fdafeee2e6b20e0faff09b557 powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP
date: 4 months ago
config: powerpc64-randconfig-s031-20211210 (https://download.01.org/0day-ci/archive/20211210/202112101832.rZbrZJ1u-lk...)
compiler: powerpc64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e084728393a58e7fdafeee2e6b20e0faff09b557
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/mm/ptdump/ kernel/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/powerpc/mm/ptdump/hashpagetable.c:264:29: sparse: sparse: restricted __be64 degrades to integer
arch/powerpc/mm/ptdump/hashpagetable.c:265:49: sparse: sparse: restricted __be64 degrades to integer
>> arch/powerpc/mm/ptdump/hashpagetable.c:267:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] @@ got restricted __be64 [usertype] v @@
arch/powerpc/mm/ptdump/hashpagetable.c:267:36: sparse: expected unsigned long long [usertype]
arch/powerpc/mm/ptdump/hashpagetable.c:267:36: sparse: got restricted __be64 [usertype] v
>> arch/powerpc/mm/ptdump/hashpagetable.c:268:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] @@ got restricted __be64 [usertype] r @@
arch/powerpc/mm/ptdump/hashpagetable.c:268:36: sparse: expected unsigned long long [usertype]
arch/powerpc/mm/ptdump/hashpagetable.c:268:36: sparse: got restricted __be64 [usertype] r
vim +264 arch/powerpc/mm/ptdump/hashpagetable.c
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 238
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 239 static int pseries_find(unsigned long ea, int psize, bool primary, u64 *v, u64 *r)
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 240 {
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 241 struct hash_pte ptes[4];
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 242 unsigned long vsid, vpn, hash, hpte_group, want_v;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 243 int i, j, ssize = mmu_kernel_ssize;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 244 long lpar_rc = 0;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 245 unsigned long shift = mmu_psize_defs[psize].shift;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 246
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 247 /* calculate hash */
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 248 vsid = get_kernel_vsid(ea, ssize);
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 249 vpn = hpt_vpn(ea, vsid, ssize);
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 250 hash = hpt_hash(vpn, shift, ssize);
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 251 want_v = hpte_encode_avpn(vpn, psize, ssize);
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 252
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 253 /* to check in the secondary hash table, we invert the hash */
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 254 if (!primary)
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 255 hash = ~hash;
1531cff44b5bb3 arch/powerpc/mm/dump_hashpagetable.c Aneesh Kumar K.V 2018-06-29 256 hpte_group = (hash & htab_hash_mask) * HPTES_PER_GROUP;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 257 /* see if we can find an entry in the hpte with this hash */
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 258 for (i = 0; i < HPTES_PER_GROUP; i += 4, hpte_group += 4) {
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 259 lpar_rc = plpar_pte_read_4(0, hpte_group, (void *)ptes);
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 260
7c466b0807960e arch/powerpc/mm/ptdump/hashpagetable.c Christophe Leroy 2020-06-15 261 if (lpar_rc)
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 262 continue;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 263 for (j = 0; j < 4; j++) {
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 @264 if (HPTE_V_COMPARE(ptes[j].v, want_v) &&
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 265 (ptes[j].v & HPTE_V_VALID)) {
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 266 /* HPTE matches */
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 @267 *v = ptes[j].v;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 @268 *r = ptes[j].r;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 269 return 0;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 270 }
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 271 }
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 272 }
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 273 return -1;
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 274 }
1515ab93215625 arch/powerpc/mm/dump_hashpagetable.c Rashmica Gupta 2016-05-27 275
:::::: The code at line 264 was first introduced by commit
:::::: 1515ab932156257afd8a5864506dab80f63ff38b powerpc/mm: Dump hash table
:::::: TO: Rashmica Gupta <rashmicy(a)gmail.com>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
[tytso-ext4:dev 6/13] fs/ext4/super.c:2689:51: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
head: ba2e524d918ab72c0e5edc02354bd6cb43d005f8
commit: e6e268cb682290da29e3c8408493a4474307b8cc [6/13] ext4: move quota configuration out of handle_mount_opt()
config: m68k-randconfig-s032-20211210 (https://download.01.org/0day-ci/archive/20211210/202112101722.3Kpomg0h-lk...)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?id...
git remote add tytso-ext4 https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
git fetch --no-tags tytso-ext4 dev
git checkout e6e268cb682290da29e3c8408493a4474307b8cc
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k SHELL=/bin/bash fs/ext4/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> fs/ext4/super.c:2689:51: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const * @@ got char [noderef] __rcu * @@
fs/ext4/super.c:2689:51: sparse: expected char const *
fs/ext4/super.c:2689:51: sparse: got char [noderef] __rcu *
>> fs/ext4/super.c:2657:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *objp @@ got char [noderef] __rcu * @@
fs/ext4/super.c:2657:38: sparse: expected void const *objp
fs/ext4/super.c:2657:38: sparse: got char [noderef] __rcu *
vim +2689 fs/ext4/super.c
2642
2643 static void ext4_apply_quota_options(struct fs_context *fc,
2644 struct super_block *sb)
2645 {
2646 #ifdef CONFIG_QUOTA
2647 struct ext4_fs_context *ctx = fc->fs_private;
2648 struct ext4_sb_info *sbi = EXT4_SB(sb);
2649 char *qname;
2650 int i;
2651
2652 for (i = 0; i < EXT4_MAXQUOTAS; i++) {
2653 if (!(ctx->qname_spec & (1 << i)))
2654 continue;
2655 qname = ctx->s_qf_names[i]; /* May be NULL */
2656 ctx->s_qf_names[i] = NULL;
> 2657 kfree(sbi->s_qf_names[i]);
2658 rcu_assign_pointer(sbi->s_qf_names[i], qname);
2659 set_opt(sb, QUOTA);
2660 }
2661 #endif
2662 }
2663
2664 /*
2665 * Check quota settings consistency.
2666 */
2667 static int ext4_check_quota_consistency(struct fs_context *fc,
2668 struct super_block *sb)
2669 {
2670 #ifdef CONFIG_QUOTA
2671 struct ext4_fs_context *ctx = fc->fs_private;
2672 struct ext4_sb_info *sbi = EXT4_SB(sb);
2673 bool quota_feature = ext4_has_feature_quota(sb);
2674 bool quota_loaded = sb_any_quota_loaded(sb);
2675 int i;
2676
2677 if (ctx->qname_spec && quota_loaded) {
2678 if (quota_feature)
2679 goto err_feature;
2680
2681 for (i = 0; i < EXT4_MAXQUOTAS; i++) {
2682 if (!(ctx->qname_spec & (1 << i)))
2683 continue;
2684
2685 if (!!sbi->s_qf_names[i] != !!ctx->s_qf_names[i])
2686 goto err_jquota_change;
2687
2688 if (sbi->s_qf_names[i] && ctx->s_qf_names[i] &&
> 2689 strcmp(sbi->s_qf_names[i],
2690 ctx->s_qf_names[i]) != 0)
2691 goto err_jquota_specified;
2692 }
2693 }
2694
2695 if (ctx->s_jquota_fmt) {
2696 if (sbi->s_jquota_fmt != ctx->s_jquota_fmt && quota_loaded)
2697 goto err_quota_change;
2698 if (quota_feature) {
2699 ext4_msg(NULL, KERN_INFO, "Quota format mount options "
2700 "ignored when QUOTA feature is enabled");
2701 return 0;
2702 }
2703 }
2704 return 0;
2705
2706 err_quota_change:
2707 ext4_msg(NULL, KERN_ERR,
2708 "Cannot change quota options when quota turned on");
2709 return -EINVAL;
2710 err_jquota_change:
2711 ext4_msg(NULL, KERN_ERR, "Cannot change journaled quota "
2712 "options when quota turned on");
2713 return -EINVAL;
2714 err_jquota_specified:
2715 ext4_msg(NULL, KERN_ERR, "%s quota file already specified",
2716 QTYPE2NAME(i));
2717 return -EINVAL;
2718 err_feature:
2719 ext4_msg(NULL, KERN_ERR, "Journaled quota options ignored "
2720 "when QUOTA feature is enabled");
2721 return 0;
2722 #else
2723 return 0;
2724 #endif
2725 }
2726
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
[superna9999:amlogic/v5.17/g12-dsi 7/7] drivers/gpu/drm/meson/meson_vclk.c:1035:26: error: use of undeclared identifier 'vid_pll_div'
by kernel test robot
tree: https://github.com/superna9999/linux amlogic/v5.17/g12-dsi
head: cc44c3ce92a63f2c59a3f0ac03e6defd41542940
commit: cc44c3ce92a63f2c59a3f0ac03e6defd41542940 [7/7] WiP: drm/meson: vclk: add DSI clock config
config: arm-randconfig-r034-20211210 (https://download.01.org/0day-ci/archive/20211210/202112101707.Kcrqw9L3-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/superna9999/linux/commit/cc44c3ce92a63f2c59a3f0ac03e6d...
git remote add superna9999 https://github.com/superna9999/linux
git fetch --no-tags superna9999 amlogic/v5.17/g12-dsi
git checkout cc44c3ce92a63f2c59a3f0ac03e6defd41542940
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/meson/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/meson/meson_vclk.c:1035:26: error: use of undeclared identifier 'vid_pll_div'
meson_vid_pll_set(priv, vid_pll_div);
^
1 error generated.
vim +/vid_pll_div +1035 drivers/gpu/drm/meson/meson_vclk.c
1029
1030 static void meson_dsi_clock_config(struct meson_drm *priv, unsigned freq)
1031 {
1032 meson_hdmi_pll_generic_set(priv, freq);
1033
1034 /* Setup vid_pll divider */
> 1035 meson_vid_pll_set(priv, vid_pll_div);
1036
1037 /* Disable VCLK2 */
1038 regmap_update_bits(priv->hhi, HHI_VIID_CLK_CNTL, VCLK2_EN, 0);
1039
1040 /* Setup vid_pll to /1 */
1041 meson_vid_pll_set(priv, VID_PLL_DIV_1);
1042
1043 /* Setup the VCLK2 divider value */
1044 regmap_update_bits(priv->hhi, HHI_VIID_CLK_DIV,
1045 VCLK2_DIV_MASK, 0);
1046
1047 /* select vid_pll for vclk2 */
1048 regmap_update_bits(priv->hhi, HHI_VIID_CLK_CNTL,
1049 VCLK2_SEL_MASK, (0 << VCLK2_SEL_SHIFT));
1050
1051 /* enable vclk2 gate */
1052 regmap_update_bits(priv->hhi, HHI_VIID_CLK_CNTL, VCLK2_EN, VCLK2_EN);
1053
1054 /* select vclk2_div1 for encl */
1055 regmap_update_bits(priv->hhi, HHI_VIID_CLK_DIV,
1056 CTS_ENCL_SEL_MASK, (8 << CTS_ENCL_SEL_SHIFT));
1057
1058 /* release vclk2_div_reset and enable vclk2_div */
1059 regmap_update_bits(priv->hhi, HHI_VIID_CLK_DIV,
1060 VCLK2_DIV_EN | VCLK2_DIV_RESET, VCLK2_DIV_EN);
1061
1062 /* enable vclk2_div1 gate */
1063 regmap_update_bits(priv->hhi, HHI_VIID_CLK_CNTL,
1064 VCLK2_DIV1_EN, VCLK2_DIV1_EN);
1065
1066 /* reset vclk2 */
1067 regmap_update_bits(priv->hhi, HHI_VIID_CLK_CNTL,
1068 VCLK2_SOFT_RESET, VCLK2_SOFT_RESET);
1069 regmap_update_bits(priv->hhi, HHI_VIID_CLK_CNTL,
1070 VCLK2_SOFT_RESET, 0);
1071
1072 /* enable encl_clk */
1073 regmap_update_bits(priv->hhi, HHI_VID_CLK_CNTL2,
1074 CTS_ENCL_EN, CTS_ENCL_EN);
1075
1076 usleep_range(10000, 11000);
1077 }
1078
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
mm/page_alloc.c:8046:33: error: implicit declaration of function 'arch_alloc_nodedata'; did you mean 'arch_alloc_page'?
by kernel test robot
tree: https://github.com/0day-ci/linux/commits/UPDATE-20211209-184929/Alexey-Ma...
head: 652e780546c1fdbe1adcbbe04106f4020e3bfb56
commit: 652e780546c1fdbe1adcbbe04106f4020e3bfb56 mm: fix panic in __alloc_pages
date: 11 hours ago
config: csky-buildonly-randconfig-r005-20211209 (https://download.01.org/0day-ci/archive/20211210/202112100657.wrZJcCEG-lk...)
compiler: csky-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
# https://github.com/0day-ci/linux/commit/652e780546c1fdbe1adcbbe04106f4020...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review UPDATE-20211209-184929/Alexey-Makhalov/mm-fix-panic-in-__alloc_pages/20211102-041405
git checkout 652e780546c1fdbe1adcbbe04106f4020e3bfb56
# 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=csky SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
mm/page_alloc.c:3804:15: warning: no previous prototype for 'should_fail_alloc_page' [-Wmissing-prototypes]
3804 | noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
| ^~~~~~~~~~~~~~~~~~~~~~
mm/page_alloc.c: In function 'free_area_init':
>> mm/page_alloc.c:8046:33: error: implicit declaration of function 'arch_alloc_nodedata'; did you mean 'arch_alloc_page'? [-Werror=implicit-function-declaration]
8046 | pgdat = arch_alloc_nodedata(nid);
| ^~~~~~~~~~~~~~~~~~~
| arch_alloc_page
>> mm/page_alloc.c:8046:31: warning: assignment to 'pg_data_t *' {aka 'struct pglist_data *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
8046 | pgdat = arch_alloc_nodedata(nid);
| ^
>> mm/page_alloc.c:8052:25: error: implicit declaration of function 'arch_refresh_nodedata' [-Werror=implicit-function-declaration]
8052 | arch_refresh_nodedata(nid, pgdat);
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +8046 mm/page_alloc.c
7949
7950 /**
7951 * free_area_init - Initialise all pg_data_t and zone data
7952 * @max_zone_pfn: an array of max PFNs for each zone
7953 *
7954 * This will call free_area_init_node() for each active node in the system.
7955 * Using the page ranges provided by memblock_set_node(), the size of each
7956 * zone in each node and their holes is calculated. If the maximum PFN
7957 * between two adjacent zones match, it is assumed that the zone is empty.
7958 * For example, if arch_max_dma_pfn == arch_max_dma32_pfn, it is assumed
7959 * that arch_max_dma32_pfn has no pages. It is also assumed that a zone
7960 * starts where the previous one ended. For example, ZONE_DMA32 starts
7961 * at arch_max_dma_pfn.
7962 */
7963 void __init free_area_init(unsigned long *max_zone_pfn)
7964 {
7965 unsigned long start_pfn, end_pfn;
7966 int i, nid, zone;
7967 bool descending;
7968
7969 /* Record where the zone boundaries are */
7970 memset(arch_zone_lowest_possible_pfn, 0,
7971 sizeof(arch_zone_lowest_possible_pfn));
7972 memset(arch_zone_highest_possible_pfn, 0,
7973 sizeof(arch_zone_highest_possible_pfn));
7974
7975 start_pfn = find_min_pfn_with_active_regions();
7976 descending = arch_has_descending_max_zone_pfns();
7977
7978 for (i = 0; i < MAX_NR_ZONES; i++) {
7979 if (descending)
7980 zone = MAX_NR_ZONES - i - 1;
7981 else
7982 zone = i;
7983
7984 if (zone == ZONE_MOVABLE)
7985 continue;
7986
7987 end_pfn = max(max_zone_pfn[zone], start_pfn);
7988 arch_zone_lowest_possible_pfn[zone] = start_pfn;
7989 arch_zone_highest_possible_pfn[zone] = end_pfn;
7990
7991 start_pfn = end_pfn;
7992 }
7993
7994 /* Find the PFNs that ZONE_MOVABLE begins at in each node */
7995 memset(zone_movable_pfn, 0, sizeof(zone_movable_pfn));
7996 find_zone_movable_pfns_for_nodes();
7997
7998 /* Print out the zone ranges */
7999 pr_info("Zone ranges:\n");
8000 for (i = 0; i < MAX_NR_ZONES; i++) {
8001 if (i == ZONE_MOVABLE)
8002 continue;
8003 pr_info(" %-8s ", zone_names[i]);
8004 if (arch_zone_lowest_possible_pfn[i] ==
8005 arch_zone_highest_possible_pfn[i])
8006 pr_cont("empty\n");
8007 else
8008 pr_cont("[mem %#018Lx-%#018Lx]\n",
8009 (u64)arch_zone_lowest_possible_pfn[i]
8010 << PAGE_SHIFT,
8011 ((u64)arch_zone_highest_possible_pfn[i]
8012 << PAGE_SHIFT) - 1);
8013 }
8014
8015 /* Print out the PFNs ZONE_MOVABLE begins at in each node */
8016 pr_info("Movable zone start for each node\n");
8017 for (i = 0; i < MAX_NUMNODES; i++) {
8018 if (zone_movable_pfn[i])
8019 pr_info(" Node %d: %#018Lx\n", i,
8020 (u64)zone_movable_pfn[i] << PAGE_SHIFT);
8021 }
8022
8023 /*
8024 * Print out the early node map, and initialize the
8025 * subsection-map relative to active online memory ranges to
8026 * enable future "sub-section" extensions of the memory map.
8027 */
8028 pr_info("Early memory node ranges\n");
8029 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
8030 pr_info(" node %3d: [mem %#018Lx-%#018Lx]\n", nid,
8031 (u64)start_pfn << PAGE_SHIFT,
8032 ((u64)end_pfn << PAGE_SHIFT) - 1);
8033 subsection_map_init(start_pfn, end_pfn - start_pfn);
8034 }
8035
8036 /* Initialise every node */
8037 mminit_verify_pageflags_layout();
8038 setup_nr_node_ids();
8039 for_each_node(nid) {
8040 pg_data_t *pgdat;
8041
8042 if (!node_online(nid)) {
8043 pr_warn("Node %d uninitialized by the platform. Please report with boot dmesg.\n", nid);
8044
8045 /* Allocator not initialized yet */
> 8046 pgdat = arch_alloc_nodedata(nid);
8047 if (!pgdat) {
8048 pr_err("Cannot allocate %zuB for node %d.\n",
8049 sizeof(*pgdat), nid);
8050 continue;
8051 }
> 8052 arch_refresh_nodedata(nid, pgdat);
8053 free_area_init_memoryless_node(nid);
8054 /*
8055 * not marking this node online because we do not want to
8056 * confuse userspace by sysfs files/directories for node
8057 * without any memory attached to it (see topology_init)
8058 * The pgdat will get fully initialized when a memory is
8059 * hotpluged into it by hotadd_init_pgdat
8060 */
8061 continue;
8062 }
8063
8064 pgdat = NODE_DATA(nid);
8065 free_area_init_node(nid);
8066
8067 /* Any memory on that node */
8068 if (pgdat->node_present_pages)
8069 node_set_state(nid, N_MEMORY);
8070 check_for_memory(pgdat, nid);
8071 }
8072
8073 memmap_init();
8074 }
8075
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks