public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniele Di Proietto <daniele.di.proietto@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: io-uring@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] io_uring: Add IORING_OP_DUP
Date: Tue, 10 Mar 2026 18:42:42 +0000	[thread overview]
Message-ID: <CAExiqTJg3on8e33E0jnAWhsewwNzPrVohRmdOjAEvFrArLcBPA@mail.gmail.com> (raw)
In-Reply-To: <abBDc589oZdfR_aD@kbusch-mbp>

On Tue, Mar 10, 2026 at 4:14 PM Keith Busch <kbusch@kernel.org> wrote:
>
> On Tue, Mar 10, 2026 at 03:49:33PM +0000, Daniele Di Proietto wrote:
> > +int io_dup(struct io_kiocb *req, unsigned int issue_flags)
> > +{
> > +     struct io_dup *id;
> > +     int ret;
> > +
> > +     id = io_kiocb_to_cmd(req, struct io_dup);
> > +     ret = replace_fd(id->new_fd, id->file, id->o_flags);
>
> It looks like there are a few conditions where replace_fd may block,
> so it may be a problem to call it from the uring enter context since it
> will block progress through the sq ring for subsequent commands.

You're right, thanks!

I can punt the request to io-wq if the file to be closed has a
->flush() method, as asked by Jens.

Any other conditions you're worried about? expand_files() might block
if another thread is trying to expand the file table concurrently, but
io_install_fixed_fd() has the same problem, right?

  reply	other threads:[~2026-03-10 18:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 15:49 [PATCH] io_uring: Add IORING_OP_DUP Daniele Di Proietto
2026-03-10 16:14 ` Keith Busch
2026-03-10 18:42   ` Daniele Di Proietto [this message]
2026-03-10 16:24 ` Jens Axboe
2026-03-10 18:42   ` Daniele Di Proietto

Reply instructions:

You may reply publicly 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=CAExiqTJg3on8e33E0jnAWhsewwNzPrVohRmdOjAEvFrArLcBPA@mail.gmail.com \
    --to=daniele.di.proietto@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=kbusch@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox