All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Andrei Borzenkov <arvidjaar@gmail.com>, NeilBrown <neilb@suse.de>,
	Bart Van Assche <bvanassche@acm.org>
Cc: Martin Steigerwald <martin@lichtvoll.de>,
	linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: Assumption on fixed device numbers in Plasma's desktop search Baloo
Date: Sat, 26 Jun 2021 14:24:45 +0800	[thread overview]
Message-ID: <f71ea06f-0282-dd5d-21f2-f5cf3c46d6ad@gmx.com> (raw)
In-Reply-To: <7d12d49d-1dbf-566e-cb92-84e68ab67e23@gmail.com>



On 2021/6/26 下午2:14, Andrei Borzenkov wrote:
> On 26.06.2021 08:17, NeilBrown wrote:
>> On Sat, 26 Jun 2021, Bart Van Assche wrote:
>>> On 6/25/21 5:54 PM, NeilBrown wrote:
>>>> On Sat, 26 Jun 2021, Martin Steigerwald wrote:
>>>>>                                   And that Baloo needs an "invariant" for
>>>>> a file. See comment #11 of that bug report:
>>>>
>>>> That is really hard to provide in general.  Possibly the best approach
>>>> is to use the statfs() systemcall to get the "f_fsid" field.  This is
>>>> 64bits.  It is not supported uniformly well by all filesystems, but I
>>>> think it is at least not worse than using the device number.  For a lot
>>>> of older filesystems it is just an encoding of the device number.
>>>>
>>>> For btrfs, xfs, ext4 it is much much better.
>>>
>>> How about combining the UUID of the partition with the file path? An
>>> example from one of the VMs on my workstation:
>>
>> A btrfs filesystem can span multiple partitions, and those partitions
>> can be added and removed dynamically.  So you could migrated from one to
>> another.
>>
>
> I suspect it was intended to be "filesytemm UUID". At least that is the
> field in lsblk output that was referenced.

Filesystem UUID is not enough.

In btrfs, all subvolumes share the same fsid.

While for statfs() call, we do extra XOR with subvolume id to generate
unique f_fsid for each subvolume.

Thanks,
Qu
>
>> f_fsid really is best for any modern filesystem.
>>
>> NeilBrown
>>
>

  reply	other threads:[~2021-06-26  6:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 19:06 Assumption on fixed device numbers in Plasma's desktop search Baloo Martin Steigerwald
2021-06-26  0:27 ` Qu Wenruo
2021-06-26  8:49   ` Martin Steigerwald
2021-06-26  9:33     ` Qu Wenruo
2021-06-26 10:18       ` Martin Steigerwald
2021-06-26  0:54 ` NeilBrown
2021-06-26  3:38   ` Bart Van Assche
2021-06-26  5:17     ` NeilBrown
2021-06-26  6:14       ` Andrei Borzenkov
2021-06-26  6:24         ` Qu Wenruo [this message]
2021-06-26  8:51   ` Martin Steigerwald

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=f71ea06f-0282-dd5d-21f2-f5cf3c46d6ad@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=arvidjaar@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=martin@lichtvoll.de \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.