Linux block layer
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "Elliott, Robert (Persistent Memory)" <elliott@hpe.com>
Cc: "markus@trippelsdorf.de" <markus@trippelsdorf.de>,
	Bart Van Assche <Bart.VanAssche@sandisk.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] block: Remove leading whitespace and trailing newline in elevator switch error message
Date: Mon, 8 May 2017 20:22:15 -0600	[thread overview]
Message-ID: <27B041E0-D0FD-4072-ADAA-B36EDC8D09C0@kernel.dk> (raw)
In-Reply-To: <TU4PR84MB03040339EFF3AB676CBD1382ABEF0@TU4PR84MB0304.NAMPRD84.PROD.OUTLOOK.COM>


> On May 8, 2017, at 8:18 PM, Elliott, Robert (Persistent Memory) <elliott@h=
pe.com> wrote:
>=20
>=20
>=20
>> -----Original Message-----
>> From: linux-block-owner@vger.kernel.org [mailto:linux-block-
>> owner@vger.kernel.org] On Behalf Of markus@trippelsdorf.de
>> Sent: Saturday, May 06, 2017 12:23 AM
>> To: Bart Van Assche <Bart.VanAssche@sandisk.com>
>> Cc: linux-block@vger.kernel.org; axboe@kernel.dk
>> Subject: [PATCH] block: Remove leading whitespace and trailing
>> newline in elevator switch error message
>>=20
>>=20
>> Trying to switch to a non-existing elevator currently results in
>> garbled
>> dmesg output, e.g.:
>>=20
>> # echo "  foo" > /sys/block/sda/queue/scheduler
>>=20
>> elevator: type   foo not found
>> elevator: switch to   foo
>> failed
> ...
>> @@ -1063,15 +1062,14 @@ static int __elevator_change(struct
>> request_queue *q, const char *name)
>>    if (q->mq_ops && !strncmp(name, "none", 4))
>>        return elevator_switch(q, NULL);
>>=20
>> -    strlcpy(elevator_name, name, sizeof(elevator_name));
>> -    e =3D elevator_get(strstrip(elevator_name), true);
>> +    e =3D elevator_get(name, true);
>>    if (!e) {
>> -        printk(KERN_ERR "elevator: type %s not found\n",
>> elevator_name);
>> +        printk(KERN_ERR "elevator: type %s not found\n", name);
>>        return -EINVAL;
>>    }
> ...
>> @@ -1112,16 +1110,19 @@ static inline bool elv_support_iosched(struct
>> request_queue *q)
>> ssize_t elv_iosched_store(struct request_queue *q, const char *name,
>>              size_t count)
>> {
> ...
>> +    strlcpy(elevator_name, skip_spaces(name),
>> sizeof(elevator_name));
>> +    strstrip(elevator_name);
>> +    ret =3D __elevator_change(q, elevator_name);
>>    if (!ret)
>>        return count;
>>=20
>> -    printk(KERN_ERR "elevator: switch to %s failed\n", name);
>> +    printk(KERN_ERR "elevator: switch to %s failed\n",
>> elevator_name);
>>    return ret;
>> }
>=20
> That leaves two lines of error prints for a single error, and
> the second line doesn't convey additional information.

Yeah good point. Honestly I think we should just kill both lines. None of th=
em add value.=20

  reply	other threads:[~2017-05-09  2:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-06  5:22 [PATCH] block: Remove leading whitespace and trailing newline in elevator switch error message markus
2017-05-08 15:47 ` Bart Van Assche
2017-05-08 16:48   ` markus
2017-05-08 16:52     ` Bart Van Assche
2017-05-08 16:53 ` Jens Axboe
2017-05-09  2:18 ` Elliott, Robert (Persistent Memory)
2017-05-09  2:22   ` Jens Axboe [this message]
2017-05-09  4:42     ` markus
2017-05-09 14:57       ` 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=27B041E0-D0FD-4072-ADAA-B36EDC8D09C0@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=Bart.VanAssche@sandisk.com \
    --cc=elliott@hpe.com \
    --cc=linux-block@vger.kernel.org \
    --cc=markus@trippelsdorf.de \
    /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