Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3274344rdh; Thu, 28 Sep 2023 07:26:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGM8YF5ztYfL8vObemtnJXfFUPchLTTd5CkbTa+rrZHyjblmaUnonp6Nt4mDLGUQEZV/wlp X-Received: by 2002:a05:6808:2392:b0:3ae:5c14:8686 with SMTP id bp18-20020a056808239200b003ae5c148686mr1618489oib.2.1695911177769; Thu, 28 Sep 2023 07:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695911177; cv=none; d=google.com; s=arc-20160816; b=JSw4bH+2919WgRaIjJnwV5b9SgeJzU3SaoVbtrxxoK5pM6GZwyekSYN/e1CqbNqmDL TQR2ZIvogcQYmRPEEqGVaMPC3PuMhQOK0tyG+ro7qR5GUbuSN7Gc1yVY8Wocm9r386Jt xVYSjRdG3gHgJH8atrf5MpIx1hMGKXOVh/wUOf5U+rH3rI43KYHncYyCEfH7e9iJX+Dg mKwPVKWJOIqS1SvXXL4/jpoSFnuTUjngMG2vBOOAjeytrx36pBNTJrQTO9htYY6/LeYz FnvdLf0u6aNRvLdq1QcsB3IuNJjJxKufHKa3O/VttEgdS6SxM0x9k3Y+fSt5BM4UenYj pncA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mE+1me6apiq4xeb2j0bjmfY/2+unmRUDRwnrDhMHZDI=; fh=M1oqWky46lQiA3aQBjgPxVqvYD8wo5fU839Fy43Jf90=; b=h6aKWXoJ8thcgqD3FjInityCAOmVGvdLomH6cpT4MRIsRP/Dd/SsE3nWK0aLtJ8u6M T22eAc3BErxGJmt5VwOg5FojyqVl+HnMYn1nGLesJFKz/Ju53vUH6XhLML+HqQiA07yl i2WlMQ0vPTxORroBROhbY3A2kmjpEtGJgJcfCiYh2rWZ6r7pxo1Bbq79s922ZEQkbwyi gSK1ba3lgO4/w90hgHxzBdjCNYJJH0vipoLJkDh2WutaivNdg14Xu133SNRcPFqYmyze VN4W/0ZTMNyis0DpFBjMVzbuA6Tsl8++YhB8coFhZTmKGxGmOPBAaG4nz3jka65ARGgo oJmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=PYrOiHxe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f20-20020a637554000000b00578daf6f4e2si19301908pgn.191.2023.09.28.07.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 07:26:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=PYrOiHxe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 3DDD480677FA; Thu, 28 Sep 2023 07:21:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232308AbjI1OVK (ORCPT + 99 others); Thu, 28 Sep 2023 10:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbjI1OVJ (ORCPT ); Thu, 28 Sep 2023 10:21:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E785219E; Thu, 28 Sep 2023 07:21:07 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFFC1C433C7; Thu, 28 Sep 2023 14:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695910867; bh=RQwLxrhtkj1P5yQ46YDdr98IzOwhhCImXJW1888SN6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PYrOiHxeoQbk/JMa+ItyDqPa+s9bdwwLt/sRGpCOjd8280Q6K18xgYIZ/37+aDlME ykvXmgHIXk/VXf+6JpqQ0fQ4YuSfcT7hCQbFlhgaEx9w32onspI2WODlqKF/siJi9W 9kv2gzrGiNmeA27et34v3Ri7YyKLQG4XAzp4yeANaQks1Z16kf97D5YInak18fiHfL s90giAQcyPAPveBNiQcVFAKdH3hawdwMTqcOZZPGd0lBxh+hVTsF0ZuwO5+Dmt8KD2 oUve5bnDK70WX6pHQTTesaMURPBs0gR5rKw9vN7zK3/TOYirq/ieMtztbItOjge33A fXDU/yXuBXxMw== From: Christian Brauner To: =?utf-8?q?Lu=C3=ADs_Henriques_=3Clhenriques=40suse=2Ede=3E?=@vger.kernel.org Cc: Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Viro , Mateusz Guzik , David Howells Subject: Re: [PATCH] fs: fix possible extra iput() in do_unlinkat() Date: Thu, 28 Sep 2023 16:20:58 +0200 Message-Id: <20230928-piloten-mitkommen-d284c6b5581d@brauner> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928131129.14961-1-lhenriques@suse.de> References: <20230928131129.14961-1-lhenriques@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1350; i=brauner@kernel.org; h=from:subject:message-id; bh=RQwLxrhtkj1P5yQ46YDdr98IzOwhhCImXJW1888SN6U=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaSKdp9gYgw7fSrNyiLsleVqQ/WURGVuXqkc+QnntrsdLg74 dDS2o5SFQYyLQVZMkcWh3SRcbjlPxWajTA2YOaxMIEMYuDgFYCKBsxkZVnKIhDVv4GI4u5J3he9EzQ nvHurX/4vXW7Bj+3UG9cJHhQz/06M1Ff628qcYHku+Hml2d8nk+HU3ZTrFo/dujnhS1t3HDAA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 28 Sep 2023 07:21:26 -0700 (PDT) On Thu, 28 Sep 2023 14:11:29 +0100, Luís Henriques wrote: > Because inode is being initialised before checking if dentry is negative, > and the ihold() is only done if the dentry is *not* negative, the cleanup > code may end-up doing an extra iput() on that inode. > > Not a bug afaict but as Mateusz points out it's confusing. So I took it with a changed commit message: fs: move d_is_negative() further up The code is confusing because inode is dereferenced before the d_is_negative() check. Make it clear that iput() isn't called further below. --- Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc [1/1] fs: fix possible extra iput() in do_unlinkat() https://git.kernel.org/vfs/vfs/c/b99cf757431d