From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a2-smtp.messagingengine.com (fhigh-a2-smtp.messagingengine.com [103.168.172.153]) (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 5189234B43D for ; Mon, 26 Jan 2026 17:19:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.153 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769447963; cv=none; b=LUens2Z4paXA46zLDoT594H/v7pT0NF7C7jTYhcUEoZsY6FM+F1Z/PPjNWspAccJRHknlXHBWFHniAqw2CiGBZM+PvoLiFUexRnya9X4/0gl17bJY+9Kd6stcVLmesNxBDADlK1rJMtzwN577RhO1aDKTyCGjhje8G2IS4H8iE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769447963; c=relaxed/simple; bh=0ayckA+oKZIVCRMUMo2+yiwY4+IPw7rI9aP2N+BHLtA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=VdPitVUqGmEWiED8SoGVFnQXG7qrv8NpeOcREQaJfghv++2ngBAFL3wSvxfoP/m9WPXY7JBjbx6M1R/U/DRDzSEZqQ0Ye7h2jq7yjFMf3YcaTLFOJqgNb9N3FTUGGEDqWyUBgFNHtonypezB3bhskQHWswXvzqHYgbxYlv5mXSI= 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=OT7ztZEu; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Dz39FmhJ; arc=none smtp.client-ip=103.168.172.153 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="OT7ztZEu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Dz39FmhJ" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 4A4001400074; Mon, 26 Jan 2026 12:19:20 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Mon, 26 Jan 2026 12:19:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bur.io; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm3; t=1769447960; x=1769534360; bh=MWMVTdOa4h HDu9P0mIbV/4E130UgCa6ViB/9wGsNotQ=; b=OT7ztZEuRnV8mxTrzSdMD1Wcyb 04Jyv/r9d+b0xRGDU22jWV2Qs2i/U7PXXiXfZYAU/Lpvcc9p9Bffsj+xP1l1b5z4 cMTCbDoEJ5qPNdwyuibvH6w5t8117OWaNF7Bu+3CjDA2NVxq2oaRL1f5pvg1SO3p z9G9MAmR9zGK0UeTwgzSvlmlAb4mvFTqXVkXZ7OcyI7zj/rPx1MtHkZfCT3b8Upa iuYH8To1eaVNkto2V+W597oikgiwUL/FD0g4VjEcsB44s2CwS6TUmEAFPDCwOfov 1o/RwziyS3EMdqs3HqewNZ6BVP5l4kjpdEosJwc1s6KsLSTCsf7Np4EzJNiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1769447960; x=1769534360; bh=MWMVTdOa4hHDu9P0mIbV/4E130UgCa6ViB/ 9wGsNotQ=; b=Dz39FmhJDNg0Y7DP2tLwkBitNBvlngv+dCF/UwkxIwtojVV5CDh lAXPJ/UDLXovb9CRS9GsURsDp2tvmwQWzUSqwMwN0Tb2Q3PWt5TcZiXOJEwWVnNi mkBFOqwuw1A/cWparYbWD2+E2sLJicqPiFc4Q9syX5iH+sEL4Ni4BU3zRK+kpvN7 iEDNvq+m8qfOW3efBawZscGiUHOGlDDpPYTNBMsUqkTdksSmbqlFRBth7iIwQrsM 6ab37BHm26QVqQfpVc3JGxAlJS/66hM67hGS30zyQxfAWg7Pvhy+vJy/+LtHoF44 lRR53aG1WLNXeIsbKDrzk6XFHum8jdP7VfQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduheekvdehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertdertd ejnecuhfhrohhmpeeuohhrihhsuceuuhhrkhhovhcuoegsohhrihhssegsuhhrrdhioheq necuggftrfgrthhtvghrnheptdfgkeeufeehvdetvdekuddvudffvdegveeifedtvdekhf ehkeevleekleeuvefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepsghorhhishessghurhdrihhopdhnsggprhgtphhtthhopedvpdhmohguvg epshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdgsthhrfhhssehvghgvrhdrkhgv rhhnvghlrdhorhhgpdhrtghpthhtohepkhgvrhhnvghlqdhtvggrmhesfhgsrdgtohhm X-ME-Proxy: Feedback-ID: i083147f8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 26 Jan 2026 12:19:19 -0500 (EST) From: Boris Burkov To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v3 0/3] pending chunk allocation EEXIST fix Date: Mon, 26 Jan 2026 09:18:50 -0800 Message-ID: X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a somewhat convoluted bug in chunk allocation with non consecutive pending extents. Also, add unit tests covering the new search functions and fix a build warning Changelog: v3: - fix build warning when CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set v2: - change the semantics of btrfs_find_hole_in_pending_extents to return the largest hole on failure. A different bug in the implementation of the incorrect v1 semantics was hiding this. - add the unit tests - add the build warning fix Boris Burkov (3): btrfs: fix EEXIST abort due to non-consecutive gaps in chunk allocation btrfs: unit tests for pending extent walking functions btrfs: forward declare btrfs_fs_info in volumes.h fs/btrfs/Makefile | 3 +- fs/btrfs/tests/btrfs-tests.c | 3 + fs/btrfs/tests/btrfs-tests.h | 1 + fs/btrfs/tests/chunk-allocation-tests.c | 481 ++++++++++++++++++++++++ fs/btrfs/volumes.c | 246 +++++++++--- fs/btrfs/volumes.h | 6 + 6 files changed, 678 insertions(+), 62 deletions(-) create mode 100644 fs/btrfs/tests/chunk-allocation-tests.c -- 2.52.0