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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C3B4C6FA82 for ; Wed, 21 Sep 2022 19:52:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbiIUTwh (ORCPT ); Wed, 21 Sep 2022 15:52:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbiIUTwg (ORCPT ); Wed, 21 Sep 2022 15:52:36 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76AA98E988 for ; Wed, 21 Sep 2022 12:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6jr+vdnR63/qL3CIhK6TlCBWVUm2LV2xKUhkrLggM+w=; b=D5ShjQt1TZkG9V/9bXYIo5nod8 ug5PkOiutl6QN8aMVAxH/JyXTbjyjHYxB58tA67Kv3sxGjGqBqEInTAUxWXusF3fohz8f1cZvlKAX Jyl1IPhrslJb5yMZzJUwzXcpIW1p+WSveTZx+9o7la5QN8bqEheWhTWmN1fCBmPqkyE6sJpsQMSmS 9tt3AFOfKh1zTqAm+z2PYpyKIGSNjgafwaKdPT92G/61Z4rNuTwoDEGaH3smZxSH4fBZyuubf184J ZnR7asDboNEOaB+N/dsPtGPiftloVONvc+C4F7NUB4GzPLMRdDYzVBbWtybNYQE4b9kbMRuq5YsXy 91CuaAdw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1ob5lm-002Acl-0Q; Wed, 21 Sep 2022 19:52:30 +0000 Date: Wed, 21 Sep 2022 20:52:30 +0100 From: Al Viro To: Christian Brauner Cc: Miklos Szeredi , Miklos Szeredi , linux-fsdevel@vger.kernel.org, Amir Goldstein , David Howells , Yu-li Lin , Chirantan Ekbote Subject: Re: [PATCH v3 8/9] vfs: open inside ->tmpfile() Message-ID: References: <20220920193632.2215598-1-mszeredi@redhat.com> <20220920193632.2215598-9-mszeredi@redhat.com> <20220921090820.woijqimkphaf3qll@wittgenstein> <20220921150750.grruzm3copwproyu@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220921150750.grruzm3copwproyu@wittgenstein> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Sep 21, 2022 at 05:07:50PM +0200, Christian Brauner wrote: > > I don't think file_dentry() should be used for this. > > > > file_dentry() is basically a hack for overlayfs's "fake path" thing. > > It should only be used where strictly necessary. At one point it > > would be good to look again at cleaning this mess up. > > Yeah, that's what I was getting at. The file_dentry() helper would > ideally just be as simple as file_inode() and then we'd have > file_dentry_real() for the stacking filesystem scenarios. I would rather minimize the number of places where we access file->f_path.dentry in the first place. Any of those is asking for confusion and overlayfs-triggered bugs. A helper for that would invite bugs where it gets used in places of file_dentry() and vice versa; sure, the same bugs are possible for open-coded variants (and we had such bugs), but I would rather have fewer places doing that to start with (don't get me started on the debugfs design. Please.)