From patchwork Tue Jul 2 14:31:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Burkov X-Patchwork-Id: 13719857 Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C7371BA081 for ; Tue, 2 Jul 2024 14:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719930726; cv=none; b=ITYTSOhCtxh1wQnFVcSwjWs8umckyttnhPflGBqWSn8HB5TcYoggICOgpRJJ9rvrr9yoNwn9zjMyL+ukq/Ybd4fhGUjHvRZLXKjkG15YoqC6UzyOhI4FDH4BBsRGAmyAOV9NCpU7+rHe/8oLdhFuOLZEa8suuRwjv//2ug/h2ao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719930726; c=relaxed/simple; bh=9XqTUNsOes+w13NWsWxCwmWpmT3I2mVvGAYKAe0nbBI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jbCD0bDuJkUPsyizwesDvxORHDkJV0iz1JnFfo67aqQkcmZASneVRjzB3QdXu5+GkvsXVlB9e7e6zrDqxnM1NC18gKDbilE9xQYFz8dBaCuXBA2dF4QJJ0ssO0C8VaHBi5Ip3Rx+HI/wBsX4PFuzzBIGKBIqIsoiYCmK+djOCmA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bur.io; spf=pass smtp.mailfrom=bur.io; dkim=pass (2048-bit key) header.d=bur.io header.i=@bur.io header.b=eBpD41HC; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=jqlsvEkA; arc=none smtp.client-ip=103.168.172.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bur.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bur.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bur.io header.i=@bur.io header.b="eBpD41HC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="jqlsvEkA" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 644751380226; Tue, 2 Jul 2024 10:32:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 02 Jul 2024 10:32:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bur.io; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1719930724; x= 1720017124; bh=KISj5SoyBtiCcRfqKRNlmWKKIEYm/WnavBOTH+H6UFs=; b=e BpD41HCnxviblo85cr/TE+S3yqbVcf33NYFG9jYeiaNM1V7if27y4NgyZz5ZpgwZ 9yAP6l7fLDpyyCP2yrylnPbtX3OgtJV/hozFl2Wy742IJskihaSj6rlODmplf07Z Pb5wokEJBj8f2r99Knlk7AMv2q7HXklZ4h31E0X3W8WkUS+7Q9JOuMpSr3Nizs6o KM5BKoduO6+goDg5owmweXendatVUloPXAQJfeDGDwtzoNl57eOm+VfRwhScqKo7 bCHUK7EysSuYD9K+TznVj74FLL9y9SoS1CeFFfdVwT8qvMjz5U72ruXTPevL1jOT DNKymg8qK6w1o5qESCE5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1719930724; x=1720017124; bh=KISj5SoyBtiCc RfqKRNlmWKKIEYm/WnavBOTH+H6UFs=; b=jqlsvEkAaZg+2c0dCXKx0GKPreGjX 6EM7F4z6QXGXXDGjbZCAcxVDJlL2QGYMrkW0meIV6E4qRZynMJtK1IDjZd2OEApA 81K9TybPE07bkWjls/eHCJ+QOJ4cDngxOBhtdaA9h6ACC3qlcK7bDShBXrEcAXNW /EpypW17WQCkPzyb2B3u9PwDF+58P4KE2HjKCV7UEXn1f3mGjUuDawMv5HHW5JSl yDBPBr8p9wLYqvY/N8kXcM4ol5ORXS9fLgI/mQ1SzBoWF2BjJnIRA0XQvUsiPlxe lwz4SsUCxIa6rjPpjs7fsGap7VpEAXwO+FZ8ySjmnOw1Lz01p9IX4gyLQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudehgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeeuohhrihhsuceuuhhrkhhovhcuoegsohhrihhssegsuhhrrdhi oheqnecuggftrfgrthhtvghrnhepieeuffeuvdeiueejhfehiefgkeevudejjeejffevvd ehtddufeeihfekgeeuheelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepsghorhhishessghurhdrihho X-ME-Proxy: Feedback-ID: i083147f8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Jul 2024 10:32:03 -0400 (EDT) From: Boris Burkov To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v3 2/2] btrfs: fix __folio_put refcount in __alloc_dummy_extent_buffer Date: Tue, 2 Jul 2024 07:31:14 -0700 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Another improper use of __folio_put in an error path after freshly allocating pages/folios which returns them with the refcount initialized to 1. The refactor from __free_pages -> __folio_put (instead of folio_put) removed a refcount decrement found in __free_pages and folio_put but absent from __folio_put. Fixes: 13df3775efca ("btrfs: cleanup metadata page pointer usage") Signed-off-by: Boris Burkov --- fs/btrfs/extent_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d3ce07ab9692..cb315779af30 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2775,7 +2775,7 @@ struct extent_buffer *__alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info, for (int i = 0; i < num_folios; i++) { if (eb->folios[i]) { detach_extent_buffer_folio(eb, eb->folios[i]); - __folio_put(eb->folios[i]); + folio_put(eb->folios[i]); } } __free_extent_buffer(eb);