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 E71C637F001 for ; Mon, 31 Aug 2026 21:59: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=1788213563; cv=none; b=cCeT6xe1hkTM1beP4CLt50Uz2+nSp71DSuRkNjt3+b7E3ejrb+EaYc/Fwp7IvpFBGFDzpZS/3htTE8q5tqz3oatKEGamuOXDRoer0EtmK6QmwSNGhU2NR+ZH3l7BeNO3u13YhEXSnZYS1SutuZtdXS7hocDexOEDdt2gaGeLpLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788213563; c=relaxed/simple; bh=qSM4WGns2Z2dQOYqERfBSXjgWiSz2KIFSM4l1Xpjh2E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FIHveJeCSgsBPwXLQ88jsoyyPv8fkb9u2c2raO8RauckRBiOQtxSFzKIxqMkbhwlbBV6CG2eJYdzC2rcOfHryS0lJobmyOH3Vx8eaafbUzVS/jS/7IGAFjRJ+Vp0e2+C8nBiyBiET4v/QmE4Z9Bfi6YoVdEOP9xT4ZkFKePb53w= 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=raqt6I06; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=VMhiz59Z; 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="raqt6I06"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VMhiz59Z" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 1DA8714000E8; Mon, 31 Aug 2026 17:59:21 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Mon, 31 Aug 2026 17:59:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bur.io; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1788213561; x=1788299961; bh=i6Z/F84wAO 0X6qJBrZNH/kQtbAgFevHwYK/0lp5L7PM=; b=raqt6I06V7fHaCM8WEnhM5JOWH +j9B6HDQ3HtdrL/W11dNZcuXDJ95rdpQB2S+HMSJlp85ylcmJ9XlzN+/YpmrPg+C Ze2u+iXdevjBHMAgA7hEK6sOCTA6jJKRwYdINlNhL9NSOxU9rjKV0VB1yGwW9H+P QcEbumVAVPZCFEqz5MJ1+tZyJ5QyQ4JFJ1sN7MdiXrWYQKy4MWF0JV+jS04nkiW1 kqqIZq0hrbmTac5uXZEaZfsZGQCOZs86R2heiRtY4XgPYJC8eAo3zlYKWK0moVDD 0PmmOW8qVxH7ci+1jvyO5t66jdDf2hi4RYVuqtaNMCViAowSROErLrnriRRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1788213561; x=1788299961; bh=i6Z/F84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6B+8D6qBRUk4trV6Za8wGAzVGKEmb8w X-ME-Proxy: Feedback-ID: i083147f8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Aug 2026 17:59:20 -0400 (EDT) Date: Mon, 31 Aug 2026 14:58:41 -0700 From: Boris Burkov To: Johannes Thumshirn Cc: linux-btrfs@vger.kernel.org, Naohiro Aota Subject: Re: [PATCH] btrfs: zoned: handle RAID profiles in btrfs_can_activate_zone() Message-ID: <20260831215841.GE325502@zen.localdomain> References: <20260824161910.2009296-1-johannes.thumshirn@wdc.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260824161910.2009296-1-johannes.thumshirn@wdc.com> On Mon, Aug 24, 2026 at 06:19:10PM +0200, Johannes Thumshirn wrote: > btrfs_can_activate_zone() only accounts for the single and DUP profiles. > For a RAID0, RAID1, RAID1C3, RAID1C4 or RAID10 block group the profile > switch matches no case, so 'ret' stays false and the function reports > that no zone can be activated, even when the devices have plenty of > active zones left. > > As a side effect BTRFS_FS_NEED_ZONE_FINISH gets set and, since > btrfs_can_activate_zone() bails out early once that bit is set, data > allocations will fail permanently: writers loop on -EAGAIN and hang in > btrfs_new_extent_direct() waiting for the bit to clear. > > Each of these profiles needs one active zone per device, just like > single, so handle them the same way. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Boris Burkov > --- > fs/btrfs/zoned.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c > index 9d448cdd60c4..107833fcf2be 100644 > --- a/fs/btrfs/zoned.c > +++ b/fs/btrfs/zoned.c > @@ -2689,6 +2689,11 @@ bool btrfs_can_activate_zone(struct btrfs_fs_devices *fs_devices, u64 flags) > > switch (flags & BTRFS_BLOCK_GROUP_PROFILE_MASK) { > case 0: /* single */ > + case BTRFS_BLOCK_GROUP_RAID0: > + case BTRFS_BLOCK_GROUP_RAID1: > + case BTRFS_BLOCK_GROUP_RAID1C3: > + case BTRFS_BLOCK_GROUP_RAID1C4: > + case BTRFS_BLOCK_GROUP_RAID10: > ret = (atomic_read(&zinfo->active_zones_left) >= (1 + reserved)); > break; > case BTRFS_BLOCK_GROUP_DUP: > -- > 2.55.0 >