From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 874D82101BE; Fri, 21 Feb 2025 15:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740151418; cv=none; b=R+iWuLw390qRaoe/AlMMnFRQ5fRgMW1yDbJ9GGVax0AaWRWdUmYROUrOZphs39jtXx38+pM2OFqwHwVoDqEgSmAXS/xSUivYg2cby5uzSUx9j/v97LL4YrtN6j3OpCNbTOsKuTz0EQmkAfMMLQCKqjzB3AZNfZCSzic/d7E6Y8E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740151418; c=relaxed/simple; bh=1BVGnzXLaE1yqR4FDG4R9aiHSyYlCJm5p43oSKT9GoU=; h=Subject:To:Cc:From:Date:In-Reply-To:Message-ID:MIME-Version: Content-Type; b=Vk/q7CFy2UwFnfsFt7xbw/7mn3iZM+orQYsl/uSQ3CEK9/vDi8It5b49951POfv47Oq/Y0UGu5YrGpeS+5+vUzRrrp1odCZnCE19V6ApzIis35pW2h4rfzQhYUnoRO9AQG7ZXLDGt+f1tgpFeWO7QVj3WxY7pkGVFh/kUPvVHME= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=R2fqx4OJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="R2fqx4OJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABF8BC4CED6; Fri, 21 Feb 2025 15:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740151418; bh=1BVGnzXLaE1yqR4FDG4R9aiHSyYlCJm5p43oSKT9GoU=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=R2fqx4OJ+xTFoylCjj3eqyFwWDoOuwwZ+R3XpK6uWW+KJ0EzFRoQA2iVMnoxRLnLo DSmILJ3pi+rSFCkll0lba1iH4g9NG1lSOnwXqDO4P/pChbPJuBQcPymgYSk6Iza1s/ 5fHjDjkIv1j+VX9nutqDHT2X/Xprf73T7JE350iM= Subject: Patch "xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname" has been added to the 6.6-stable tree To: catherine.hoang@oracle.com,cem@kernel.org,djwong@kernel.org,gregkh@linuxfoundation.org,hch@lst.de,xfs-stable@lists.linux.dev Cc: From: Date: Fri, 21 Feb 2025 16:23:27 +0100 In-Reply-To: <20250205214025.72516-11-catherine.hoang@oracle.com> Message-ID: <2025022127-silenced-sprain-91ae@gregkh> Precedence: bulk X-Mailing-List: xfs-stable@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore This is a note to let you know that I've just added the patch titled xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: xfs-distinguish-extra-split-from-real-enospc-from-xfs_attr_node_try_addname.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From stable+bounces-113976-greg=kroah.com@vger.kernel.org Wed Feb 5 22:41:00 2025 From: Catherine Hoang Date: Wed, 5 Feb 2025 13:40:11 -0800 Subject: xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname To: stable@vger.kernel.org Cc: xfs-stable@lists.linux.dev Message-ID: <20250205214025.72516-11-catherine.hoang@oracle.com> From: Christoph Hellwig commit b3f4e84e2f438a119b7ca8684a25452b3e57c0f0 upstream. Just like xfs_attr3_leaf_split, xfs_attr_node_try_addname can return -ENOSPC both for an actual failure to allocate a disk block, but also to signal the caller to convert the format of the attr fork. Use magic 1 to ask for the conversion here as well. Note that unlike the similar issue in xfs_attr3_leaf_split, this one was only found by code review. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino Signed-off-by: Catherine Hoang Acked-by: Darrick J. Wong Signed-off-by: Greg Kroah-Hartman --- fs/xfs/libxfs/xfs_attr.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -543,7 +543,7 @@ xfs_attr_node_addname( return error; error = xfs_attr_node_try_addname(attr); - if (error == -ENOSPC) { + if (error == 1) { error = xfs_attr3_leaf_to_node(args); if (error) return error; @@ -1380,9 +1380,12 @@ error: /* * Add a name to a Btree-format attribute list. * - * This will involve walking down the Btree, and may involve splitting - * leaf nodes and even splitting intermediate nodes up to and including - * the root node (a special case of an intermediate node). + * This will involve walking down the Btree, and may involve splitting leaf + * nodes and even splitting intermediate nodes up to and including the root + * node (a special case of an intermediate node). + * + * If the tree was still in single leaf format and needs to converted to + * real node format return 1 and let the caller handle that. */ static int xfs_attr_node_try_addname( @@ -1404,7 +1407,7 @@ xfs_attr_node_try_addname( * out-of-line values so it looked like it *might* * have been a b-tree. Let the caller deal with this. */ - error = -ENOSPC; + error = 1; goto out; } Patches currently in stable-queue which might be from catherine.hoang@oracle.com are queue-6.6/xfs-return-bool-from-xfs_attr3_leaf_add.patch queue-6.6/xfs-fix-a-sloppy-memory-handling-bug-in-xfs_iroot_realloc.patch queue-6.6/xfs-streamline-xfs_filestream_pick_ag.patch queue-6.6/xfs-merge-xfs_attr_leaf_try_add-into-xfs_attr_leaf_addname.patch queue-6.6/xfs-don-t-free-cowblocks-from-under-dirty-pagecache-on-unshare.patch queue-6.6/xfs-pass-the-exact-range-to-initialize-to-xfs_initialize_perag.patch queue-6.6/xfs-assert-a-valid-limit-in-xfs_rtfind_forw.patch queue-6.6/xfs-don-t-use-__gfp_retry_mayfail-in-xfs_initialize_perag.patch queue-6.6/xfs-use-try_cmpxchg-in-xlog_cil_insert_pcp_aggregate.patch queue-6.6/xfs-don-t-ifdef-around-the-exact-minlen-allocations.patch queue-6.6/xfs-reduce-unnecessary-searches-when-searching-for-the-best-extents.patch queue-6.6/xfs-validate-inumber-in-xfs_iget.patch queue-6.6/xfs-support-lowmode-allocations-in-xfs_bmap_exact_minlen_extent_alloc.patch queue-6.6/xfs-skip-background-cowblock-trims-on-inodes-open-for-write.patch queue-6.6/xfs-remove-empty-declartion-in-header-file.patch queue-6.6/xfs-fold-xfs_bmap_alloc_userdata-into-xfs_bmapi_allocate.patch queue-6.6/xfs-update-the-file-system-geometry-after-recoverying-superblock-buffers.patch queue-6.6/xfs-call-xfs_bmap_exact_minlen_extent_alloc-from-xfs_bmap_btalloc.patch queue-6.6/xfs-distinguish-extra-split-from-real-enospc-from-xfs_attr_node_try_addname.patch queue-6.6/xfs-error-out-when-a-superblock-buffer-update-reduces-the-agcount.patch queue-6.6/xfs-update-the-pag-for-the-last-ag-at-recovery-time.patch queue-6.6/xfs-check-for-delayed-allocations-before-setting-extsize.patch queue-6.6/xfs-fix-a-typo.patch queue-6.6/xfs-distinguish-extra-split-from-real-enospc-from-xfs_attr3_leaf_split.patch