From: Carlos Maiolino <cmaiolino@redhat.com>
To: Gionatan Danti <g.danti@assyoma.it>
Cc: linux-xfs@vger.kernel.org
Subject: Re: XFS and multiple mounts protection (aka preventing multiple mounts)
Date: Fri, 5 May 2017 14:25:47 +0200 [thread overview]
Message-ID: <20170505122547.6gvqmdoxfaqxh3mi@eorzea.usersys.redhat.com> (raw)
In-Reply-To: <2e45f5c8-0b8f-ef99-a8a5-cd3ebb89911e@assyoma.it>
On Fri, May 05, 2017 at 01:52:53PM +0200, Gionatan Danti wrote:
>
>
> On 05/05/2017 13:32, Carlos Maiolino wrote:
> >
> > This is not true, XFS can't identify mounts on different systems. It is not a
> > shared or clustered filesystem.
> >
>
> Ok, this confirm my finding.
>
> To reiterate: there is *no* method to prevent multiple mounts in XFS, right?
As far as I know, don't, I can always be wrong, but, I re-checked xfs
superblock, and could not find anything that actually protects it.
>
> > At the worst case, it would need to store something to disk saying the
> > filesystem is already mounted, and the mount process would need to read it
> > before actually mounting the filesystem. Nothing though would prevent a race
> > between two systems, or even make the filesystem unmountable after a crash,
> > needing something like xfs_repair to clean some "is_mounted" flag, which would
> > trash one of the reasons why we have a journal (fast recovery without needing an
> > fsck before mounting).
> >
>
> EXT4 uses a "keepalive" approach: enabling the "mmp" feature (which require
> kernel 3.10+), a specific on-disk structure is continuously (each 5 seconds,
> by default) updated with a timestamp by the mounting machine. If another
> machine tries to mount the filesystem, it sees the mmp structure changing
> and it refuse to mount.
>
> It's not perfect, but better than nothing ;)
Eh, I really don't know much about EXT4, but this only works if the clocks are
properly adjusted (not really hard to achieve though), but still racy.
cheers.
--
Carlos
next prev parent reply other threads:[~2017-05-05 12:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-05 10:29 XFS and multiple mounts protection (aka preventing multiple mounts) Gionatan Danti
2017-05-05 11:32 ` Carlos Maiolino
2017-05-05 11:52 ` Gionatan Danti
2017-05-05 12:25 ` Carlos Maiolino [this message]
2017-05-05 13:19 ` Gionatan Danti
2017-05-05 16:08 ` Emmanuel Florac
2017-05-10 8:12 ` Carlos Maiolino
2017-05-10 8:19 ` Gionatan Danti
2017-05-05 19:20 ` Eric Sandeen
2017-05-08 9:34 ` Gionatan Danti
2017-05-08 13:26 ` Eric Sandeen
2017-05-08 13:36 ` Gionatan Danti
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=20170505122547.6gvqmdoxfaqxh3mi@eorzea.usersys.redhat.com \
--to=cmaiolino@redhat.com \
--cc=g.danti@assyoma.it \
--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;
as well as URLs for NNTP newsgroup(s).