Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2947071rdh; Wed, 27 Sep 2023 19:22:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBEB8zGjLKsALCvVgnK5m0LsSnuwikja39c9pThmtJAiRFoh/J/GdGzDDhGoJ56vyoBezm X-Received: by 2002:a17:902:b286:b0:1c5:db1d:1065 with SMTP id u6-20020a170902b28600b001c5db1d1065mr3447881plr.55.1695867750568; Wed, 27 Sep 2023 19:22:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695867750; cv=none; d=google.com; s=arc-20160816; b=SMiLTiSwbpNfCieJbOuNWIuUcgFmkTqa6RgB0uftEgUoXn5Kh7k47ZWycwEHUrdzeD aA91hBVeKXVsW1v+vImP2WYM1GBPwYvOYmP1XpTPWXNWNvnFiIsAvOERsCAAgPWPLnMi IhSA6BgGs0iUFhshzYTYRQFoR4DLnJTDMMnNodbPvPAV142kY3aEHWYi10wyoZvMfy/k lgcPJvQYIv6qXXLT7poZGKbjHkzO+WYvsYuvKIr54qUFTmh1gVLfL50s5Sx+mFvkbLhK 3RaCS6+0Sp+1uQteKR4eQltiaIvA0iLntTSxtJvOCBojkgcd7v4Ck5pWnbvaVCgu/Nbt gjXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UznxyLIywUzNQqi71J0T/nmzjMDdI/e0HYUPWfZk0Qs=; fh=ziJSrE0sDvMIhmkBFU1jJK15yvgZkLMOUWuncUnCmvo=; b=up6DEvawOK05IXGFnxG77Qti/84sKwBJui+QEQ79oOKLxAAAfGH5H0Ub8VRiFutS6H LWw+nDenCFgug70sJKrFnatg+9E17Ml61xNSELLdyhPielN8kOjLVndhfNh7ancGPV1Y pjE/sBKWV41G6NWiJ99Rpimqzf/xcm1O+1X+S5axKWsrD8wdCUy2BTtyLYg62uwYtI11 /T6kDEjQot8zLj9zON3+ydSyDRk/pOE686lbYYyMy3shEjUx9Ycnn2mIwAudVJYCo3UE 5XkDQ73Y5GCNIfkwuVtUDOHXdva4h3p5eA/X7U3YYvHl5/MR6B1+Dyyl/mgbyNTgNkrU GJAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=BzqKmI6z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id u13-20020a17090341cd00b001c725e4ae5csi3851364ple.589.2023.09.27.19.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 19:22:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=BzqKmI6z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0A5E3806AFFE; Wed, 27 Sep 2023 11:06:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbjI0SGA (ORCPT + 99 others); Wed, 27 Sep 2023 14:06:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbjI0SF7 (ORCPT ); Wed, 27 Sep 2023 14:05:59 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86A96EB for ; Wed, 27 Sep 2023 11:05:57 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-32167a4adaaso11237515f8f.1 for ; Wed, 27 Sep 2023 11:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1695837956; x=1696442756; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UznxyLIywUzNQqi71J0T/nmzjMDdI/e0HYUPWfZk0Qs=; b=BzqKmI6zEvzlTF1908jB8Jza6gN8os5IzgNwL2bR1lBTSeRohNgHCxlBHmw94M3evA zXaIgbihRIRDqY8SvWYZ25thuNkg6fpQUlkH3fY80MXjiuiWixBdP40R4+LmEkbB1o+O jU//yonzXUSerIhGcu92B6xoHUTowORflRyJA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695837956; x=1696442756; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UznxyLIywUzNQqi71J0T/nmzjMDdI/e0HYUPWfZk0Qs=; b=UOXMx3+fUqeqfYjwq94TO3Ig87rYqKXdayrSp2B4zp711hY21DnHuVD0//FiGxpcUm n9sit0Gdy320swBN3kesng1Owwd0ofL63bNn8NOTbBXr8PEbhcMMxuJX4Rn3bigGRNx+ cOurVceWJRT3WkjydBHrxRn7asr0qoZzfsuG9FccsIA+FmPC7sAYYPNE2iKEKtjG8VXF y+/uNiUEJJVkW9rHvdNKCC6WO4Gzs1CVxVbP/SnU6FFUOwMtWq3yfE5Kzw/fqTWtSNb+ h6MdtMSWXqHaC/jSHBuDG/jTQkACRuOPlzdjNUwpt6ZXMlWKZcT9GS0T9SAzi/+ojl6C EY3w== X-Gm-Message-State: AOJu0YxbCcVAbeaD0p7sK1xZQg68nVSTEhePj/Jm7bWrbh/qiyvePwB7 9DM3rhUcBB0ECh8dH4jA6ukEme1a0pAqfE/WPOVlYw== X-Received: by 2002:a5d:4146:0:b0:320:976:f942 with SMTP id c6-20020a5d4146000000b003200976f942mr2685312wrq.7.1695837955593; Wed, 27 Sep 2023 11:05:55 -0700 (PDT) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com. [209.85.208.52]) by smtp.gmail.com with ESMTPSA id w27-20020a17090633db00b009a2235ed496sm9836061eja.141.2023.09.27.11.05.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Sep 2023 11:05:55 -0700 (PDT) Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5345a3dfe3bso5827217a12.3 for ; Wed, 27 Sep 2023 11:05:54 -0700 (PDT) X-Received: by 2002:a05:6402:358:b0:534:78a6:36cb with SMTP id r24-20020a056402035800b0053478a636cbmr2829801edw.39.1695837954528; Wed, 27 Sep 2023 11:05:54 -0700 (PDT) MIME-Version: 1.0 References: <20230926162228.68666-1-mjguzik@gmail.com> <20230927-kosmetik-babypuppen-75bee530b9f0@brauner> In-Reply-To: From: Linus Torvalds Date: Wed, 27 Sep 2023 11:05:37 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] vfs: shave work on failed file open To: Mateusz Guzik Cc: Christian Brauner , viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no 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 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 11:06:08 -0700 (PDT) On Wed, 27 Sept 2023 at 10:56, Mateusz Guzik wrote: > > Comments in the patch explicitly mention dodgin RCU for the file object. Not the commit message,. and the comment is also actually pretty obscure and only talks about the freeing part. The cred part is what actually made me go "why is that even rcu-free'd". I *think* it's bogus, but I didn't go look at the history of it . > Well put_cred is called synchronously, but should this happen to be > the last ref on them, they will get call_rcu(&cred->rcu, > put_cred_rcu)'ed. Yes. But the way it's done in __fput() you end up potentially RCU-delaying it twice. Odd. The reason we rcu-delay the 'struct file *' is because of the __fget_files_rcu() games. But I don't see why the cred thing is there. Historical mistake? But it all looks a bit odd, and because of that it worries me. Linus