mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [gustavoars:testing/wfamnae-next20250616 2395/2847] fs/bcachefs/btree_journal_iter.c:716:6: warning: variable 'nr_entries' set but not used
@ 2025-07-01  5:27 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-07-01  5:27 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: llvm, oe-kbuild-all, Gustavo A. R. Silva, LKML

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/wfamnae-next20250616
head:   78f053980ba50a0becae798ab7d07527d97e790d
commit: 86f84750a02d65e592ec519e82ae73ad54149e59 [2395/2847] bcachefs: opts.journal_rewind
config: powerpc-randconfig-2002-20250701 (https://download.01.org/0day-ci/archive/20250701/202507010724.lVYV4UeK-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250701/202507010724.lVYV4UeK-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/202507010724.lVYV4UeK-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/bcachefs/btree_journal_iter.c:716:6: warning: variable 'nr_entries' set but not used [-Wunused-but-set-variable]
     716 |         u64 nr_entries = 0;
         |             ^
   1 warning generated.


vim +/nr_entries +716 fs/bcachefs/btree_journal_iter.c

   709	
   710	int bch2_journal_keys_sort(struct bch_fs *c)
   711	{
   712		struct genradix_iter iter;
   713		struct journal_replay *i, **_i;
   714		struct journal_keys *keys = &c->journal_keys;
   715		size_t nr_read = 0;
 > 716		u64 nr_entries = 0;
   717	
   718		u64 rewind_seq = c->opts.journal_rewind ?: U64_MAX;
   719	
   720		genradix_for_each(&c->journal_entries, iter, _i) {
   721			i = *_i;
   722	
   723			nr_entries += i != NULL;
   724	
   725			if (journal_replay_ignore(i))
   726				continue;
   727	
   728			cond_resched();
   729	
   730			vstruct_for_each(&i->j, entry) {
   731				bool rewind = !entry->level &&
   732					!btree_id_is_alloc(entry->btree_id) &&
   733					le64_to_cpu(i->j.seq) >= rewind_seq;
   734	
   735				if (entry->type != (rewind
   736						    ? BCH_JSET_ENTRY_overwrite
   737						    : BCH_JSET_ENTRY_btree_keys))
   738					continue;
   739	
   740				if (!rewind && le64_to_cpu(i->j.seq) < c->journal_replay_seq_start)
   741					continue;
   742	
   743				jset_entry_for_each_key(entry, k) {
   744					struct journal_key n = (struct journal_key) {
   745						.btree_id	= entry->btree_id,
   746						.level		= entry->level,
   747						.rewind		= rewind,
   748						.k		= k,
   749						.journal_seq	= le64_to_cpu(i->j.seq),
   750						.journal_offset	= k->_data - i->j._data,
   751					};
   752	
   753					if (darray_push(keys, n)) {
   754						__journal_keys_sort(keys);
   755	
   756						if (keys->nr * 8 > keys->size * 7) {
   757							bch_err(c, "Too many journal keys for slowpath; have %zu compacted, buf size %zu, processed %zu keys at seq %llu",
   758								keys->nr, keys->size, nr_read, le64_to_cpu(i->j.seq));
   759							return bch_err_throw(c, ENOMEM_journal_keys_sort);
   760						}
   761	
   762						BUG_ON(darray_push(keys, n));
   763					}
   764	
   765					nr_read++;
   766				}
   767			}
   768		}
   769	
   770		__journal_keys_sort(keys);
   771		keys->gap = keys->nr;
   772	
   773		bch_verbose(c, "Journal keys: %zu read, %zu after sorting and compacting", nr_read, keys->nr);
   774		return 0;
   775	}
   776	

-- 
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-07-01  5:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-01  5:27 [gustavoars:testing/wfamnae-next20250616 2395/2847] fs/bcachefs/btree_journal_iter.c:716:6: warning: variable 'nr_entries' set but not used kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®