From: Dave Chinner <david@fromorbit.com>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: Aleksa Sarai <cyphar@cyphar.com>,
Florian Weimer <fweimer@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-api@vger.kernel.org, Dave Chinner <dchinner@redhat.com>,
Christian Brauner <brauner@kernel.org>
Subject: Re: Testing if two open descriptors refer to the same inode
Date: Tue, 30 Jul 2024 09:19:26 +1000 [thread overview]
Message-ID: <Zqgjftq6H3cDO8D0@dread.disaster.area> (raw)
In-Reply-To: <CAGudoHFQ9TtG-5__38-ND4KTxYCpEKVv_X9HhZixcdnVMUBEwQ@mail.gmail.com>
On Mon, Jul 29, 2024 at 02:12:15PM +0200, Mateusz Guzik wrote:
> There needs to be a dev + ino replacement which retains the property
> of being reliable between reboots and so on.
Yes, that's exactly what filehandles provide.
OTOH, dev + ino by itself does not provide this guarantee, as st_dev
is not guaranteed to be constant across reboots because of things
like async device discovery and enumeration. i.e. userspace has to
do a bunch of work to determine the "st_dev" for a given filesystem
actually refers to the same filesystem it did before the system
restarted (e.g. via FS uuid checks).
Filehandles already contain persistent filesystem identifiers, and
so userspace doesn't have to do anything special to ensure that
comparisons across reboots are valid.
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2024-07-29 23:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 6:55 Testing if two open descriptors refer to the same inode Florian Weimer
2024-07-29 9:09 ` Aleksa Sarai
2024-07-29 9:29 ` Florian Weimer
2024-07-29 10:18 ` Mateusz Guzik
2024-07-29 10:40 ` Florian Weimer
2024-07-29 10:50 ` Mateusz Guzik
2024-07-29 10:56 ` Mateusz Guzik
2024-07-29 10:57 ` Florian Weimer
2024-07-29 11:06 ` Mateusz Guzik
2024-07-29 11:36 ` Florian Weimer
2024-07-29 12:00 ` Mateusz Guzik
2024-07-29 11:40 ` Aleksa Sarai
2024-07-31 18:07 ` David Sterba
2024-07-29 11:47 ` Aleksa Sarai
2024-07-29 12:12 ` Mateusz Guzik
2024-07-29 23:19 ` Dave Chinner [this message]
2024-07-29 23:08 ` Dave Chinner
2024-07-29 12:26 ` Christian Brauner
2024-07-29 13:36 ` Theodore Ts'o
2024-07-30 2:31 ` Dave Chinner
2024-07-30 4:19 ` Theodore Ts'o
2024-07-30 15:38 ` Christoph Hellwig
2024-07-29 15:24 ` Jeff Layton
2024-07-29 15:39 ` Florian Weimer
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=Zqgjftq6H3cDO8D0@dread.disaster.area \
--to=david@fromorbit.com \
--cc=brauner@kernel.org \
--cc=cyphar@cyphar.com \
--cc=dchinner@redhat.com \
--cc=fweimer@redhat.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.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