From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi2-f13.google.com (mail-oi2-f13.google.com [74.125.231.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 751AF53CA99 for ; Tue, 8 Sep 2026 18:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.231.205 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788891624; cv=none; b=BrF+2dl8fUmlCafgr9xogMZKJUA1YtRnzDY8zdDukefSXWl5og2koxrkaqSz1xRMT0R17LdKXMktTDnFTgEldr7nUbijtNjEKlEXJwmBDKUdtiG2edNsei7AYYdKQEjkLJDKfxXPB5rDvu+kPcZNy7B+aAFh4MJegtNxMQ/LdcI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788891624; c=relaxed/simple; bh=T5CqmSnaexzm2YVCpEARjs9sSTWJkEnstf1yOs8SLpw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ip7SLF8RbtHOlHbKQqsw4suD2+Lu45Ee2oYIOqefjnHzrCZVztznu34sYuFXwSphBsazOmz1IY+U24EeO80XJfjznYN8oyZbk0N8pd4Quf/RVwAH4gvrj61hDgYN4+5L2Pt/yiEumSMutsbbLxOyOe//svtVgoUmneCzwaZYDJA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peridio.com; spf=pass smtp.mailfrom=peridio.com; dkim=pass (2048-bit key) header.d=peridio.com header.i=@peridio.com header.b=YNaEizYI; arc=none smtp.client-ip=74.125.231.205 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peridio.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=peridio.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=peridio.com header.i=@peridio.com header.b="YNaEizYI" Received: by mail-oi2-f13.google.com with SMTP id 5614622812f47-4b6070b67beso114093b6e.2 for ; Tue, 08 Sep 2026 11:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peridio.com; s=google; t=1788891621; x=1789496421; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:feedback-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=herbp2Xpm1L8idqOVaAZ+EViPrHS3n9/4a+1URgNpeU=; b=YNaEizYIsXJ4rAEbfX3NHeF8r2OZ0wleToLDBPNexgZUIsm0bBReLTtqe4B47V1uLb dnXH9YOMzxfCiMpzTtQHan4CtHlgyEsFyLBTgJ+IXn2KcYYe9mIznofjuPE0zvKPZap/ Sd3BC8aBleAFMPGp1Aqc+N9WTS+bEPJ67McFw2cslBuvxuCdz6fC7XCQHwAldJhk10Mt n5UulZofMn5OnRB07O3rAlTsMc1NRd51eQJ3K5Evu+g1itd34krix4wpiRl5r7NK+sab +F6G1JCync/y5WjOae+6TWGBR9/5VceRLFDDVXLSZ7TEheYhCaWUY3qrNOB9APuMRcA5 On5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788891621; x=1789496421; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:feedback-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=herbp2Xpm1L8idqOVaAZ+EViPrHS3n9/4a+1URgNpeU=; b=NJToaS0aDl7XJZDKinWOJU+1PglrAQaNgo7PyJtvPFejnC7896ySMtVQU8m+omINN9 tf5zoo8G3uEyz0sUxdU61pxMcVK/2CkDywxXbQKL+sXiWe/wVgFuSrbrpXbEh3x42iSD aLX8pEdG8FbX/YrzDyTsx3uhyEEwshz8Y3Gt09pV7UOfW53Ga637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ab06631a2mr13445513b6e.5.1788891620848; Tue, 08 Sep 2026 11:20:20 -0700 (PDT) Received: from fauth-b1-smtp.messagingengine.com (fauth-b1-smtp.messagingengine.com. [202.12.124.200]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4b96eaa508asm14666943b6e.1.2026.09.08.11.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2026 11:20:20 -0700 (PDT) Received: from stl-compute-03.internal (stl-compute-03.internal [10.204.2.63]) by mailfauth.stl.internal (Postfix) with ESMTP id 7E5E1780043; Tue, 8 Sep 2026 14:20:19 -0400 (EDT) Received: from stl-imap-04 ([10.204.2.95]) by stl-compute-03.internal (MEProxy); Tue, 08 Sep 2026 14:20:19 -0400 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTEv5A3HKbH+oRsA88IwAiXmYsutMQFmHcjXXyMekw9JT7sLTOF8bMWRSyYBfbtL/x JtsDNYtbnbbpR3p9Y4qzfrV4rGgJkBQI9t4kYW9DG0JEKrF2ZBGngPwxKzUnVEJcapuoPV Hg+Cp6SFZtaRXV2UbJNNeqny+Q4SIZDQHzjE8Ls4LZbthfWb1vjdI/LFuRKT/Ta+j4j116 Y06KJ/B4sA3Wq0rVepbkMZYD4PXL3jc4lnDmis73EtSud4V055YPbqXRhrKsC1pyAM9Bcc BN2xaPrZ6kCv5E6E6TawXMuHaRAoVUlZ+XpaiSVzgYKW2/5kQwJLpzo8dphHk4Db+Ma3CN 2nGut+s4kbeM/Tm9oCezP63XlXZLQ39lIEXyCfRxaDEEswbpXVcULnt9CPl8oRnoZjKrcv IAxbdBmiifgKNBU03Y/xKCcYSAfUOiGLS4DdeJo8QqM/Cfb1VnP9GjGCjaNaVCrPmoMFLa kwC7rURw69NI/VE3bmtcCBjnnAaT5PdLqumb3pvdp1LKLKnCyZn/LzoFgrWJlZsm2q4RVz kYl46Uk/cDk5kk09Efu1bZpo4CInVAgTtBKktRCGFLYiYxAnNjijwNYkn/0UWcBIHqiYva NUG9CctaZ1cbdxHEUXcOO5xaTTApbvul+zYuj5rdFcqFnEkw2AHg48zXnp2w X-ME-Proxy: Feedback-ID: if7264b73:Fastmail Received: by mailuser.stl.internal (Postfix, from userid 501) id 44DC380064; Tue, 8 Sep 2026 14:20:19 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface From: Javier Tia To: Dave Chinner , linux-xfs@vger.kernel.org Cc: "Darrick J. Wong" , Carlos Maiolino Subject: Re: [bug v7.3-rc2] dabtree block accounting assertion failure in xfs/286 Date: Tue, 08 Sep 2026 08:45:56 -0600 Message-ID: <20260908144556.ehhplwwele@jetm.me> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Dave, On Tue, Sep 08, 2026 at 06:07:39AM +0000, Dave Chinner wrote: > [ 5725.316568] XFS: Assertion failed: args->total >= dp->i_nblocks - nblks, file: fs/xfs/libxfs/xfs_da_btree.c, line: 2387 [...] > xfs_dir2_sf_to_block+0x143/0x800 [xfs] > xrep_dir_swap_prep+0x134/0x170 [xfs] The assert is right and the caller is wrong. Sorry for the breakage. xrep_dir_swap_prep() builds its xfs_da_args with .total = 1, but xfs_dir2_sf_to_block() goes through xfs_dir2_grow_inode(), which allocates args->geo->fsbcount blocks. m_dir_geo->fsbcount is 1 << sb_dirblklog. Nothing forces those to match. At 4k blocks with a 4k directory block size fsbcount is 1 and the reservation happens to be exact, which is why the default config never trips it. At 1k blocks with a 4k directory block size it is 4, and total is short by three. The non-repair caller of the same conversion already reserves it that way: xfs_bmap_add_attrfork_local() sets dargs.total to dargs.geo->fsbcount immediately before calling xfs_dir2_sf_to_block(). The fix mirrors that. The attr side is fine as it stands, because xrep_xattr_swap_prep() passes 1 for m_attr_geo, whose fsbcount is hardcoded to 1. args in xrep_dir_swap_prep() is a stack local used for that one conversion and then dropped, so the underflowed total never reaches a second allocation. The understated value did reach xfs_bmapi_write(), as the total the allocator sizes minleft from. That is a spurious ENOSPC at worst rather than corruption, which is probably why it sat there since b1991ee3e7cf without anyone noticing. I have not run xfs/286, and I do not have a 1k setup here to run it on. The patch alongside this is untested. Dave, could you put it through the config that tripped the assert? Carlos, if you would rather have for-next quiet in the meantime, reverting 0fe77e57588b is fine by me and I will resend this behind the repair fix. -- Javier Tia