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.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 9E2F7C55186 for ; Thu, 23 Apr 2020 08:06:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7740E21569 for ; Thu, 23 Apr 2020 08:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726322AbgDWIGx (ORCPT ); Thu, 23 Apr 2020 04:06:53 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:52927 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbgDWIGx (ORCPT ); Thu, 23 Apr 2020 04:06:53 -0400 X-Originating-IP: 50.39.163.217 Received: from localhost (50-39-163-217.bvtn.or.frontiernet.net [50.39.163.217]) (Authenticated sender: josh@joshtriplett.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 97775C000C; Thu, 23 Apr 2020 08:06:46 +0000 (UTC) Date: Thu, 23 Apr 2020 01:06:44 -0700 From: Josh Triplett To: Miklos Szeredi Cc: Michael Kerrisk , io-uring@vger.kernel.org, "linux-fsdevel@vger.kernel.org" , lkml , Alexander Viro , Arnd Bergmann , Jens Axboe , Aleksa Sarai , linux-man , Linux API Subject: Re: [PATCH v5 2/3] fs: openat2: Extend open_how to allow userspace-selected fds Message-ID: <20200423080644.GA171696@localhost> References: <9873b8bd7d14ff8cd2a5782b434b39f076679eeb.1587531463.git.josh@joshtriplett.org> <20200423004807.GC161058@localhost> <20200423044226.GH161058@localhost> <20200423073310.GA169998@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Thu, Apr 23, 2020 at 09:45:45AM +0200, Miklos Szeredi wrote: > On Thu, Apr 23, 2020 at 9:33 AM Josh Triplett wrote: > > > What are the plans for those syscalls that don't easily lend > > > themselves to this modification (such as accept(2))? > > > > accept4 has a flags argument with more flags available, so it'd be > > entirely possible to cleanly extend it further without introducing a new > > version. > > Variable argument syscalls, you are thinking? That or repurposing an existing pointer-sized argument as an open_how-style struct, yes. But in any case, I'm not proposing that; I'm proposing changes to the existing highly extensible openat2 syscall. > > > I mean, you could open the file descriptor outside of io_uring in such > > > cases, no? > > > > I would prefer to not introduce that limitation in the first place, and > > instead open normal file descriptors. > > > > > The point of O_SPECIFIC_FD is to be able to perform short > > > sequences of open/dosomething/close without having to block and having > > > to issue separate syscalls. > > > > "close" is not a required component. It's entirely possible to use > > io_uring to open a file descriptor, do various things with it, and then > > leave it open for subsequent usage via either other io_uring chains or > > standalone syscalls. > > If this use case arraises, This wasn't a hypothetical "someone might want this". I'm stating that this is a requirement I'm seeking to meet with this patch series, and one I intend to use. The primary use case is interoperability with other code using file descriptors and not using io_uring.