* [koverstreet-bcachefs:master 111/111] fs/bcachefs/super-io.c:369:13: warning: variable 'block_size' set but not used
@ 2025-02-21 2:20 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-21 2:20 UTC (permalink / raw)
To: Kent Overstreet; +Cc: oe-kbuild-all
tree: https://github.com/koverstreet/bcachefs master
head: 77308424ba26e1b41a7db5d4eae121841a707c05
commit: 77308424ba26e1b41a7db5d4eae121841a707c05 [111/111] bcachefs: bs > ps support
config: i386-buildonly-randconfig-002-20250221 (https://download.01.org/0day-ci/archive/20250221/202502211014.bXvmOB0M-lkp@intel.com/config)
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/20250221/202502211014.bXvmOB0M-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/202502211014.bXvmOB0M-lkp@intel.com/
All warnings (new ones prefixed by >>):
fs/bcachefs/super-io.c: In function 'bch2_sb_validate':
>> fs/bcachefs/super-io.c:369:13: warning: variable 'block_size' set but not used [-Wunused-but-set-variable]
369 | u16 block_size;
| ^~~~~~~~~~
vim +/block_size +369 fs/bcachefs/super-io.c
a02a0121b3de81 Kent Overstreet 2023-06-28 362
a5c3e265d3b61a Kent Overstreet 2024-05-08 363 static int bch2_sb_validate(struct bch_sb_handle *disk_sb,
a5c3e265d3b61a Kent Overstreet 2024-05-08 364 enum bch_validate_flags flags, struct printbuf *out)
a02a0121b3de81 Kent Overstreet 2023-06-28 365 {
a02a0121b3de81 Kent Overstreet 2023-06-28 366 struct bch_sb *sb = disk_sb->sb;
9af26120f06e03 Hunter Shaffer 2023-09-25 367 struct bch_sb_field_members_v1 *mi;
a02a0121b3de81 Kent Overstreet 2023-06-28 368 enum bch_opt_id opt_id;
a02a0121b3de81 Kent Overstreet 2023-06-28 @369 u16 block_size;
a02a0121b3de81 Kent Overstreet 2023-06-28 370 int ret;
a02a0121b3de81 Kent Overstreet 2023-06-28 371
a02a0121b3de81 Kent Overstreet 2023-06-28 372 ret = bch2_sb_compatible(sb, out);
a02a0121b3de81 Kent Overstreet 2023-06-28 373 if (ret)
a02a0121b3de81 Kent Overstreet 2023-06-28 374 return ret;
a02a0121b3de81 Kent Overstreet 2023-06-28 375
c258f28ebab6be Kent Overstreet 2018-11-12 376 if (sb->features[1] ||
efe68e1d65c008 Kent Overstreet 2022-01-03 377 (le64_to_cpu(sb->features[0]) & (~0ULL << BCH_FEATURE_NR))) {
401ec4db630802 Kent Overstreet 2023-02-03 378 prt_printf(out, "Filesystem has incompatible features");
78c0b75c34209c Kent Overstreet 2022-11-19 379 return -BCH_ERR_invalid_sb_features;
efe68e1d65c008 Kent Overstreet 2022-01-03 380 }
c258f28ebab6be Kent Overstreet 2018-11-12 381
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 382 if (BCH_VERSION_MAJOR(le16_to_cpu(sb->version)) > BCH_VERSION_MAJOR(bcachefs_metadata_version_current) ||
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 383 BCH_SB_VERSION_INCOMPAT(sb) > bcachefs_metadata_version_current) {
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 384 prt_printf(out, "Filesystem has incompatible version");
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 385 return -BCH_ERR_invalid_sb_features;
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 386 }
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 387
1c6fdbd8f2465d Kent Overstreet 2017-03-16 388 block_size = le16_to_cpu(sb->block_size);
1c6fdbd8f2465d Kent Overstreet 2017-03-16 389
efe68e1d65c008 Kent Overstreet 2022-01-03 390 if (bch2_is_zero(sb->user_uuid.b, sizeof(sb->user_uuid))) {
401ec4db630802 Kent Overstreet 2023-02-03 391 prt_printf(out, "Bad user UUID (got zeroes)");
78c0b75c34209c Kent Overstreet 2022-11-19 392 return -BCH_ERR_invalid_sb_uuid;
efe68e1d65c008 Kent Overstreet 2022-01-03 393 }
1c6fdbd8f2465d Kent Overstreet 2017-03-16 394
efe68e1d65c008 Kent Overstreet 2022-01-03 395 if (bch2_is_zero(sb->uuid.b, sizeof(sb->uuid))) {
6bf3766b5211dd Colin Ian King 2023-09-12 396 prt_printf(out, "Bad internal UUID (got zeroes)");
78c0b75c34209c Kent Overstreet 2022-11-19 397 return -BCH_ERR_invalid_sb_uuid;
efe68e1d65c008 Kent Overstreet 2022-01-03 398 }
1c6fdbd8f2465d Kent Overstreet 2017-03-16 399
1c6fdbd8f2465d Kent Overstreet 2017-03-16 400 if (!sb->nr_devices ||
efe68e1d65c008 Kent Overstreet 2022-01-03 401 sb->nr_devices > BCH_SB_MEMBERS_MAX) {
401ec4db630802 Kent Overstreet 2023-02-03 402 prt_printf(out, "Bad number of member devices %u (max %u)",
efe68e1d65c008 Kent Overstreet 2022-01-03 403 sb->nr_devices, BCH_SB_MEMBERS_MAX);
78c0b75c34209c Kent Overstreet 2022-11-19 404 return -BCH_ERR_invalid_sb_too_many_members;
efe68e1d65c008 Kent Overstreet 2022-01-03 405 }
1c6fdbd8f2465d Kent Overstreet 2017-03-16 406
efe68e1d65c008 Kent Overstreet 2022-01-03 407 if (sb->dev_idx >= sb->nr_devices) {
401ec4db630802 Kent Overstreet 2023-02-03 408 prt_printf(out, "Bad dev_idx (got %u, nr_devices %u)",
efe68e1d65c008 Kent Overstreet 2022-01-03 409 sb->dev_idx, sb->nr_devices);
78c0b75c34209c Kent Overstreet 2022-11-19 410 return -BCH_ERR_invalid_sb_dev_idx;
efe68e1d65c008 Kent Overstreet 2022-01-03 411 }
1c6fdbd8f2465d Kent Overstreet 2017-03-16 412
1c6fdbd8f2465d Kent Overstreet 2017-03-16 413 if (!sb->time_precision ||
efe68e1d65c008 Kent Overstreet 2022-01-03 414 le32_to_cpu(sb->time_precision) > NSEC_PER_SEC) {
401ec4db630802 Kent Overstreet 2023-02-03 415 prt_printf(out, "Invalid time precision: %u (min 1, max %lu)",
efe68e1d65c008 Kent Overstreet 2022-01-03 416 le32_to_cpu(sb->time_precision), NSEC_PER_SEC);
78c0b75c34209c Kent Overstreet 2022-11-19 417 return -BCH_ERR_invalid_sb_time_precision;
efe68e1d65c008 Kent Overstreet 2022-01-03 418 }
1c6fdbd8f2465d Kent Overstreet 2017-03-16 419
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 420 /* old versions didn't know to downgrade this field */
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 421 if (BCH_SB_VERSION_INCOMPAT_ALLOWED(sb) > le16_to_cpu(sb->version))
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 422 SET_BCH_SB_VERSION_INCOMPAT_ALLOWED(sb, le16_to_cpu(sb->version));
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 423
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 424 if (BCH_SB_VERSION_INCOMPAT(sb) > BCH_SB_VERSION_INCOMPAT_ALLOWED(sb)) {
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 425 prt_printf(out, "Invalid version_incompat ");
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 426 bch2_version_to_text(out, BCH_SB_VERSION_INCOMPAT(sb));
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 427 prt_str(out, " > incompat_allowed ");
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 428 bch2_version_to_text(out, BCH_SB_VERSION_INCOMPAT_ALLOWED(sb));
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 429 if (flags & BCH_VALIDATE_write)
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 430 return -BCH_ERR_invalid_sb_version;
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 431 else
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 432 SET_BCH_SB_VERSION_INCOMPAT_ALLOWED(sb, BCH_SB_VERSION_INCOMPAT(sb));
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 433 }
a36d8f0e0e3d42 Kent Overstreet 2024-11-11 434
a5c3e265d3b61a Kent Overstreet 2024-05-08 435 if (!flags) {
b8559f1a212a70 Kent Overstreet 2022-03-21 436 /*
b8559f1a212a70 Kent Overstreet 2022-03-21 437 * Been seeing a bug where these are getting inexplicably
a02a0121b3de81 Kent Overstreet 2023-06-28 438 * zeroed, so we're now validating them, but we have to be
b8559f1a212a70 Kent Overstreet 2022-03-21 439 * careful not to preven people's filesystems from mounting:
b8559f1a212a70 Kent Overstreet 2022-03-21 440 */
b8559f1a212a70 Kent Overstreet 2022-03-21 441 if (!BCH_SB_JOURNAL_FLUSH_DELAY(sb))
b8559f1a212a70 Kent Overstreet 2022-03-21 442 SET_BCH_SB_JOURNAL_FLUSH_DELAY(sb, 1000);
b8559f1a212a70 Kent Overstreet 2022-03-21 443 if (!BCH_SB_JOURNAL_RECLAIM_DELAY(sb))
b8559f1a212a70 Kent Overstreet 2022-03-21 444 SET_BCH_SB_JOURNAL_RECLAIM_DELAY(sb, 1000);
813e0cecd1473d Kent Overstreet 2023-07-15 445
813e0cecd1473d Kent Overstreet 2023-07-15 446 if (!BCH_SB_VERSION_UPGRADE_COMPLETE(sb))
813e0cecd1473d Kent Overstreet 2023-07-15 447 SET_BCH_SB_VERSION_UPGRADE_COMPLETE(sb, le16_to_cpu(sb->version));
cecf72798b25fc Kent Overstreet 2024-08-07 448
cecf72798b25fc Kent Overstreet 2024-08-07 449 if (le16_to_cpu(sb->version) <= bcachefs_metadata_version_disk_accounting_v2 &&
cecf72798b25fc Kent Overstreet 2024-08-07 450 !BCH_SB_ALLOCATOR_STUCK_TIMEOUT(sb))
cecf72798b25fc Kent Overstreet 2024-08-07 451 SET_BCH_SB_ALLOCATOR_STUCK_TIMEOUT(sb, 30);
c7652f253a6d59 Kent Overstreet 2024-07-31 452
c7652f253a6d59 Kent Overstreet 2024-07-31 453 if (le16_to_cpu(sb->version) <= bcachefs_metadata_version_disk_accounting_v2)
c7652f253a6d59 Kent Overstreet 2024-07-31 454 SET_BCH_SB_PROMOTE_WHOLE_EXTENTS(sb, true);
b8559f1a212a70 Kent Overstreet 2022-03-21 455 }
b8559f1a212a70 Kent Overstreet 2022-03-21 456
:::::: The code at line 369 was first introduced by commit
:::::: a02a0121b3de81f985d6c751f1557c7aea832b9a bcachefs: bch2_version_compatible()
:::::: TO: Kent Overstreet <kent.overstreet@linux.dev>
:::::: CC: Kent Overstreet <kent.overstreet@linux.dev>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-21 2:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21 2:20 [koverstreet-bcachefs:master 111/111] fs/bcachefs/super-io.c:369:13: warning: variable 'block_size' set but not used kernel test robot
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.