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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 513E5C2D0E4 for ; Sat, 21 Nov 2020 00:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F07BA22470 for ; Sat, 21 Nov 2020 00:24:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="B2nnATiv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727773AbgKUAYB (ORCPT ); Fri, 20 Nov 2020 19:24:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbgKUAYB (ORCPT ); Fri, 20 Nov 2020 19:24:01 -0500 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAD8BC0613CF for ; Fri, 20 Nov 2020 16:24:00 -0800 (PST) Received: by mail-lj1-x241.google.com with SMTP id l10so11884207lji.4 for ; Fri, 20 Nov 2020 16:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PZbEJojvKRknfau35lFY33ra5qqumn9V5o3ENFtZUe8=; b=B2nnATivx9RG57+BY/dVu2VycMvpNW2OA23BZ3K/IBs/qRBUJWWY/LlZ0PV4Ygt8pv lg5SsoVIcMXj1KdAKQxPpQGzF/jjNe46t+1L/2Of2biqgFm0SJiX+gBKlrdXIAdmLhzr uhnB5KEZs0y3fzqgIk0CeZhR6FZ5ISmRHnVF4= 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=PZbEJojvKRknfau35lFY33ra5qqumn9V5o3ENFtZUe8=; b=JDf94aVAzl636/8oFvCA02qllwSI+8nqNrqqcxTpLbvpd/w5I0HlGYoqIyMTp30anA v7YePLkC3yU4+i6fsD5h2VffEJcs5i3uMNE54V6m+fm/tZ58eMWCMVnIfGfJGrUVeQS6 gPTvQ9AVrWFb3XlYkeY6BcqO3zI9bvbbbU2EmWhHg0fW+a4ieTiq+U+Va+tw7DXVMIwM DoScs8eb5/C+wycb+FbN8yscDPsyl0/W6CTPXbeEFk6NtywVCk02vYYdDjhKT6pqsfvv dx2kglfWG6Nn4R8qXg+1HoEjY7zz4eRPJs5YGzqye/xmnCmJFILtwRy6F5zvHy+30Rqx L5qg== X-Gm-Message-State: AOAM533SVQBtcZ/zbz5Mml0TtqzDsREbvkOvDR0JEM4sQdBn7O5amtIg hMVzqU8Vcj0beimwtzD9W3dSNpww4lmI9Q== X-Google-Smtp-Source: ABdhPJybvTn8l4DTOAni9eHucloHWzOjTFT5owDBwoQi8C/6eb9qO+W0BpNc4iUyrkAUSzxtiPnXWQ== X-Received: by 2002:a05:651c:1105:: with SMTP id d5mr9808844ljo.265.1605918238735; Fri, 20 Nov 2020 16:23:58 -0800 (PST) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id t22sm525016lfb.180.2020.11.20.16.23.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Nov 2020 16:23:57 -0800 (PST) Received: by mail-lf1-f47.google.com with SMTP id l11so15982759lfg.0 for ; Fri, 20 Nov 2020 16:23:57 -0800 (PST) X-Received: by 2002:a19:ed0f:: with SMTP id y15mr8113080lfy.352.1605918237133; Fri, 20 Nov 2020 16:23:57 -0800 (PST) MIME-Version: 1.0 References: <6535286b-2532-dc86-3c6e-1b1e9bce358f@kernel.dk> <4bcf3012-a4ad-ac2d-e70b-17f17441eea9@kernel.dk> In-Reply-To: <4bcf3012-a4ad-ac2d-e70b-17f17441eea9@kernel.dk> From: Linus Torvalds Date: Fri, 20 Nov 2020 16:23:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] io_uring fixes for 5.10-rc To: Jens Axboe , Al Viro Cc: io-uring , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Fri, Nov 20, 2020 at 1:36 PM Jens Axboe wrote: > > I don't disagree with you on that. I've been a bit gun shy on touching > the VFS side of things, but this one isn't too bad. I hacked up a patch > that allows io_uring to do LOOKUP_RCU and a quick test seems to indicate > it's fine. On top of that, we just propagate the error if we do fail and > get rid of that odd retry loop. Ok, this looks better to me (but is obviously not 5.10 material). That said, I think I'd prefer to keep 'struct nameidata' internal to just fs/namei.c, and maybe we can just expert that struct nameidata nd; set_nameidata(&nd, req->open.dfd, req->open.filename); file = path_openat(&nd, &op, op.lookup_flags | LOOKUP_RCU); restore_nameidata(); return filp == ERR_PTR(-ECHILD) ? -EAGAIN : filp; as a helper from namei.c instead? Call it "do_filp_open_rcu()" or something? That "force_nonblock" test seems a bit off, though. Why is that RCU case only done when "!force_nonblock"? It would seem that if force_nonblock is set, you want to do this too? Al? You can see the background on lkml, but basically io_uring wants to punt file open to a kernel thread, except if it can just be done directly without blocking (which is pretty much that RCU lookup case). And the thing that triggered this is that /proc/self/ can only be done directly - not in a kernel thread. So the RCU case actually ends up being interesting in that it would handl those things. Linus