From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a2-smtp.messagingengine.com (fout-a2-smtp.messagingengine.com [103.168.172.145]) (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 CF1B41D5174 for ; Sat, 24 Jan 2026 21:43:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.145 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769291041; cv=none; b=tfWuLr2skj9lvbFjmIqDOliFQU6rSKyQQlTZ+lq5LmIgOo+tCxo2klvF+iYFGbusgM9gYIfZj56qG+77MuSYgsgkGQ/X2KKv5kCZavafFMVkr4OnYfd5GXQBDfciM0Al299z3sBJ4wJnETnXlVYQS1uIjd9tvRiNdIwlCaIwcIA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769291041; c=relaxed/simple; bh=8FFi1OhGf4fQEPvDcmGOIpBVC9e9r7lSfkE/PMxRVp0=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Z9n2hDGB3h+MO5wYtCHSPhhDEup2QxSmdNo6MNfGElEV1BUyUsXoKoowXpnV1HLXNeFrV6B6yymJavHfa6nzTH2aKmYpx3NwXWeHDyi8oglKYcOcaZg/wDfBdrBCmiETvrLywY5fUxgQpKcmSSmHcMS2M38DI2tnIvxP1tY7AN8= 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=HH5+rlz5; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=QUKh+r+H; arc=none smtp.client-ip=103.168.172.145 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="HH5+rlz5"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="QUKh+r+H" Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id C4F5BEC00A7; Sat, 24 Jan 2026 16:43:58 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Sat, 24 Jan 2026 16:43:58 -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=1769291038; x=1769377438; bh=btSlU+EqIr VZXvNs6Y3lq73kCcXqpZ40i8LCHbr4Xnw=; b=HH5+rlz5+IFbRdZSXEtN3DY4ru dEQpYkHQ3akp9cp4F3va97ATYRW2k6y8lQDswS5K/cOwwtFneLe09WCTP5XWaUJX NLFehSo5ebDEKQjxNgZw0/+IhfbpcVg6D5aIsLXMOH+7lQCJh2PX0JkIMPLixvRP Fkjpya6VkoZ/kQTKFjIsD2lFYsvDza0rFjP5mtIcujcZdeuE/IJNjftYXAWWg8Ur 1jcR9rh3MlbVYiL6XGACACx2oGKEuOGJRo4dOZcng5BuPXvDA/XeuxkhX31CNAeT uYxbqg8LnnDPKIyV/OdpTaYB9Wo4WOwFMYk8rbXdptMn22lpRLBAQIidU11w== 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= 1769291038; x=1769377438; bh=btSlU+EqIrVZXvNs6Y3lq73kCcXqpZ40i8L CHbr4Xnw=; b=QUKh+r+HJ2dj1ysn6rEpboVbQNb1Cd/bQ2US9u72renK+7UCjei Bw1KtMGZZp21MvC32h+vVN7XhfgZEh5TVKdiQPwaIC+VJHY8zV0PMrnB32kEFXBR Ir0V56MQRxUmhCdIcTxnzOdYzq5ln1rwQQs/CKwtpX4eiIkFNr49y2viZT65zm8z 8HPVJyhMRghG2rZHcERToZAPIXKIooWN+hlHNwHxDBUaU4K8PFgS4mtD3jFuJvL/ 1RrqB6Hop4jK7JLcKQvVA8m+ixhRflunVaW1JzoWFBP+QjJLlkni5Rngie+YhlX3 tAdMB1RddL2bVTM0ati6Cxu/KhuyoHYCFbw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduheeftdefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertdertd ejnecuhfhrohhmpeeuohhrihhsuceuuhhrkhhovhcuoegsohhrihhssegsuhhrrdhioheq necuggftrfgrthhtvghrnheptdfgkeeufeehvdetvdekuddvudffvdegveeifedtvdekhf ehkeevleekleeuvefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepsghorhhishessghurhdrihhopdhnsggprhgtphhtthhopedvpdhmohguvg epshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdgsthhrfhhssehvghgvrhdrkhgv rhhnvghlrdhorhhgpdhrtghpthhtohepkhgvrhhnvghlqdhtvggrmhesfhgsrdgtohhm X-ME-Proxy: Feedback-ID: i083147f8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 24 Jan 2026 16:43:58 -0500 (EST) From: Boris Burkov To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v2 0/3] pending chunk allocation EEXIST fix Date: Sat, 24 Jan 2026 13:43:32 -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: 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 | 5 + 6 files changed, 677 insertions(+), 62 deletions(-) create mode 100644 fs/btrfs/tests/chunk-allocation-tests.c -- 2.52.0