Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2975753rdh; Wed, 27 Sep 2023 20:57:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDSYqcAtxG2eeOWoraI/6AJghyJq9SYCASCC+Vd4K4tnUk2W9AyDKHbkFhQbaYrSLDAHtN X-Received: by 2002:a17:90a:df8f:b0:267:fc61:5a37 with SMTP id p15-20020a17090adf8f00b00267fc615a37mr67133pjv.39.1695873476013; Wed, 27 Sep 2023 20:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695873475; cv=none; d=google.com; s=arc-20160816; b=atyXkMoFAl8dE42xnKUIrmuKb34Wh3RHVPLg/qWHswz2uMSKwSbyNOOsZyl9zsVTwq tELmyBMMFTMQx0rQkA4uA5WsN7MouAXwE8u2LF5wDAu1DD5xlTDIBO/XumemWMBjNwTR jPGhLZNMIBQ3JI5aBrYJVr1lhudVjZHMXCScjLeTGT0c8esaXIWel/X99nojqloxzxrN WGlU1fncKXZ/DgpZ/ZtdJdHEkFXrmf2L6zQJa+Kt6aJI+/GGnfe28rkssDKmbHyweetU KETyzksZogRGNiJUaE9bOcxo3OOAZtltU35RirwzVncvz/aUEfQ/43s75Gr1mBnFAghA 8jgQ== 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:references :in-reply-to:mime-version:dkim-signature; bh=dJzpV19NBkkTGsjOq0krdPXI3rlCskOpfXrdIvSHv5k=; fh=3fuGkk6t8rL4T2AilM3pBZQt6nXcfYvg3/GrJ/UWcNc=; b=U1a/NitYeqR6pmN+vl7W9ILdmNPD740KnUl8p11k5F3mY3ieGyqjpZI7jRKO4meZhC fex7sLP34j0PLAiuGr99eaXnvQQxcmxWiyVehoENB8DgO+1dhlUNzxTA1dtzGbtHXOHp rT+1HFD9LRRQNEnHDsvpYW/+RF8wuuXDnic4mvzajSpxTbOyO37H+VyNW3V3uCTKFneb 8PXob9Y9rOEp4nUm20StypmLzf40Uu+JrTV65OcQCY7kVnS6A6VVR0+C8w2SOGzlpy8r mVH+qRULdzzRvgIqRWGk18PTLlI9UlqK9bdC0zZYzDxhLaaF7jkImit69z6wm8d/gPPr PblQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KTEabMJK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ls14-20020a17090b350e00b002775281b839si11118021pjb.39.2023.09.27.20.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 20:57:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KTEabMJK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 30033808E3CB; Wed, 27 Sep 2023 14:30:18 -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 S229893AbjI0VaM (ORCPT + 99 others); Wed, 27 Sep 2023 17:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbjI0VaM (ORCPT ); Wed, 27 Sep 2023 17:30:12 -0400 Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C36FF11D; Wed, 27 Sep 2023 14:30:10 -0700 (PDT) Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-57bbb38d5d4so3812508eaf.2; Wed, 27 Sep 2023 14:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695850210; x=1696455010; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dJzpV19NBkkTGsjOq0krdPXI3rlCskOpfXrdIvSHv5k=; b=KTEabMJK7jeMqBvfU/pY1MmF/DIRq+x2uLkncaCDJuWMV9SeOycuKmd2GV7yNuot69 38NL3D8tDJorqsEvAJykZafv7hRnYPUknCx579tRHcpDtVgCTTT944oDYHUjYO43W2FB F0edPuk1A24e61hOccl9Pi6HtcaUmobbFzFhC5giW68FlcCt3REROyNykzKxohoftVGW 7V8MNhRXFcMzhJ/fWzHsF+KSRcEfYtLUPyETuJus5Jnok41pQa5wTRU55JUvMhjQjG99 dCtNKceeohp73veFMPKh9S4rg+OYx42QqmZ5OiIAfsUPyTRmpWtynsZF6ZCNSohMRM8u Akag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695850210; x=1696455010; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dJzpV19NBkkTGsjOq0krdPXI3rlCskOpfXrdIvSHv5k=; b=Fc1hV9qTm1mgDxjXYmh0FBcJtnbF/2sDVzO8E/CZ5pRKS5cLexpPC2tntZ0yEuJyoS Qs33LXnnulRtCbbKi/M5o3Lu7v/VdsikCk4FdoA0tHCM60kRv5T2qoiWioMr0NG+USgx CKujgKVGLV/rArldwWXVk2WaPqqHIitOPy0MmXyh6GJ5SQZgeTAr8mJJszyZpkkQLKvc kQr0+luuk2f5OgrjKEMOQhuGAqS23s+JCmxp3OjeY9aU9MOFDuT2gM/jvNuZOUsxial7 Ox1uE3VLRl8dfpu8rfepLVTlCNzX5wjWRQ7Gnsg955i/9eRSz0ZeMwufcfl2UphteufC v8OQ== X-Gm-Message-State: AOJu0Yxn1mJb6BwNmHczvQq4wIN6VCwSiNBPM4C6/AFEnRTNiILR+syc xRD0XZT4JiiKJiksIkPnSH2NehTrXOWvDeOfAE8= X-Received: by 2002:a4a:2a58:0:b0:57b:5e98:f733 with SMTP id x24-20020a4a2a58000000b0057b5e98f733mr3291680oox.3.1695850210025; Wed, 27 Sep 2023 14:30:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:1b45:b0:4f0:1250:dd51 with HTTP; Wed, 27 Sep 2023 14:30:09 -0700 (PDT) In-Reply-To: References: <20230926162228.68666-1-mjguzik@gmail.com> <20230927-kosmetik-babypuppen-75bee530b9f0@brauner> From: Mateusz Guzik Date: Wed, 27 Sep 2023 23:30:09 +0200 Message-ID: Subject: Re: [PATCH v2] vfs: shave work on failed file open To: Linus Torvalds 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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 14:30:18 -0700 (PDT) On 9/27/23, Linus Torvalds wrote: > On Wed, 27 Sept 2023 at 14:06, Mateusz Guzik wrote: >> >> I think you attached the wrong file, it has next to no changes and in >> particular nothing for fd lookup. > > The fd lookup is already safe. > > It already does the whole "double-check the file pointer after doing > the increment" for other reasons - namely the whole "oh, the file > table can be re-allocated under us" thing. > > So the fd lookup needs rcu, but it does all the checks to make it all > work with SLAB_TYPESAFE_BY_RCU. > Indeed, nice. Sorry, I discounted the patch after not seeing anything for fd and file_free_rcu still being there. Looked like a WIP. I'm going to give it a spin tomorrow along with some benching. -- Mateusz Guzik