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
Subject: [bcachefs:bcachefs-testing 35/35] fs/bcachefs/alloc/foreground.c:560:2: warning: label followed by a declaration is a C23 extension
Date: Fri, 24 Apr 2026 12:14:02 +0800 [thread overview]
Message-ID: <202604241231.XHlNZ0fg-lkp@intel.com> (raw)
tree: https://evilpiepirate.org/git/bcachefs.git bcachefs-testing
head: db7e4548979f797675fe7214f4745be25d16c455
commit: 3dd173bb8d58e827ecf6cdd31e81dc52f8d75110 [35/35] bcachefs: alloc: filter spurious freelist_wait wakes on the waiter side
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20260424/202604241231.XHlNZ0fg-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260424/202604241231.XHlNZ0fg-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/202604241231.XHlNZ0fg-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/bcachefs/alloc/foreground.c:560:2: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
560 | u32 wake_counter_snapshot = atomic_read(&ca->alloc_wake_counter);
| ^
1 warning generated.
vim +560 fs/bcachefs/alloc/foreground.c
540
541 /**
542 * bch2_bucket_alloc_trans - allocate a single bucket from a specific device
543 * @trans: transaction object
544 * @req: state for the entire allocation
545 *
546 * Returns: an open_bucket on success, or an ERR_PTR() on failure.
547 */
548 static struct open_bucket *bch2_bucket_alloc_trans(struct btree_trans *trans,
549 struct alloc_request *req)
550 {
551 struct bch_fs *c = trans->c;
552 struct bch_dev *ca = req->ca;
553 struct open_bucket *ob = NULL;
554 bool freespace = READ_ONCE(ca->mi.freespace_initialized);
555 bool waiting = false;
556
557 req->btree_bitmap = req->data_type == BCH_DATA_btree;
558 memset(&req->counters, 0, sizeof(req->counters));
559 again:
> 560 u32 wake_counter_snapshot = atomic_read(&ca->alloc_wake_counter);
561 bch2_dev_usage_read_fast(ca, &req->usage);
562 u64 avail = __dev_buckets_free(ca, req->usage, req->watermark);
563
564 if (req->usage.buckets[BCH_DATA_need_discard] >
565 min(avail, ca->mi.nbuckets >> 7))
566 bch2_do_discards_async(c);
567
568 if (req->usage.buckets[BCH_DATA_need_gc_gens] > avail)
569 bch2_gc_gens_async(c);
570
571 if (should_invalidate_buckets(ca, req->usage))
572 bch2_dev_do_invalidates(ca);
573
574 if (!avail) {
575 if (req->watermark > BCH_WATERMARK_normal &&
576 c->recovery.pass_done < BCH_RECOVERY_PASS_check_allocations)
577 goto alloc;
578
579 if (bch2_copygc_can_make_progress(ca)) {
580 req->copygc_can_make_progress = true;
581 bch2_copygc_wakeup(c);
582 }
583
584 track_event_change(&c->times[BCH_TIME_blocked_allocate], true);
585
586 if (req->cl &&
587 !(req->flags & BCH_WRITE_alloc_nowait) &&
588 !req->will_retry_target_devices &&
589 !req->will_retry_all_devices &&
590 !req->will_retry_set_devices) {
591 if ((!req->copygc_can_make_progress ||
592 req->watermark == BCH_WATERMARK_copygc) &&
593 (req->nr_effective || (req->devs_have && req->devs_have->nr))) {
594 ob = ERR_PTR(bch_err_throw(c, bucket_alloc_no_progress));
595 } else if (!waiting) {
596 closure_wait(&c->allocator.freelist_wait, req->cl);
597 waiting = true;
598 goto again;
599 } else {
600 ob = ERR_PTR(bch_err_throw(c, bucket_alloc_blocked));
601 }
602 } else {
603 ob = ERR_PTR(bch_err_throw(c, freelist_empty));
604 }
605
606 goto err;
607 }
608
609 if (waiting)
610 bch2_alloc_wake_dev(ca);
611 alloc:
612 ob = likely(freespace)
613 ? bch2_bucket_alloc_freelist(trans, req)
614 : bch2_bucket_alloc_early(trans, req);
615
616 if (!ob && req->btree_bitmap != BTREE_BITMAP_ANY) {
617 req->btree_bitmap = BTREE_BITMAP_ANY;
618 goto alloc;
619 }
620
621 if (!ob && freespace && c->recovery.pass_done < BCH_RECOVERY_PASS_check_alloc_info) {
622 freespace = false;
623 goto alloc;
624 }
625 err:
626 if (!ob)
627 ob = ERR_PTR(bch_err_throw(c, no_buckets_found));
628
629 int ret = PTR_ERR_OR_ZERO(ob);
630
631 if (!ret) {
632 ob->data_type = req->data_type;
633
634 event_inc_trace(c, bucket_alloc, buf,
635 bucket_alloc_to_text(&buf, c, req, ob));
636 } else if (bch2_err_matches(ret, BCH_ERR_open_buckets_empty) ||
637 bch2_err_matches(ret, BCH_ERR_open_bucket_alloc_blocked)) {
638 event_inc_trace(c, open_bucket_alloc_fail, buf,
639 bch2_fs_open_buckets_to_text(&buf, c));
640 } else if (!bch2_err_matches(ret, BCH_ERR_transaction_restart) &&
641 !req->will_retry_target_devices &&
642 !req->will_retry_all_devices &&
643 !req->will_retry_set_devices)
644 event_inc_trace(c, bucket_alloc_fail, buf,
645 bucket_alloc_to_text(&buf, c, req, ob));
646
647 alloc_trace_add(req, ca->dev_idx, ret, wake_counter_snapshot);
648
649 return ob;
650 }
651
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-04-24 4:14 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=202604241231.XHlNZ0fg-lkp@intel.com \
--to=lkp@intel.com \
--cc=kent.overstreet@linux.dev \
--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