tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 6804f0edbe7747774e6ae60f20cec4ee3ad7c187 commit: 4e7795eda4459bf3e69c87c793bc34f610f9d981 [7634/8795] bcachefs: bch2_sb_member_alloc() config: powerpc64-randconfig-003-20240903 (https://download.01.org/0day-ci/archive/20240903/202409031807.S80qlUjK-lkp@xxxxxxxxx/config) compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240903/202409031807.S80qlUjK-lkp@xxxxxxxxx/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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202409031807.S80qlUjK-lkp@xxxxxxxxx/ All errors (new ones prefixed by >>): >> fs/bcachefs/sb-members.c:503:2: error: expected expression unsigned nr_devices = max_t(unsigned, dev_idx + 1, c->sb.nr_devices); ^ >> fs/bcachefs/sb-members.c:507:42: error: use of undeclared identifier 'nr_devices' le16_to_cpu(mi->member_bytes) * nr_devices, sizeof(u64)); ^ include/linux/math.h:37:22: note: expanded from macro 'DIV_ROUND_UP' #define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP ^ fs/bcachefs/sb-members.c:513:30: error: use of undeclared identifier 'nr_devices' c->disk_sb.sb->nr_devices = nr_devices; ^ 3 errors generated. vim +503 fs/bcachefs/sb-members.c 476 477 int bch2_sb_member_alloc(struct bch_fs *c) 478 { 479 unsigned dev_idx = c->sb.nr_devices; 480 if (dev_idx < BCH_SB_MEMBERS_MAX) 481 goto have_slot; 482 483 int best = -1; 484 u64 best_last_mount = 0; 485 for (dev_idx = 0; dev_idx < BCH_SB_MEMBERS_MAX; dev_idx++) { 486 struct bch_member m = bch2_sb_member_get(c->disk_sb.sb, dev_idx); 487 if (bch2_member_alive(&m)) 488 continue; 489 490 u64 last_mount = le64_to_cpu(m.last_mount); 491 if (best < 0 || last_mount < best_last_mount) { 492 best = dev_idx; 493 best_last_mount = last_mount; 494 } 495 } 496 if (best >= 0) { 497 dev_idx = best; 498 goto have_slot; 499 } 500 501 return -BCH_ERR_ENOSPC_sb_members; 502 have_slot: > 503 unsigned nr_devices = max_t(unsigned, dev_idx + 1, c->sb.nr_devices); 504 505 struct bch_sb_field_members_v2 *mi = bch2_sb_field_get(c->disk_sb.sb, members_v2); 506 unsigned u64s = DIV_ROUND_UP(sizeof(struct bch_sb_field_members_v2) + > 507 le16_to_cpu(mi->member_bytes) * nr_devices, sizeof(u64)); -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki