io_uring_setup: fixing cqentries setup bug.

We should compare against maximum number of allowed cq entries instead of
comparing against the flag that allows to set that number.

PiperOrigin-RevId: 487045476
This commit is contained in:
Sergey Madaminov
2022-11-08 14:05:14 -08:00
committed by gVisor bot
parent 21b9d59950
commit a1476ce4f5
+1 -1
View File
@@ -94,7 +94,7 @@ func New(ctx context.Context, vfsObj *vfs.VirtualFilesystem, entries uint32, par
if params.Flags&linux.IORING_SETUP_CQSIZE != 0 {
var ok bool
numCqEntries, ok = roundUpPowerOfTwo(params.CqEntries)
if !ok || numCqEntries < numSqEntries || numCqEntries > linux.IORING_SETUP_CQSIZE {
if !ok || numCqEntries < numSqEntries || numCqEntries > linux.IORING_MAX_CQ_ENTRIES {
return nil, linuxerr.EINVAL
}
} else {