IO-Uring Archive on lore.kernel.org
 help / color / Atom feed
From: Stefan Metzmacher <metze@samba.org>
To: Jens Axboe <axboe@kernel.dk>, io-uring <io-uring@vger.kernel.org>
Cc: 李通洲 <carter.li@eoitek.com>
Subject: Re: [PATCH] io_uring: add support for probing opcodes
Date: Thu, 16 Jan 2020 23:35:28 +0100
Message-ID: <3c9dacf6-05a9-5561-dd8e-59a26e3e2916@samba.org> (raw)
In-Reply-To: <e02f00e0-e2fb-7060-13fe-c6bd0f2a5e6a@kernel.dk>

[-- Attachment #1.1: Type: text/plain, Size: 1312 bytes --]

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



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 17:23 Jens Axboe
2020-01-16 22:35 ` Stefan Metzmacher [this message]
2020-01-16 22:36   ` Jens Axboe

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c9dacf6-05a9-5561-dd8e-59a26e3e2916@samba.org \
    --to=metze@samba.org \
    --cc=axboe@kernel.dk \
    --cc=carter.li@eoitek.com \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

IO-Uring Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/io-uring/0 io-uring/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 io-uring io-uring/ https://lore.kernel.org/io-uring \
		io-uring@vger.kernel.org
	public-inbox-index io-uring

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.io-uring


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git