From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, yuyufen@huawei.com, tj@kernel.org, jack@suse.cz,
bvanassche@acm.org, tytso@mit.edu, hdegoede@redhat.com,
gregkh@linuxfoundation.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/9] bdi: use bdi_dev_name() to get device name
Date: Wed, 22 Apr 2020 11:07:46 +0200 [thread overview]
Message-ID: <20200422090746.GD8775@quack2.suse.cz> (raw)
In-Reply-To: <20200422073851.303714-4-hch@lst.de>
On Wed 22-04-20 09:38:45, Christoph Hellwig wrote:
> From: Yufen Yu <yuyufen@huawei.com>
>
> Use the common interface bdi_dev_name() to get device name.
>
> Signed-off-by: Yufen Yu <yuyufen@huawei.com>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> block/bfq-iosched.c | 5 +++--
> block/blk-cgroup.c | 2 +-
> fs/ceph/debugfs.c | 2 +-
> include/trace/events/wbt.h | 8 ++++----
> 4 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 78ba57efd16b..4d4fe44a9eea 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -4976,8 +4976,9 @@ bfq_set_next_ioprio_data(struct bfq_queue *bfqq, struct bfq_io_cq *bic)
> ioprio_class = IOPRIO_PRIO_CLASS(bic->ioprio);
> switch (ioprio_class) {
> default:
> - dev_err(bfqq->bfqd->queue->backing_dev_info->dev,
> - "bfq: bad prio class %d\n", ioprio_class);
> + pr_err("bdi %s: bfq: bad prio class %d\n",
> + bdi_dev_name(bfqq->bfqd->queue->backing_dev_info),
> + ioprio_class);
> /* fall through */
> case IOPRIO_CLASS_NONE:
> /*
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index c5dc833212e1..930212c1a512 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -496,7 +496,7 @@ const char *blkg_dev_name(struct blkcg_gq *blkg)
> {
> /* some drivers (floppy) instantiate a queue w/o disk registered */
> if (blkg->q->backing_dev_info->dev)
> - return dev_name(blkg->q->backing_dev_info->dev);
> + return bdi_dev_name(blkg->q->backing_dev_info);
> return NULL;
> }
>
> diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
> index 481ac97b4d25..dcaed75de9e6 100644
> --- a/fs/ceph/debugfs.c
> +++ b/fs/ceph/debugfs.c
> @@ -271,7 +271,7 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
> &congestion_kb_fops);
>
> snprintf(name, sizeof(name), "../../bdi/%s",
> - dev_name(fsc->sb->s_bdi->dev));
> + bdi_dev_name(fsc->sb->s_bdi));
> fsc->debugfs_bdi =
> debugfs_create_symlink("bdi",
> fsc->client->debugfs_dir,
> diff --git a/include/trace/events/wbt.h b/include/trace/events/wbt.h
> index 784814160197..9c66e59d859c 100644
> --- a/include/trace/events/wbt.h
> +++ b/include/trace/events/wbt.h
> @@ -33,7 +33,7 @@ TRACE_EVENT(wbt_stat,
> ),
>
> TP_fast_assign(
> - strlcpy(__entry->name, dev_name(bdi->dev),
> + strlcpy(__entry->name, bdi_dev_name(bdi),
> ARRAY_SIZE(__entry->name));
> __entry->rmean = stat[0].mean;
> __entry->rmin = stat[0].min;
> @@ -68,7 +68,7 @@ TRACE_EVENT(wbt_lat,
> ),
>
> TP_fast_assign(
> - strlcpy(__entry->name, dev_name(bdi->dev),
> + strlcpy(__entry->name, bdi_dev_name(bdi),
> ARRAY_SIZE(__entry->name));
> __entry->lat = div_u64(lat, 1000);
> ),
> @@ -105,7 +105,7 @@ TRACE_EVENT(wbt_step,
> ),
>
> TP_fast_assign(
> - strlcpy(__entry->name, dev_name(bdi->dev),
> + strlcpy(__entry->name, bdi_dev_name(bdi),
> ARRAY_SIZE(__entry->name));
> __entry->msg = msg;
> __entry->step = step;
> @@ -141,7 +141,7 @@ TRACE_EVENT(wbt_timer,
> ),
>
> TP_fast_assign(
> - strlcpy(__entry->name, dev_name(bdi->dev),
> + strlcpy(__entry->name, bdi_dev_name(bdi),
> ARRAY_SIZE(__entry->name));
> __entry->status = status;
> __entry->step = step;
> --
> 2.26.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2020-04-22 9:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 7:38 bdi: fix use-after-free for dev_name(bdi->dev) v3 Christoph Hellwig
2020-04-22 7:38 ` [PATCH 1/9] vboxsf: don't use the source name in the bdi name Christoph Hellwig
2020-04-22 8:15 ` Hans de Goede
2020-04-22 7:38 ` [PATCH 2/9] bdi: move bdi_dev_name out of line Christoph Hellwig
2020-04-23 0:07 ` Bart Van Assche
2020-04-22 7:38 ` [PATCH 3/9] bdi: use bdi_dev_name() to get device name Christoph Hellwig
2020-04-22 9:07 ` Jan Kara [this message]
2020-04-23 0:08 ` Bart Van Assche
2020-04-22 7:38 ` [PATCH 4/9] bdi: add a ->dev_name field to struct backing_dev_info Christoph Hellwig
2020-04-22 9:08 ` Jan Kara
2020-04-23 0:09 ` Bart Van Assche
2020-04-22 7:38 ` [PATCH 5/9] driver core: remove device_create_vargs Christoph Hellwig
2020-04-22 9:09 ` Jan Kara
2020-04-22 7:38 ` [PATCH 6/9] bdi: unexport bdi_register_va Christoph Hellwig
2020-04-23 0:11 ` Bart Van Assche
2020-04-22 7:38 ` [PATCH 7/9] bdi: remove bdi_register_owner Christoph Hellwig
2020-04-23 0:13 ` Bart Van Assche
2020-04-22 7:38 ` [PATCH 8/9] bdi: simplify bdi_alloc Christoph Hellwig
2020-04-23 0:13 ` Bart Van Assche
2020-04-22 7:38 ` [PATCH 9/9] bdi: remove the name field in struct backing_dev_info Christoph Hellwig
2020-04-23 0:16 ` Bart Van Assche
2020-04-25 7:59 ` bdi: fix use-after-free for dev_name(bdi->dev) v3 Christoph Hellwig
2020-04-25 10:43 ` Hans de Goede
2020-04-28 6:52 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2020-05-04 12:47 bdi: fix use-after-free for dev_name(bdi->dev) v3 (resend) Christoph Hellwig
2020-05-04 12:47 ` [PATCH 3/9] bdi: use bdi_dev_name() to get device name Christoph Hellwig
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=20200422090746.GD8775@quack2.suse.cz \
--to=jack@suse.cz \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=hdegoede@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=tytso@mit.edu \
--cc=yuyufen@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