All of lore.kernel.org
 help / color / mirror / Atom feed
* [koverstreet-bcachefs:bcachefs-testing 35/95] fs/bcachefs/alloc/foreground.c:560:2: warning: label followed by a declaration is a C23 extension
@ 2026-06-22 17:48 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-06-22 17:48 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/koverstreet/bcachefs bcachefs-testing
head:   ca944a61e079450f82be88c91e349638c75cf4b6
commit: ca284ad06b139fe4dc8f053ada179473c1b71bb1 [35/95] bcachefs: alloc: filter spurious freelist_wait wakes on the waiter side
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20260623/202606230132.MsodX56Z-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project a9b492db3d50683e446cd1a5c9ffaf4e92cb77a7)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260623/202606230132.MsodX56Z-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/202606230132.MsodX56Z-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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-22 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 17:48 [koverstreet-bcachefs:bcachefs-testing 35/95] fs/bcachefs/alloc/foreground.c:560:2: warning: label followed by a declaration is a C23 extension 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.