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=-3.8 required=3.0 tests=BAYES_00, 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 A20F8C433DB for ; Sun, 14 Feb 2021 21:25:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6298464E12 for ; Sun, 14 Feb 2021 21:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbhBNVZW (ORCPT ); Sun, 14 Feb 2021 16:25:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhBNVZW (ORCPT ); Sun, 14 Feb 2021 16:25:22 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A6BFC061574 for ; Sun, 14 Feb 2021 13:24:42 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBOsb-00E1Cd-EU; Sun, 14 Feb 2021 21:24:33 +0000 Date: Sun, 14 Feb 2021 21:24:33 +0000 From: Al Viro To: Linus Torvalds Cc: Jens Axboe , "Eric W. Biederman" , linux-fsdevel Subject: Re: [PATCHSET v3 0/4] fs: Support for LOOKUP_NONBLOCK / RESOLVE_NONBLOCK (Insufficiently faking current?) Message-ID: References: <20201214191323.173773-1-axboe@kernel.dk> <94731b5a-a83e-91b5-bc6c-6fd4aaacb704@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sun, Feb 14, 2021 at 12:30:07PM -0800, Linus Torvalds wrote: > On Sun, Feb 14, 2021 at 8:38 AM Jens Axboe wrote: > > > > > Similarly it looks like opening of "/dev/tty" fails to > > > return the tty of the caller but instead fails because > > > io-wq threads don't have a tty. > > > > I've got a patch queued up for 5.12 that clears ->fs and ->files for the > > thread if not explicitly inherited, and I'm working on similarly > > proactively catching these cases that could potentially be problematic. > > Well, the /dev/tty case still needs fixing somehow. > > Opening /dev/tty actually depends on current->signal, and if it is > NULL it will fall back on the first VT console instead (I think). > > I wonder if it should do the same thing /proc/self does.. I still think that entire "offload pathname resolution to helper threads" thing is bollocks. ->fs, ->files and ->signal is still nowhere near enough - look at /proc/net, for example. Or netns-sensitive parts of sysfs, for that matter... And that's not going into really weird crap where opener is very special and assumed to be doing all IO.