Re: [PATCH 1/2] virtio_ring: reject a split ring size that is not a power of two again

From: Stjepan Poljak

Date: Thu Nov 12 2026 - 11:04:30 EST


Hi Francesco,

On Wed, Nov 11, 2026 at 10:51 PM Francesco Valla <francesco@xxxxxxxx> wrote:
>
> This is definitely and error, and should be logged as such (I know, the
> same message is printed as a warn in vring_alloc_queue_split(), but we
> have no ABI to align to here).
>
> Also, consider to adopt a message a bit more descriptive; maybe
> something like this is sufficient:
>
> "Bad virtqueue length %u (not a power of two)\n"
>
> > + return NULL;
> > + }
> > +
> > vring_init(&vring_split.vring, num, pages, vring_align);
> > return __vring_new_virtqueue_split(index, &vring_split, vdev, weak_barriers,
> > context, notify, callback, name,
> >
> > base-commit: 1a577f9402c1780cc1e663f48d5dd54c02051b09
> > --
> > 2.53.0
> >
> >
>
> Thank you!
>
> Regards,
> Francesco
>

Agreed on both, thanks. v2 uses dev_err() with your message:
https://lore.kernel.org/r/20261112154927.4004184-1-stjepan.poljak@xxxxxxxxx

Stjepan