]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
debugfs: Make automount point inodes permanently empty
authorSeth Forshee <seth.forshee@canonical.com>
Wed, 9 Mar 2016 15:18:07 +0000 (09:18 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 May 2016 21:48:41 +0000 (14:48 -0700)
commit9b3bd581a0492bdfe788539ca65a14da570faad1
treef9f0fa7e7f0061698afe684c112356d40a8e3f1e
parented643d220692bfc2bfec9fe618d102f13a5dae9f
debugfs: Make automount point inodes permanently empty

commit 87243deb88671f70def4c52dfa7ca7830707bd31 upstream.

Starting with 4.1 the tracing subsystem has its own filesystem
which is automounted in the tracing subdirectory of debugfs.
Prior to this debugfs could be bind mounted in a cloned mount
namespace, but if tracefs has been mounted under debugfs this
now fails because there is a locked child mount. This creates
a regression for container software which bind mounts debugfs
to satisfy the assumption of some userspace software.

In other pseudo filesystems such as proc and sysfs we're already
creating mountpoints like this in such a way that no dirents can
be created in the directories, allowing them to be exceptions to
some MNT_LOCKED tests. In fact we're already do this for the
tracefs mountpoint in sysfs.

Do the same in debugfs_create_automount(), since the intention
here is clearly to create a mountpoint. This fixes the regression,
as locked child mounts on permanently empty directories do not
cause a bind mount to fail.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/debugfs/inode.c