Bug 61121 - systemd tmpfile cleanup should not recurse below mount points
Summary: systemd tmpfile cleanup should not recurse below mount points
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-19 14:35 UTC by Neil Rickert
Modified: 2013-03-13 12:21 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

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.