From: "yukuai (C)" <yukuai3@huawei.com>
To: Joe Perches <joe@perches.com>, <josef@toxicpanda.com>,
<axboe@kernel.dk>, <ming.lei@redhat.com>
Cc: <linux-block@vger.kernel.org>, <nbd@other.debian.org>,
<linux-kernel@vger.kernel.org>, <yi.zhang@huawei.com>
Subject: Re: [PATCH -next v2 6/6] nbd: use pr_err to output error message
Date: Thu, 19 May 2022 09:06:20 +0800 [thread overview]
Message-ID: <65fe63ed-91d4-35bd-3e25-39c4457295d0@huawei.com> (raw)
In-Reply-To: <f0acebb66b9b46ad472e0d0989dc0f5810cac3dd.camel@perches.com>
在 2022/05/19 2:12, Joe Perches 写道:
> On Wed, 2022-05-18 at 20:26 +0800, Yu Kuai wrote:
>> Instead of using the long printk(KERN_ERR "nbd: ...") to
>> output error message, defining pr_fmt and using
>> the short pr_err("") to do that. The replacemen is done
>> by using the following command:
>>
>> sed -i 's/printk(KERN_ERR "nbd: /pr_err("/g' \
>> drivers/block/nbd.c
>
> It's also good to rewrap to 80 columns where possible.
>
>> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> []
>> @@ -2130,13 +2130,13 @@ static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info)
>> nbd = idr_find(&nbd_index_idr, index);
>> if (!nbd) {
>> mutex_unlock(&nbd_index_mutex);
>> - printk(KERN_ERR "nbd: couldn't find device at index %d\n",
>> + pr_err("couldn't find device at index %d\n",
>> index);
>
> like here
>
>> return -EINVAL;
>> }
>> if (!refcount_inc_not_zero(&nbd->refs)) {
>> mutex_unlock(&nbd_index_mutex);
>> - printk(KERN_ERR "nbd: device at index %d is going down\n",
>> + pr_err("device at index %d is going down\n",
>> index);
>
> and here and below...
Hi, Josef
Thanks for your advice, I'll send a new version.
>
>> @@ -2170,7 +2170,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info)
>> nbd = idr_find(&nbd_index_idr, index);
>> if (!nbd) {
>> mutex_unlock(&nbd_index_mutex);
>> - printk(KERN_ERR "nbd: couldn't find a device at index %d\n",
>> + pr_err("couldn't find a device at index %d\n",
>> index);
>> return -EINVAL;
>> }
>> @@ -2192,7 +2192,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info)
>> }
>> if (!refcount_inc_not_zero(&nbd->refs)) {
>> mutex_unlock(&nbd_index_mutex);
>> - printk(KERN_ERR "nbd: device at index %d is going down\n",
>> + pr_err("device at index %d is going down\n",
>> index);
>> return -EINVAL;
>> }
>
>
>
> .
>
prev parent reply other threads:[~2022-05-19 1:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 12:26 [PATCH -next v2 0/6] nbd: bugfix and cleanup patches Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 1/6] nbd: call genl_unregister_family() first in nbd_cleanup() Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 2/6] nbd: fix race between nbd_alloc_config() and module removal Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 3/6] nbd: don't clear 'NBD_CMD_INFLIGHT' flag if request is not completed Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 4/6] nbd: fix io hung while disconnecting device Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 5/6] nbd: fix possible overflow on 'first_minor' in nbd_dev_add() Yu Kuai
2022-05-18 12:26 ` [PATCH -next v2 6/6] nbd: use pr_err to output error message Yu Kuai
2022-05-18 18:12 ` Joe Perches
2022-05-19 1:06 ` yukuai (C) [this message]
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=65fe63ed-91d4-35bd-3e25-39c4457295d0@huawei.com \
--to=yukuai3@huawei.com \
--cc=axboe@kernel.dk \
--cc=joe@perches.com \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=nbd@other.debian.org \
--cc=yi.zhang@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
all inboxes | Powered by JetHome®