Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Lukas Herbolt <lukas@herbolt.com>
Cc: djwong@kernel.org, cem@kernel.org, hch@infradead.org,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2] xfs: Use xarray to track SB UUIDs instead of plain array.
Date: Wed, 25 Feb 2026 06:33:43 -0800	[thread overview]
Message-ID: <aZ8IR37gQkhomIWq@infradead.org> (raw)
In-Reply-To: <20260225123322.631159-3-lukas@herbolt.com>

This doens't apply to current mainline or the XFS tree, as it
doesn't have the healthmon pointer in the mount structure yet.

> +/*
> + * Helper fucntions to store UUID in xarray.

s/fucntions/functions/

But I'd just drop the comment.

> + */
> +static int
> +xfs_uuid_insert(
> +	uuid_t		*uuid,
> +	unsigned int	*index)
> +{
> +	return xa_alloc(&xfs_uuid_table, index, uuid,
> +			xa_limit_32b, GFP_KERNEL);
> +}

... and open code this in the only caller.

> +static void
> +xfs_uuid_delete(
> +	uuid_t		*uuid,
> +	unsigned int	index)
> +{
> +	ASSERT(uuid_equal(xa_load(&xfs_uuid_table, index), uuid));
> +	xa_erase(&xfs_uuid_table, index);
> +}

>  	mutex_unlock(&xfs_uuid_table_mutex);

This looks like it should be a lock and not unlock?

> +	if (unlikely(xfs_uuid_search(uuid))) {
> +		xfs_warn(mp, "Filesystem has duplicate UUID %pU - can't mount",
> +				uuid);
> +		return -EINVAL;

And this is missing an unlock?

Just curious how this was tested?  xfs/045 should cover mounting with
duplicate uuids.


  reply	other threads:[~2026-02-25 14:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 12:33 [PATCH v2] xfs: Use xarray to track SB UUIDs instead of plain array Lukas Herbolt
2026-02-25 14:33 ` Christoph Hellwig [this message]
2026-02-26  9:07   ` Lukas Herbolt

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=aZ8IR37gQkhomIWq@infradead.org \
    --to=hch@infradead.org \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lukas@herbolt.com \
    /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