[arch-projects] [PATCH 2/2] swapoff: umount swap-backed fs before switching off swap

Tom Gundersen teg at jklm.no
Mon Oct 31 06:38:09 EDT 2011


On Mon, Oct 31, 2011 at 6:22 AM, C Anthony Risinger <anthony at xtfx.me> wrote:
> i only recently joined/realized i could post to this list ...

Welcome!

> if there
> is an established etiquette/procedure that i'm breaking (now or ever),
> just lmk.

Trust me, you will be told ;-)

> ... btw, you should be able to eliminate the call to `tac` via
> `findmnt -d backward [...]`.

Thanks! I added this to the newest version.

> however, i wrote a simple routine semi-recently for a project that may
> be useful -- it reads `/proc/self/mountinfo` directly (like findmnt),
> but it also makes use of `tsort` to automatically order the umounts
> properly (findmnt doesn't seem to do this)

>From what I could see findmnt does this if you put TARGET as your
first column (but I couldn't find this in the docs, so maybe I was
just lucky). If it does not, we should consider asking upstream to add
this as it seems like a very useful feature. I'd rather avoid
home-made solutions if we can...

> there was mention of a shudown hook after a pivot_root recently --
> this should work well for that.  if there is a simpler way to
> accomplish this, i'd love to here that as well.

We have a simple/hacky implementation of umount_all for the
shutdownramfs (using only busybox features). I think we should
consider moving this to using findmnt as well though...

> this isn't my original

Just as a general remark: I guess we should try to avoid copying code
that doesn't come with a license.

Cheers,

Tom


More information about the arch-projects mailing list