Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp325584pxk; Fri, 11 Sep 2020 07:59:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUahX6+YFTHMPb/IElqlKsYjuR5sTA3xX0JwCNTreDRs16a63MzWszBCJggn6CWIkp34hR X-Received: by 2002:a17:906:c7da:: with SMTP id dc26mr2340522ejb.491.1599836396425; Fri, 11 Sep 2020 07:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599836396; cv=none; d=google.com; s=arc-20160816; b=r/Yq3pFDyqy4qYEDq/ZAhd8RNr+K2x0D1QI5PRoHHz7D7VQfz1P14BXt2hnA6PZhoS peO/GGjD9yNbN6x9ELfN8PBbbr7fbpSghFKBIDA1YvCD+clz5LOtwPGbY5oGdjDm9T5G REX0rMZRWaVi4mNfqPEIz1JaPlae4J3njdDlxjaDBAcCmrnhPR8FEmSFCEcGLN5SObFP NAZLBYE158rcBgGa51aGGa05s+EVnPYXYBap2g9P2yXM1+S9+Aeam/c7Rjf/Cfw9FSFr o3MoP5g71qbANcSuADcVsGDdJ+sZCauWTB1hhz5Ns+olXJYzGrfshmhQbqIlc1BIfs0P ci2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CQc+3Llrx2UWSMlLT3HlHtbCRA1FZFuHGyM9InGv9+8=; b=h3V4ES60a1KyJ0ccpP4WZV7D/aP4s+xFFZCXHkyKFN79VHKnVUpvWHAwyjYEQij7s/ krS9ACygsM0y7mbfzkpc56l19CWi+EuEQK2T4xa7SJBe9CEiUYKpV4hgNP7SW91Tt+ed oBjFDCDbg/kdrtmxp6v9g1n+fE5dWKpcvrj5YP4EyK+oG9GPr4mNwhXd+4aa3AcO4rYx 5w1XjeDAI3/J/IDpD0ILfqWd1xiGcQ2eu69NE/kv+z/XB4P/LihI5X0Y00JJg0SFvgVb YpFf5si0T9/ZQcxBYLlJ4i3YtghdViR7V5EWobg52UxuRBUX+Qz/PSAABcovqyDKPsQT Kudg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uOPopwwK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si1459625edf.377.2020.09.11.07.59.33; Fri, 11 Sep 2020 07:59:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uOPopwwK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725871AbgIKO6Z (ORCPT + 99 others); Fri, 11 Sep 2020 10:58:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:52820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbgIKNCU (ORCPT ); Fri, 11 Sep 2020 09:02:20 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25ACB222B6; Fri, 11 Sep 2020 12:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599829030; bh=yWd7Xk6i6VoYeFBQ9j2bjYn6LP4GVgLuBx2gKw8zksQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uOPopwwK0r7BvMm7qB0S67FR9pK8f/89S7RR+bR06GH7ggkJ1XSj4dFtcjIcE/dFY UEXxaAuIq1K0JEVJOKU6cHXzxfQQ4iekEr5SyoICadRhTvfHysdFyVBtddfEPiN3t2 3/Jd3+YqhHyq2wgcw42iuXQw7d4/X2phEUJOaebc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikolay Borisov , David Sterba , Sasha Levin Subject: [PATCH 4.9 31/71] btrfs: Remove extraneous extent_buffer_get from tree_mod_log_rewind Date: Fri, 11 Sep 2020 14:46:15 +0200 Message-Id: <20200911122506.483895838@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911122504.928931589@linuxfoundation.org> References: <20200911122504.928931589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikolay Borisov [ Upstream commit 24cee18a1c1d7c731ea5987e0c99daea22ae7f4a ] When a rewound buffer is created it already has a ref count of 1 and the dummy flag set. Then another ref is taken bumping the count to 2. Finally when this buffer is released from btrfs_release_path the extra reference is decremented by the special handling code in free_extent_buffer. However, this special code is in fact redundant sinca ref count of 1 is still correct since the buffer is only accessed via btrfs_path struct. This paves the way forward of removing the special handling in free_extent_buffer. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/ctree.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 78d4c8c22b4ac..406ae49baa076 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1360,7 +1360,6 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct btrfs_path *path, btrfs_tree_read_unlock_blocking(eb); free_extent_buffer(eb); - extent_buffer_get(eb_rewin); btrfs_tree_read_lock(eb_rewin); __tree_mod_log_rewind(fs_info, eb_rewin, time_seq, tm); WARN_ON(btrfs_header_nritems(eb_rewin) > -- 2.25.1