]> git.baikalelectronics.ru Git - kernel.git/commit
death to mnt_pinned
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 7 Aug 2014 13:12:31 +0000 (09:12 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 7 Aug 2014 18:40:09 +0000 (14:40 -0400)
commit79a9d78891bfa963d3197b6d8447423ac315e22b
tree806bc1df85e925686cc1075b659a6d6fe3e14aec
parenta98cc990a4a41b34c41ab3049ad66b553fe18ba7
death to mnt_pinned

Rather than playing silly buggers with vfsmount refcounts, just have
acct_on() ask fs/namespace.c for internal clone of file->f_path.mnt
and replace it with said clone.  Then attach the pin to original
vfsmount.  Voila - the clone will be alive until the file gets closed,
making sure that underlying superblock remains active, etc., and
we can drop the original vfsmount, so that it's not kept busy.
If the file lives until the final mntput of the original vfsmount,
we'll notice that there's an fs_pin (one in bsd_acct_struct that
holds that file) and mnt_pin_kill() will take it out.  Since
->kill() is synchronous, we won't proceed past that point until
these files are closed (and private clones of our vfsmount are
gone), so we get the same ordering warranties we used to get.

mnt_pin()/mnt_unpin()/->mnt_pinned is gone now, and good riddance -
it never became usable outside of kernel/acct.c (and racy wrt
umount even there).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/mount.h
fs/namespace.c
include/linux/mount.h
kernel/acct.c