From: minwoo.im.dev@gmail.com (Minwoo Im)
Subject: Potential bug in queue_count_set
Date: Wed, 10 Apr 2019 23:11:34 +0900 [thread overview]
Message-ID: <d945096a-14d8-6d9f-187f-39501dfdb600@gmail.com> (raw)
In-Reply-To: <b62dde65-1abf-1391-9de6-9bcdf6a7fa07@gmail.com>
On 4/10/19 10:33 PM, Maximilian Luz wrote:
> Hi all,
>
> I just stumbled (more or less randomly) over this piece of code
> (/drivers/nvme/host/pci.c, v5.1-rc4):
>
> 147: static int queue_count_set(const char *val, const struct
> kernel_param *kp)
> 148: {
> 149:???? int n = 0, ret;
> 150:
> 151:???? ret = kstrtoint(val, 10, &n);
> 152:???? if (ret)
> 153:???????? return ret;
> 154:???? if (n > num_possible_cpus())
> 155:???????? n = num_possible_cpus();
> 156:
> 157:???? return param_set_int(val, kp);
> 158: }
>
> Link with context:
> https://github.com/torvalds/linux/blob/v5.1-rc4/drivers/nvme/host/pci.c#L154-L155
>
>
> 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.
> Maximilian
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2019-04-10 14:11 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 [this message]
2019-04-11 16:02 ` Minwoo Im
2019-04-11 17:39 ` Maximilian Luz
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=d945096a-14d8-6d9f-187f-39501dfdb600@gmail.com \
--to=minwoo.im.dev@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.