Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2599772rdh; Wed, 27 Sep 2023 07:23:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHq+1tJNF5bCLs8b9lWg2U1DwUVadBzRwT6qeHCvouPYlNuRiQHdPdW1TjQ3UbB7yB8h3nO X-Received: by 2002:a05:6a00:139d:b0:692:780a:de89 with SMTP id t29-20020a056a00139d00b00692780ade89mr2612267pfg.33.1695824583144; Wed, 27 Sep 2023 07:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695824583; cv=none; d=google.com; s=arc-20160816; b=WtWIpourc2GbIzX7O8nnl46VuotpR+fEw7eB+QoL0WHk8n7SnXkGMpy2evDrL0pdoC fAA6aYu6M0TtAnS+BZdD9FUDh43PeCSJRW87IRkksnx31kb8cedb5OrO7eeERyD2yRgL GEMRBzBA3hA8jkaxr5lGcxDtaaGo+erIidiLRFDZqyoQRqsUKE5bWQl6RpuI5WFHkkuJ 8XSRNW8/+MRZwRwGAtUg/1b+QSOSllS7wE9NptjwZyP4yqUqVa0keyTpLEJbJYA9voh9 2C6HgiKdA0Y5aOYvpkhK8YczK/VVwO14eYJCj4OP3Db8A1vK2ZH2Law9LIbH+1eF7qjp HuCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9+omAMOSgipwvx8H3MoAWrDsFCQNOIaZlnkvH12Nm6k=; fh=TiLRUgANl81aWppYr2hfWw9Hsi7JqpmtAKQmkWIImwU=; b=g8eZ5DN0bQre8dD/MW2AVCFo0p+hcyNUe0LGbN1RPVfMXS9koC5IDoxEKge+PRW5I0 pzIe/rYeyrO3pUHCXD0wa7jZlBBUY7Fbuk9LzceDWLjty189+YICoGo9/nwpBs2Y8WUS 64HqBufrMuAlZB6IxI6wH4YM9nPLRu5cvRsSl+Z7GgqizzkR3njpp6qf78VOH1aetYaN r9eewjyVn3yChSb5XDvdH3bknekKzm2haDDMXcZYKRFCsswi3kdOgkMXAhF++3KFJSSq yAtRf5F8qHOUFlRr8k5C6plOgZaSPuGpH5pIEJIcRKjekhhjB7djXUFVNT+DOZIFQCwa +6mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FZ+BocS0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id q25-20020aa78439000000b006933e57dde4si1038117pfn.0.2023.09.27.07.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 07:23:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FZ+BocS0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BC4B38087267; Wed, 27 Sep 2023 07:10:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232082AbjI0OJ7 (ORCPT + 99 others); Wed, 27 Sep 2023 10:09:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232033AbjI0OJ6 (ORCPT ); Wed, 27 Sep 2023 10:09:58 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D8D5F3; Wed, 27 Sep 2023 07:09:57 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1F6BC433C7; Wed, 27 Sep 2023 14:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695823797; bh=9+omAMOSgipwvx8H3MoAWrDsFCQNOIaZlnkvH12Nm6k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FZ+BocS09LVTgXaQE+jzfwctJbFFrVzwpRVOQXInCXSrQmzlx1O+YYxboYlithJyc lhSW0SauiliTEyJA+0W3zP52Ga6nZNjLZZ8hQoVUUodDhnKBegqUfG/YUOgkqC51RG lb7Vn4j3MxIJ2bm3IAAX3N2HRqO5N7DJOmNInBNTE85ohJaXNF9vWN7M8HRn+iOKrX /xpLBg09iY2FEB2AhhZkUGus5u6iiiNjGoHtEKWFbR2bA4atyU7cTbh8Z5qfw5jOnD 2EI48O6dJ8Ynqnzh2DNF4cbygaoPQ3N8myVR1AkpV/fHV35ALoUg3OHjPYjmwV5eGi nYxy/BERaRXfg== Date: Wed, 27 Sep 2023 16:09:53 +0200 From: Christian Brauner To: Mateusz Guzik Cc: Linus Torvalds , viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] vfs: shave work on failed file open Message-ID: <20230927-kosmetik-babypuppen-75bee530b9f0@brauner> References: <20230926162228.68666-1-mjguzik@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 27 Sep 2023 07:10:12 -0700 (PDT) > I don't have a strong opinion, I think my variant is cleaner and more > generic, but this boils down to taste and this is definitely not the > hill I'm willing to die on. I kinda like the release_empty_file() approach but we should keep the WARN_ON_ONCE() so we can see whether anyone is taking an extra reference on this thing. It's super unlikely but I guess zebras exist and if some (buggy) code were to call get_file() during ->open() and keep that reference for some reason we'd want to know why. But I don't think anything does that. No need to resend I can massage this well enough in-tree.