From: luzmaximilian@gmail.com (Maximilian Luz)
Subject: Potential bug in queue_count_set
Date: Thu, 11 Apr 2019 19:39:43 +0200 [thread overview]
Message-ID: <236178b1-7c56-1627-eed5-26706c60f71f@gmail.com> (raw)
In-Reply-To: <b0d01a14-f80c-30f2-b190-d0bbe8eb6005@gmail.com>
>>>
>>> It looks like lines 154, 155 don't achieve anything as `n` is not being
>>> used afterwards. Sorry if this is already known or a non-issue, just
>>> wanted to let you guys know.
>>>
>>
>> It looks like module parameter "write_queues" is set to the actual given
>> value (val) without considering reduced number of queues in case given
>> value is greater than nr_cpus.
>>
>> I think that might need sprintf() or something like this to make the
>> actual value reduced in that case.
>
>
> Sorry, the "val" is const so that we cannot go through it with sprintf().
> My bad. This function might return an error if invalid number is given.
>
> Sorry for the confusion.
>
> Have posted patches for it.
> http://lists.infradead.org/pipermail/linux-nvme/2019-April/023369.html
I honestly know too little about module-parameters to give a qualified
answer here, but could returning -EINVAL here break things?
From what I can tell it should be possible to bypass the param_set_int
function and set *(kp->arg) directly, which would reproduce the
param_set_int functionality (kernel/params.c:223).
Alternatively one could argue that after a successful kstrtoint call, we
can strncpy the input into a buffer with fixed length of 11 (10 digits +
null, if I'm not mistaken) and use that as input for param_set_int.
next prev parent reply other threads:[~2019-04-11 17:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-10 13:33 Potential bug in queue_count_set Maximilian Luz
2019-04-10 14:11 ` Minwoo Im
2019-04-11 16:02 ` Minwoo Im
2019-04-11 17:39 ` Maximilian Luz [this message]
2019-04-11 21:15 ` Minwoo Im
2019-04-12 20:59 ` Maximilian Luz
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=236178b1-7c56-1627-eed5-26706c60f71f@gmail.com \
--to=luzmaximilian@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.