linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Walters <walters@verbum.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
	xfs <linux-xfs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] vfs: freeze filesystems just prior to reboot
Date: Fri, 19 May 2017 12:34:29 -0400	[thread overview]
Message-ID: <1495211669.1931975.982263184.0F641F32@webmail.messagingengine.com> (raw)
In-Reply-To: <20170519152734.qd4lf32e7wst4jdh@thunk.org>

On Fri, May 19, 2017, at 11:27 AM, Theodore Ts'o wrote:
> 
> One of the things that came up when Darrick and I discussed this on
> the weekly ext4 developer's conference call was our mutual wonderment
> that none of the userspace tools implemented a reboot by created a
> tmpfs chroot, pivoting into the chroot, and then unmounting all of the
> remaining file systems.

On general purpose systems we have a tmpfs chroot already: the initramfs.
Although IIRC, systemd will only switch back to it on shutdown I think only
if you have a root storage daemon enabled:
https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/

That said I'd like to focus on the harder case: supporting powerloss/system lockup on
single-partition systems.  IMO, the shutdown case is just a special variant
of that where the user asked nicely for the system to halt =)
(See also https://en.wikipedia.org/wiki/Crash-only_software)

I was thinking about this a bit, and I think if userspace tools (like ostree)
*delayed* their updates to /boot until shutdown, then we could ensure
that on powerloss, the system is unchanged.  (In a traditional dpkg/rpm
scenario where you only have one userspace root, you'd end up with
old kernel + new rootfs, but that's exactly the problem ostree solves)

That narrows the problem down to keeping `/boot` consistent at
shutdown time.  AIUI, a problem here is that XFS doesn't flush the
journal on `syncfs`, only on unmount?  And from what I can tell,
even the `XFS_IOC_FREEZE` ioctl won't do that either.

So as far as I can see, a userspace API to ensure the journal is
flushed on a mounted filesystem is going to be necessary for
the general case.  I don't have a strong opinion on whether or not
that's `syncfs()` - if it's e.g. a `XFS_IOC_FREEZE` `_THAW` pair
that seems OK to me too.

  reply	other threads:[~2017-05-19 16:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19  0:20 [PATCH] vfs: freeze filesystems just prior to reboot Darrick J. Wong
2017-05-19  8:29 ` Amir Goldstein
2017-05-19 18:58   ` Darrick J. Wong
2017-05-19 14:00 ` Colin Walters
2017-05-19 15:27   ` Theodore Ts'o
2017-05-19 16:34     ` Colin Walters [this message]
2017-05-19 16:48       ` Colin Walters
2017-05-19 18:20       ` Theodore Ts'o
2017-05-19 19:41     ` Darrick J. Wong
2017-05-23 11:10     ` Jan Kara
2017-05-19 19:01   ` Darrick J. Wong
2017-08-03 20:24     ` Colin Walters
2017-08-05 14:16       ` Christoph Hellwig
2017-08-05 15:45         ` Darrick J. Wong
2017-08-11 10:02           ` Christoph Hellwig
2017-08-11 16:26             ` Darrick J. Wong
2017-08-11 16:27               ` Christoph Hellwig

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=1495211669.1931975.982263184.0F641F32@webmail.messagingengine.com \
    --to=walters@verbum.org \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).