Bug 61121

Summary: systemd tmpfile cleanup should not recurse below mount points
Product: systemd Reporter: Neil Rickert <rickert>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: fred, vovan
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Neil Rickert 2013-02-19 14:35:57 UTC
Originally reported at "https://bugzilla.novell.com/show_bug.cgi?id=802998"
where it was requested that I report here.

I was backing up my root partition.  So I did:

mkdir /tmp/a
mount --bind / /tmp/a

so that I could backup without other mounted file systems.

While backing up, the "systemd" tmpfile cleanup process deleted around 2/3 of
the content of my root file system.

It is a fairly common unix practice to create temporary mount points in "/tmp" Aggressive file cleanup should not be deleting content of mounted file
systems.
Comment 1 Lennart Poettering 2013-03-06 16:22:41 UTC
Hmm, that's a problem indeed, but hardly a regression, since the normal check for mount points is to compare major/minors of the backing devices, which in your case will be the same, since it's actually a bind mount of the same fs.

We can do this nicer on Linux, via the mount ID that is retrievable with the newer nametohandle() syscall. We already have code for that in systemd, so, this would be a minor change only.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.