Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3012279ybz; Sun, 19 Apr 2020 15:24:45 -0700 (PDT) X-Google-Smtp-Source: APiQypLBdp6XoH7gPR1BASPEVbrqG5zZjGSQ29caawwzOX98CSe/A463shVg5QwdK9na9HzgFTM/ X-Received: by 2002:a17:907:9484:: with SMTP id dm4mr13575045ejc.240.1587335085182; Sun, 19 Apr 2020 15:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587335085; cv=none; d=google.com; s=arc-20160816; b=xukrw2w+gx/QOmMN5ecOOdlS9cAunYim36EfixsOtwX4RyR2Q4w92FYVQs/LTkdvyq 90SdWAtOTPBxIjkOxqwZ1DpQPhjKGOS/Pz2nZiY0EPksEcqlnFy7Tfvy36nprZrf205M XT080bhwsajUt5tbHdBfHC3FCWYCD/T7bk5JPWkz6AvwxwDzw4gTe0X/aulh33GifNk0 Hs/1rsr2WQH4meWmxoQhO5Wwd7o7BynbNII3hAkpe6bdCNYqwVbzffj66vrieqhYfJ5D LMaUp9dErwUeeMGd4j9kQe/sklL6zu9DZEnHyb2tFbQ9dmIB2U2mm1ZPjgMv4hEXBvD0 KlFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=WZGGvjnGunABiy25qrhz6ksRUn1sXB4cu8ILhBoEIw4=; b=msszIO4LlTG/wNF91XoKcgcCTZmAujm0G2NVg0HP/FqvT5wxGRpHofVULKh+6yA6oh gGlRj9jvclpBt9cTtzQSaV4u8MATH1pY5zI2TG6I1geyCKhItEIrnhRId6P8zgWOwHBo 1J7s3yYcTLO5DaEPWKvmov+CgGMi1sZEKyHJvDmq25iV6YtlrhdCrGqzswzRbUDFz24N 5SXLe3W6gN/1lFReTVn7kr2RwH+2iFwELzuuB3gI9dawWeHcyvy3yZTKA6Rl1dgteyTv vvdKO4ip1lG96nW+YRYOUnLeshPMwUMAKFTrg1ipGNAzR7VUIikJRZvNpMgl7Zq4tOq3 tusw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=q361Dw3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o21si4562617edz.159.2020.04.19.15.24.22; Sun, 19 Apr 2020 15:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=q361Dw3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725953AbgDSWW5 (ORCPT + 99 others); Sun, 19 Apr 2020 18:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725891AbgDSWW4 (ORCPT ); Sun, 19 Apr 2020 18:22:56 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73462C061A0F for ; Sun, 19 Apr 2020 15:22:56 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id w3so3215696plz.5 for ; Sun, 19 Apr 2020 15:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WZGGvjnGunABiy25qrhz6ksRUn1sXB4cu8ILhBoEIw4=; b=q361Dw3uF5Qr1t4y5v+dPldxAaxHS8ShKiBGG9s7RVfzTEnTG5VLizSByAFZb1rMpb ayBMS4rffRqTEtTGq2GcohUU29nxm4JKb9Jy5YuH4M4v07exxqLF3Ya15BzgFws3bGTa cWV1MEg+VFSJUKMHu8BHH6cyJOvBubkmQ2UaSzQFLXCfiapBdMcZb2j7MlepzaTnhlnI ROEhJvJXGkqhZ/AjMcEbWz+7k/7F4jFOuj8/yE7edpR+U1yixc08d+SqPbFZtY3Xs4sK dsxKekAYVfOXOuF/pdJghZiesUM7RdHfCFYAb1u+pcI/CUtsrY5VVycGGZnrYTGI00Re oUqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WZGGvjnGunABiy25qrhz6ksRUn1sXB4cu8ILhBoEIw4=; b=QbLW57At2/soeOc7EVaTJWJIqqUmQigSyl+LxpvS9lqtUFkN9GP/6qpC8c9xcNfBUf G8bxltwHzXWajK9qO0WP3zvjwHFpWMvi8cTwk9YXgAI1YxK0Vcq3+Y8uEsyY41rm7bXL 81WYS9xyrv3Phk7NvTnval9dOfErZp66+8EoIEbOl85U/Ot/j4PKIlMNQh1k3MljcL4D Jxmz/QC3C7ioXiAdoeOhyGKqgoDJTvgP5ww8iAN9Vyt9vRFKjWfccZYXC1lOaifrD4ka mzVughz7NAmXzvr/oKIFowai47vENixS5QxPBH3Xyzm8W4KkS8PkiqwtgUZJVb/BRUTe lQsQ== X-Gm-Message-State: AGi0PuZvsOxy4mli6e5TNZgD+T+Fa9C5mT6Qpnk5weUJbD9beiN0Mslg d1btCtSKhQuDep5qXQfB0SL9XQ== X-Received: by 2002:a17:90a:8d0f:: with SMTP id c15mr16391639pjo.100.1587334975940; Sun, 19 Apr 2020 15:22:55 -0700 (PDT) Received: from [192.168.1.188] ([66.219.217.145]) by smtp.gmail.com with ESMTPSA id e66sm21780994pfa.69.2020.04.19.15.22.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Apr 2020 15:22:55 -0700 (PDT) Subject: Re: [PATCH v4 2/3] fs: openat2: Extend open_how to allow userspace-selected fds To: Aleksa Sarai , Josh Triplett Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, linux-arch@vger.kernel.org, Alexander Viro , Arnd Bergmann References: <20200419104404.j4e5gxdn2duvmu6s@yavin.dot.cyphar.com> From: Jens Axboe Message-ID: Date: Sun, 19 Apr 2020 16:22:52 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200419104404.j4e5gxdn2duvmu6s@yavin.dot.cyphar.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/19/20 4:44 AM, Aleksa Sarai wrote: > On 2020-04-13, 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. > > I'm not sure I understand this explanation -- how can you trigger a > syscall with an fd that hasn't yet been registered (unless you're just > hoping the race goes in your favour)? io_uring can do chains of requests, where each link in the chain isn't started until the previous one has completed. Hence if you know what fd that openat2 will return, you can submit a chain ala: as a single submission. This isn't possible to do currently, as the read will depend on the output of the open, and we have no good way of knowing what that fd will be. -- Jens Axboe