Am 16.01.20 um 18:23 schrieb Jens Axboe: > The application currently has no way of knowing if a given opcode is > supported or not without having to try and issue one and see if we get > -EINVAL or not. And even this approach is fraught with peril, as maybe > we're getting -EINVAL due to some fields being missing, or maybe it's > just not that easy to issue that particular command without doing some > other leg work in terms of setup first. > > This adds IORING_REGISTER_PROBE, which fills in a structure with info > on what it supported or not. This will work even with sparse opcode > fields, which may happen in the future or even today if someone > backports specific features to older kernels. That's funny I was just thinking about exactly that topic before I opened the io-uring mail folder:-) That's will make it much easier to write a portable vfs backend for samba that doesn't depend on the kernel features at build time. > + p->last_op = IORING_OP_LAST - 1; > + /* stock kernel isn't sparse, so everything is supported */ > + for (i = 0; i < nr_args; i++) { > + p->ops[i].op = i; Shouldn't there be an if (i <= p->last_op) before we pretent to support an opcode? Or we need to truncate nr_args > + p->ops[i].flags = IO_URING_OP_SUPPORTED; > + } metze