mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [gustavoars:testing/wfamnae-next20250616 2395/2847] fs/bcachefs/btree_journal_iter.c:716:6: warning: variable 'nr_entries' set but not used
Date: Tue, 1 Jul 2025 07:27:42 +0200	[thread overview]
Message-ID: <202507010724.lVYV4UeK-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-07-01  5:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202507010724.lVYV4UeK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gustavo@embeddedor.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®