public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jackie Liu <liu.yun@linux.dev>
Cc: tj@kernel.org, hch@lst.de, axboe@kernel.dk,
	cgroups@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH] blk-cgroup: fix disk reference leak in blkcg_maybe_throttle_current()
Date: Tue, 31 Mar 2026 17:22:17 +0200	[thread overview]
Message-ID: <20260331152217.GA8074@lst.de> (raw)
In-Reply-To: <20260331085054.46857-1-liu.yun@linux.dev>

On Tue, Mar 31, 2026 at 04:50:54PM +0800, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
> 
> Add the missing put_disk() on the error path in
> blkcg_maybe_throttle_current(). When blkcg lookup, blkg lookup, or
> blkg_tryget() fails, the function jumps to the out label which only
> calls rcu_read_unlock() but does not release the disk reference acquired
> by blkcg_schedule_throttle() via get_device(). Since current->throttle_disk
> is already set to NULL before the lookup, blkcg_exit() cannot release
> this reference either, causing the disk to never be freed.
> 
> Restore the reference release that was present as blk_put_queue() in the
> original code but was inadvertently dropped during the conversion from
> request_queue to gendisk.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


  reply	other threads:[~2026-03-31 15:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31  8:50 [PATCH] blk-cgroup: fix disk reference leak in blkcg_maybe_throttle_current() Jackie Liu
2026-03-31 15:22 ` Christoph Hellwig [this message]
2026-03-31 19:05 ` Tejun Heo
2026-03-31 19:56 ` Jens Axboe

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=20260331152217.GA8074@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=liu.yun@linux.dev \
    --cc=tj@kernel.org \
    /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