Re: [PATCH] virtio: Honour 'may_reduce_num' in vring_create_virtqueue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon,  8 Apr 2019 14:33:22 +0200
Cornelia Huck <cohuck@xxxxxxxxxx> wrote:

> vring_create_virtqueue() allows the caller to specify via the
> may_reduce_num parameter whether the vring code is allowed to
> allocate a smaller ring than specified.
> 
> However, the split ring allocation code tries to allocate a
> smaller ring on allocation failure regardless of what the
> caller specified. This may cause trouble for e.g. virtio-pci
> in legacy mode, which does not support ring resizing. (The
> packed ring code does not resize in any case.)
> 
> Let's fix this by bailing out immediately in the split ring code
> if the requested size cannot be allocated and may_reduce_num has
> not been specified.
> 
> While at it, fix a typo in the usage instructions.
> 
> Fixes: 2a2d1382fe9d ("virtio: Add improved queue allocation API")
> Cc: stable@xxxxxxxxxxxxxxx # v4.6+
> Signed-off-by: Cornelia Huck <cohuck@xxxxxxxxxx>

Reviewed-by: Halil Pasic <pasic@xxxxxxxxxxxxx>




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux