Linux block layer
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
	tj@kernel.org, josef@toxicpanda.com, jack@suse.cz,
	axboe@kernel.dk, cgroups@vger.kernel.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	yi.zhang@huawei.com, yangerkun@huawei.com,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH 2/2] blk-ioprio: remove per-disk structure
Date: Thu, 11 Jul 2024 22:22:29 -0700	[thread overview]
Message-ID: <ZpC9le_FsIO0FCJQ@infradead.org> (raw)
In-Reply-To: <520b9c10-c152-77f3-bd5a-b86a1f5ac8ea@huaweicloud.com>

On Fri, Jul 12, 2024 at 09:10:30AM +0800, Yu Kuai wrote:
> > As one can see in the output of git grep -nHEB1 '>pd_(alloc|free)_fn\(',
> > none of the pd_alloc_fn / pd_free_fn callers checks whether or not these
> > pointers are NULL. Hence my question why this patch does not trigger any
> > NULL pointer dereferences?
> 
> Because the blkcg_deactivate_policy() is removed as well, there are no
> callers now... blkcg_policy_register() is still called to make sure
> cpd_(alloc|free)_fn will still be called.

Can you throw in a patch documenting this?  Any maybe add a check
that pd_alloc_fn / pd_free_fn exist in blkcg_activate_policy and
WARN and return an error otherwise?


  parent reply	other threads:[~2024-07-12  5:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11  9:00 [PATCH 0/2] blk-ioprio: remove per-disk structure Yu Kuai
2024-07-11  9:00 ` [PATCH 1/2] blk-ioprio: remove ioprio_blkcg_from_bio() Yu Kuai
2024-07-11 18:00   ` Bart Van Assche
2024-07-11  9:00 ` [PATCH 2/2] blk-ioprio: remove per-disk structure Yu Kuai
2024-07-11 18:03   ` Bart Van Assche
2024-07-12  1:10     ` Yu Kuai
2024-07-12  1:25       ` Yu Kuai
2024-07-12  5:22       ` Christoph Hellwig [this message]
2024-07-12  6:51         ` Yu Kuai

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=ZpC9le_FsIO0FCJQ@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=cgroups@vger.kernel.org \
    --cc=jack@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /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