summaryrefslogtreecommitdiffstats
path: root/fs/kernfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-01-12 06:20:54 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2019-01-17 17:53:02 +0100
commit35ac1184244f1329783e1d897f74926d8bb1103a (patch)
tree948885626366907d39c1d4540a89283ed2fb1a01 /fs/kernfs
parentfix cgroup_do_mount() handling of failure exits (diff)
downloadlinux-35ac1184244f1329783e1d897f74926d8bb1103a.tar.xz
linux-35ac1184244f1329783e1d897f74926d8bb1103a.zip
cgroup: saner refcounting for cgroup_root
* make the reference from superblock to cgroup_root counting - do cgroup_put() in cgroup_kill_sb() whether we'd done percpu_ref_kill() or not; matching grab is done when we allocate a new root. That gives the same refcounting rules for all callers of cgroup_do_mount() - a reference to cgroup_root has been grabbed by caller and it either is transferred to new superblock or dropped. * have cgroup_kill_sb() treat an already killed refcount as "just don't bother killing it, then". * after successful cgroup_do_mount() have cgroup1_mount() recheck if we'd raced with mount/umount from somebody else and cgroup_root got killed. In that case we drop the superblock and bugger off with -ERESTARTSYS, same as if we'd found it in the list already dying. * don't bother with delayed initialization of refcount - it's unreliable and not needed. No need to prevent attempts to bump the refcount if we find cgroup_root of another mount in progress - sget will reuse an existing superblock just fine and if the other sb manages to die before we get there, we'll catch that immediately after cgroup_do_mount(). * don't bother with kernfs_pin_sb() - no need for doing that either. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/kernfs')
0 files changed, 0 insertions, 0 deletions