All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: [bvanassche:block-for-next 17/31] block/bfq-cgroup.c:1083:2: warning: releasing spinlock 'bdev_get_queue(ctx.bdev).queue_lock' that was not held
Date: Mon, 23 Mar 2026 18:19:03 +0800	[thread overview]
Message-ID: <202603231818.WiRBknYm-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "only suspicious fbc files changed"
:::::: 

BCC: lkp@intel.com
CC: llvm@lists.linux.dev
CC: oe-kbuild-all@lists.linux.dev
TO: Bart Van Assche <bvanassche@acm.org>

tree:   https://github.com/bvanassche/linux block-for-next
head:   9f0e2d950eb40285341043781f7e9fe8258f9ad6
commit: e9ca43430f52e1ed72d5da4f7b9ef71d85a7fc9d [17/31] block: Enable lock context analysis
:::::: branch date: 19 hours ago
:::::: commit date: 19 hours ago
config: um-defconfig (https://download.01.org/0day-ci/archive/20260323/202603231818.WiRBknYm-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project c911b8492374942bf4cfe35411e90a35d3837f6a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260323/202603231818.WiRBknYm-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/r/202603231818.WiRBknYm-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> block/bfq-cgroup.c:1083:2: warning: releasing spinlock 'bdev_get_queue(ctx.bdev).queue_lock' that was not held [-Wthread-safety-analysis]
    1083 |         blkg_conf_unprep(&ctx);
         |         ^
>> block/bfq-cgroup.c:1085:2: warning: spinlock 'ctx.bdev->bd_disk->queue->queue_lock' is not held on every path through here [-Wthread-safety-analysis]
    1085 |         blkg_conf_close_bdev(&ctx);
         |         ^
   block/bfq-cgroup.c:1058:8: note: spinlock acquired here
    1058 |         ret = blkg_conf_prep(blkcg, &blkcg_policy_bfq, &ctx);
         |               ^
   2 warnings generated.


vim +1083 block/bfq-cgroup.c

ea25da48086d3b Paolo Valente   2017-04-19  1041  
795fe54c2a8280 Fam Zheng       2019-08-28  1042  static ssize_t bfq_io_set_device_weight(struct kernfs_open_file *of,
ea25da48086d3b Paolo Valente   2017-04-19  1043  					char *buf, size_t nbytes,
ea25da48086d3b Paolo Valente   2017-04-19  1044  					loff_t off)
ea25da48086d3b Paolo Valente   2017-04-19  1045  {
795fe54c2a8280 Fam Zheng       2019-08-28  1046  	int ret;
795fe54c2a8280 Fam Zheng       2019-08-28  1047  	struct blkg_conf_ctx ctx;
795fe54c2a8280 Fam Zheng       2019-08-28  1048  	struct blkcg *blkcg = css_to_blkcg(of_css(of));
795fe54c2a8280 Fam Zheng       2019-08-28  1049  	struct bfq_group *bfqg;
795fe54c2a8280 Fam Zheng       2019-08-28  1050  	u64 v;
ea25da48086d3b Paolo Valente   2017-04-19  1051  
faffaab2895914 Tejun Heo       2023-04-12  1052  	blkg_conf_init(&ctx, buf);
faffaab2895914 Tejun Heo       2023-04-12  1053  
74103c4f12c415 Bart Van Assche 2026-03-18  1054  	ret = blkg_conf_open_bdev(&ctx);
74103c4f12c415 Bart Van Assche 2026-03-18  1055  	if (ret)
ab9ad25a727a61 Bart Van Assche 2026-03-18  1056  		return ret;
74103c4f12c415 Bart Van Assche 2026-03-18  1057  
faffaab2895914 Tejun Heo       2023-04-12  1058  	ret = blkg_conf_prep(blkcg, &blkcg_policy_bfq, &ctx);
ea25da48086d3b Paolo Valente   2017-04-19  1059  	if (ret)
ab9ad25a727a61 Bart Van Assche 2026-03-18  1060  		goto close_bdev;
ea25da48086d3b Paolo Valente   2017-04-19  1061  
795fe54c2a8280 Fam Zheng       2019-08-28  1062  	if (sscanf(ctx.body, "%llu", &v) == 1) {
795fe54c2a8280 Fam Zheng       2019-08-28  1063  		/* require "default" on dfl */
795fe54c2a8280 Fam Zheng       2019-08-28  1064  		ret = -ERANGE;
795fe54c2a8280 Fam Zheng       2019-08-28  1065  		if (!v)
795fe54c2a8280 Fam Zheng       2019-08-28  1066  			goto out;
795fe54c2a8280 Fam Zheng       2019-08-28  1067  	} else if (!strcmp(strim(ctx.body), "default")) {
795fe54c2a8280 Fam Zheng       2019-08-28  1068  		v = 0;
795fe54c2a8280 Fam Zheng       2019-08-28  1069  	} else {
795fe54c2a8280 Fam Zheng       2019-08-28  1070  		ret = -EINVAL;
795fe54c2a8280 Fam Zheng       2019-08-28  1071  		goto out;
795fe54c2a8280 Fam Zheng       2019-08-28  1072  	}
795fe54c2a8280 Fam Zheng       2019-08-28  1073  
795fe54c2a8280 Fam Zheng       2019-08-28  1074  	bfqg = blkg_to_bfqg(ctx.blkg);
795fe54c2a8280 Fam Zheng       2019-08-28  1075  
795fe54c2a8280 Fam Zheng       2019-08-28  1076  	ret = -ERANGE;
795fe54c2a8280 Fam Zheng       2019-08-28  1077  	if (!v || (v >= BFQ_MIN_WEIGHT && v <= BFQ_MAX_WEIGHT)) {
795fe54c2a8280 Fam Zheng       2019-08-28  1078  		bfq_group_set_weight(bfqg, bfqg->entity.weight, v);
795fe54c2a8280 Fam Zheng       2019-08-28  1079  		ret = 0;
795fe54c2a8280 Fam Zheng       2019-08-28  1080  	}
ab9ad25a727a61 Bart Van Assche 2026-03-18  1081  
795fe54c2a8280 Fam Zheng       2019-08-28  1082  out:
ab9ad25a727a61 Bart Van Assche 2026-03-18 @1083  	blkg_conf_unprep(&ctx);
ab9ad25a727a61 Bart Van Assche 2026-03-18  1084  close_bdev:
ab9ad25a727a61 Bart Van Assche 2026-03-18 @1085  	blkg_conf_close_bdev(&ctx);
795fe54c2a8280 Fam Zheng       2019-08-28  1086  	return ret ?: nbytes;
795fe54c2a8280 Fam Zheng       2019-08-28  1087  }
795fe54c2a8280 Fam Zheng       2019-08-28  1088  

:::::: The code at line 1083 was first introduced by commit
:::::: ab9ad25a727a61c0bddea103f63ecd24ba9c820c block/cgroup: Split blkg_conf_exit()

:::::: TO: Bart Van Assche <bvanassche@acm.org>
:::::: CC: Bart Van Assche <bvanassche@acm.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-03-23 10:20 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=202603231818.WiRBknYm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild@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 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.