From: Dave Chinner <david@fromorbit.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Florian Margaine <florian@margaine.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jeff Layton <jlayton@poochiereds.net>,
"J. Bruce Fields" <bfields@fieldses.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: add the FIGETFROZEN ioctl call
Date: Tue, 19 Apr 2016 09:06:01 +1000 [thread overview]
Message-ID: <20160418230601.GA18496@dastard> (raw)
In-Reply-To: <5714FB36.6020704@sandeen.net>
On Mon, Apr 18, 2016 at 11:20:22AM -0400, Eric Sandeen wrote:
>
>
> On 4/14/16 10:17 PM, Dave Chinner wrote:
> > On Thu, Apr 14, 2016 at 09:57:07AM +0200, Florian Margaine wrote:
> >> This lets userland get the filesystem freezing status, aka whether the
> >> filesystem is frozen or not. This is so that an application can know if
> >> it should freeze the filesystem or if it isn't necessary when taking a
> >> snapshot.
> >
> > freezing nests, so there is no reason for avoiding a freeze when
> > doing a snapshot.
>
> Sadly, no:
>
> # xfs_freeze -f /mnt/test
> # xfs_freeze -f /mnt/test
> xfs_freeze: cannot freeze filesystem at /mnt/test: Device or resource busy
>
> It used to, but it was broken^Wchanged quite some time ago.
Ugh. Block device freeze nesting still works (i.e. freeze_bdev, as
snapshots from DM would use), but I didn't realise (or had
forgetten) that superblock level freeze nesting had been removed...
> > Indeed, if you don't wrap freeze/thaw around a
> > snapshot, then if the fs is thawed while the snapshot is in progress
> > then you are going to get a corrupt snapshot....
>
> Yep.
>
> IMHO what really needs to happen is to fix freeze to allow nesting
> again.
Probably. I quick dig shows nesting was intentionally broken more
than 5 years ago in making the freeze ioctl work on btrfs.
commit 18e9e5104fcd9a973ffe3eed3816c87f2a1b6cd2
Author: Josef Bacik <josef@redhat.com>
Date: Tue Mar 23 10:34:56 2010 -0400
Introduce freeze_super and thaw_super for the fsfreeze ioctl
.....
The only new gotcha is multiple calls to the fsfreeze ioctl will return EBUSY if
the fs is already frozen. I thought this was a better solution than adding a
freeze counter to the super_block, but if everybody hates this idea I'm open to
suggestions. Thanks,
....
Not sure many people noticed that at the time....
> A way to query freeze state might be nice, I think, but yeah, it's
> racy, so you can't depend on it - but it might be useful in the "huh,
> IO is failing, what's going on? Oh, it's frozen, ok" scenario...
So maybe we should just add the frozen state to /proc/self/mountinfo
or something similar, then people who think it matters can shoot
themselves in the foot all they want without us needing to care
about it.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2016-04-18 23:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 7:57 [PATCH] fs: add the FIGETFROZEN ioctl call Florian Margaine
2016-04-14 8:10 ` Florian Margaine
2016-04-15 0:50 ` Mateusz Guzik
2016-04-15 2:17 ` Dave Chinner
2016-04-16 12:18 ` Florian Margaine
2016-04-17 15:05 ` Jan Kara
2016-04-18 15:20 ` Eric Sandeen
2016-04-18 17:20 ` Florian Margaine
2016-04-18 17:47 ` Eric Sandeen
2016-04-18 23:06 ` Dave Chinner [this message]
2016-04-22 21:53 ` Florian Margaine
2016-04-22 23:14 ` Dave Chinner
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=20160418230601.GA18496@dastard \
--to=david@fromorbit.com \
--cc=bfields@fieldses.org \
--cc=florian@margaine.com \
--cc=jlayton@poochiereds.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sandeen@sandeen.net \
--cc=viro@zeniv.linux.org.uk \
/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).