[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zqgjftq6H3cDO8D0@dread.disaster.area>
Date: Tue, 30 Jul 2024 09:19:26 +1000
From: Dave Chinner <david@...morbit.com>
To: Mateusz Guzik <mjguzik@...il.com>
Cc: Aleksa Sarai <cyphar@...har.com>, Florian Weimer <fweimer@...hat.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-api@...r.kernel.org, Dave Chinner <dchinner@...hat.com>,
Christian Brauner <brauner@...nel.org>
Subject: Re: Testing if two open descriptors refer to the same inode
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@...morbit.com
Powered by blists - more mailing lists