On Sun, May 28, 2017 at 04:06:49PM +0300, Dan Aloni wrote: > The number of queues that should be return by the admin command should: > > 1) Only mention the number of non-admin queues. > 2) It is zero-based, meaning that '0 == one non-admin queue', > '1 == two non-admin queues', and so forth. > > Because our `num_queues` means the number of queues _plus_ the admin > queue, then the right calculation for the number returned from the admin > command is `num_queues - 2`, combining the two requirements mentioned. > > The issue was discovered by reducing num_queues from 64 to 8 and running > a Linux VM with an SMP parameter larger than that (e.g. 22). It tries to > utilize all queues, and therefore fails with an invalid queue number > when trying to queue I/Os on the last queue. > > Signed-off-by: Dan Aloni <d...@kernelim.com> > CC: Alex Friedman <a...@e8storage.com> > CC: Keith Busch <keith.bu...@intel.com> > CC: Stefan Hajnoczi <stefa...@redhat.com>
Looks good, thanks for the fix. Reviewed-by: Keith Busch <keith.bu...@intel.com>