linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Remount root RO after the root dentry drops from the namespace
@ 2009-11-18 11:12 Daniel Drake
  2009-11-18 11:50 ` Miklos Szeredi
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Drake @ 2009-11-18 11:12 UTC (permalink / raw)
  To: linux-fsdevel

Hi,

OLPC ships a slightly strange filesystem layout. We keep everything
under /versions/run/<hash>. For example, libc is
at /versions/run/<hash>/lib/libc.so.6

The background behind this is that we can then create a mass of
hardlinks to that original OS, and do a safe OS update by downloading
files that have changed into that 2nd tree, breaking the hardlinks as we
go. At the end we can atomically update the symlink that points to
the /versions/run/<hash> which determines which OS is booted into on
reboot. Therefore we have atomic OS updates which can be interrupted
without consequences.

Once the system is booted, this weird layout is barely visible, because
the initramfs performs a series of chroot and mount --move steps in
order to make things function as normal. Assuming that the initramfs
mounts the root partition at /sysroot in its namespace and the hash
we're booting into is just "1", then this is what happens:

1. cd /sysroot
2. mount --move . /
3. chroot .
4. cd /
5. chdir /versions/run/1
6. chroot .
7. cd /
8. exec /sbin/init

This works well and the system functions as normal. However, I've
noticed that during shutdown, the root filesystem is never unmounted
cleanly.

"mount -o remount,ro /" always fails due to this check in do_remount():
	if (path->dentry != path->mnt->mnt_root) {
		return -EINVAL;

Obviously the dentry for the / path that we are trying to unmount is not
the actual root of the mount. However the root of the mount is long
gone, so I'm not sure what we can do. And shutting down cleanly is
obviously important!

Any thoughts?

Thanks!
Daniel



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-11-18 17:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-18 11:12 Remount root RO after the root dentry drops from the namespace Daniel Drake
2009-11-18 11:50 ` Miklos Szeredi
2009-11-18 12:38   ` Daniel Drake
2009-11-18 12:58     ` Miklos Szeredi
2009-11-18 14:52       ` Karel Zak
2009-11-18 15:28         ` Miklos Szeredi
2009-11-18 17:08           ` Karel Zak
2009-11-18 17:38             ` Miklos Szeredi
2009-11-18 15:18       ` Daniel Drake

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).