]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: get exclusive ownership on upper/work dirs
authorAmir Goldstein <amir73il@gmail.com>
Wed, 21 Jun 2017 12:28:33 +0000 (15:28 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 4 Jul 2017 20:03:17 +0000 (22:03 +0200)
commit4648b4ff2eb713e1c0024f3cf6597587217375c6
tree2c0d163277aad85c8226ed385735fc4f40bde939
parentbfccfab2b6eb34bf8b5ddab72a3793f41c0ecb09
ovl: get exclusive ownership on upper/work dirs

Bad things can happen if several concurrent overlay mounts try to
use the same upperdir/workdir path.

Try to get the 'inuse' advisory lock on upperdir and workdir.
Fail mount if another overlay mount instance or another user
holds the 'inuse' lock on these directories.

Note that this provides no protection for concurrent overlay
mount that use overlapping (i.e. descendant) upper/work dirs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/ovl_entry.h
fs/overlayfs/super.c