From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Chandan Babu R <chandan.babu@oracle.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/8] xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname
Date: Tue, 17 Sep 2024 11:19:46 -0700 [thread overview]
Message-ID: <20240917181946.GF182194@frogsfrogsfrogs> (raw)
In-Reply-To: <20240904053820.2836285-5-hch@lst.de>
On Wed, Sep 04, 2024 at 08:37:55AM +0300, Christoph Hellwig wrote:
> 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 <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> fs/xfs/libxfs/xfs_attr.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
> index 0bf4f718be462f..c63da14eee0432 100644
> --- a/fs/xfs/libxfs/xfs_attr.c
> +++ b/fs/xfs/libxfs/xfs_attr.c
> @@ -597,7 +597,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;
> @@ -1386,9 +1386,12 @@ xfs_attr_node_addname_find_attr(
> /*
> * 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(
> @@ -1410,7 +1413,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;
> }
>
> --
> 2.45.2
>
>
next prev parent reply other threads:[~2024-09-17 18:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 5:37 fix a DEBUG-only assert failure in xfs/538 v4 Christoph Hellwig
2024-09-04 5:37 ` [PATCH 1/8] xfs: merge xfs_attr_leaf_try_add into xfs_attr_leaf_addname Christoph Hellwig
2024-09-04 5:37 ` [PATCH 2/8] xfs: return bool from xfs_attr3_leaf_add Christoph Hellwig
2024-09-04 5:37 ` [PATCH 3/8] xfs: distinguish extra split from real ENOSPC from xfs_attr3_leaf_split Christoph Hellwig
2024-09-04 5:37 ` [PATCH 4/8] xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname Christoph Hellwig
2024-09-17 18:19 ` Darrick J. Wong [this message]
2024-09-04 5:37 ` [PATCH 5/8] xfs: fold xfs_bmap_alloc_userdata into xfs_bmapi_allocate Christoph Hellwig
2024-09-04 5:37 ` [PATCH 6/8] xfs: don't ifdef around the exact minlen allocations Christoph Hellwig
2024-09-17 18:22 ` Darrick J. Wong
2024-09-04 5:37 ` [PATCH 7/8] xfs: call xfs_bmap_exact_minlen_extent_alloc from xfs_bmap_btalloc Christoph Hellwig
2024-09-04 5:37 ` [PATCH 8/8] xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2024-09-18 5:30 fix a DEBUG-only assert failure in xfs/538 v5 Christoph Hellwig
2024-09-18 5:30 ` [PATCH 4/8] xfs: distinguish extra split from real ENOSPC from xfs_attr_node_try_addname Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240917181946.GF182194@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox