From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F185C55189 for ; Wed, 22 Apr 2020 07:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78CB92070B for ; Wed, 22 Apr 2020 07:56:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="bq86XvJQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726078AbgDVH4K (ORCPT ); Wed, 22 Apr 2020 03:56:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725810AbgDVH4J (ORCPT ); Wed, 22 Apr 2020 03:56:09 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48B94C03C1A6 for ; Wed, 22 Apr 2020 00:56:09 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id f12so778803edn.12 for ; Wed, 22 Apr 2020 00:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z1biaZy6y7PqsHY/+KktbP6zQiSCk/Tgyi9hv1rSztM=; b=bq86XvJQnxv50SBPGcKLs3Fr8gh99Hv1Y4lzJCnHBgVuYJVbw6RrjrVKfGtFku6EZG kO4dXzupMYLoia0Lmt+RHfv1Xuu9JA4Y2Vmd3a8UrJgbKKxBUsTKJGojbSu5aJgfhEmo 5EM4zr0i3Guzu9oLNTActfb698GxdY2nsEaBs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z1biaZy6y7PqsHY/+KktbP6zQiSCk/Tgyi9hv1rSztM=; b=CxzCWE8s+JMNbaIhfBE+QjWgz09OMJfl9ApYvgT2+LBy074PCPDAp7DMmGsiG+r3mt oahhhZwtvaw977WJJQgpsFSGwLBwq1VRLQtl3vxbmw9kz4polL6Fl2CI3nMNE9I1GXpM FYUUmoeVERMISYL3Rw9+LMaWfFw6SjP01xyt5wexIwG4wmu8H037c1Yi8HqvBVbt82CQ MPqvcg3lup2eefNkPk3vjNSmzswDyzRYnVlMC1HNC6gf7jrnoDs++WonQ2R4tykAfJt0 niuC5S9x2ysb7vHZyMUggWEWTREgwpGa0ufkd/iU93MDBP6sPHKOI9UnaiYsVSmfw3Mo SNnQ== X-Gm-Message-State: AGi0PuYyGotxf6ixPieJtvSRDeKB8/4VLqXI/1baIh55UuXnCHsuAZRx XQ7GWzGPtsrp3WJ1pU/93+Fivl/hcm/uxzZSKq08qw== X-Google-Smtp-Source: APiQypK9NkZBpfIRxtVZgJkwWgqgZC5WwR3a2fRu7Zp4jUgGSYA2Xwz4zVEf0igsy8uL0etsgNy6Z5nE2u7gSECiDNk= X-Received: by 2002:a05:6402:22ed:: with SMTP id dn13mr21651703edb.212.1587542168000; Wed, 22 Apr 2020 00:56:08 -0700 (PDT) MIME-Version: 1.0 References: <9873b8bd7d14ff8cd2a5782b434b39f076679eeb.1587531463.git.josh@joshtriplett.org> In-Reply-To: From: Miklos Szeredi Date: Wed, 22 Apr 2020 09:55:56 +0200 Message-ID: Subject: Re: [PATCH v5 2/3] fs: openat2: Extend open_how to allow userspace-selected fds To: Michael Kerrisk Cc: Josh Triplett , io-uring@vger.kernel.org, "linux-fsdevel@vger.kernel.org" , lkml , Alexander Viro , Arnd Bergmann , Jens Axboe , Aleksa Sarai , linux-man , Linux API Content-Type: text/plain; charset="UTF-8" Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Wed, Apr 22, 2020 at 8:06 AM Michael Kerrisk (man-pages) wrote: > > [CC += linux-api] > > On Wed, 22 Apr 2020 at 07:20, Josh Triplett wrote: > > > > Inspired by the X protocol's handling of XIDs, allow userspace to select > > the file descriptor opened by openat2, so that it can use the resulting > > file descriptor in subsequent system calls without waiting for the > > response to openat2. > > > > In io_uring, this allows sequences like openat2/read/close without > > waiting for the openat2 to complete. Multiple such sequences can > > overlap, as long as each uses a distinct file descriptor. If this is primarily an io_uring feature, then why burden the normal openat2 API with this? Add this flag to the io_uring API, by all means. This would also allow Implementing a private fd table for io_uring. I.e. add a flag interpreted by file ops (IORING_PRIVATE_FD), including openat2 and freely use the private fd space without having to worry about interactions with other parts of the system. Thanks, Miklos