Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Lukas Herbolt <lukas@herbolt.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: djwong@kernel.org, cem@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2] xfs: Use xarray to track SB UUIDs instead of plain array.
Date: Thu, 26 Feb 2026 10:07:54 +0100	[thread overview]
Message-ID: <6088f873f95cf38e1f125dad2224c52e@herbolt.com> (raw)
In-Reply-To: <aZ8IR37gQkhomIWq@infradead.org>

On 2026-02-25 15:33, Christoph Hellwig wrote:
> 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.

I wrote my own simple test I will also try the xfs/045. As always thanks 
for the
notes, will fix it!.
-- 
-lhe

      reply	other threads:[~2026-02-26  9:08 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
2026-02-26  9:07   ` Lukas Herbolt [this message]

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=6088f873f95cf38e1f125dad2224c52e@herbolt.com \
    --to=lukas@herbolt.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --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