ovl: copy-up: don't unlock between lookup and link
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 28 Jun 2017 11:41:22 +0000 (13:41 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 28 Jun 2017 11:41:22 +0000 (13:41 +0200)
commite85f82ff9b8ef503923a3be8ca6b5fd1908a7f3f
tree7c0b05231e998562d9fe83c41568f8f11ea480a6
parentc0bc126f97fb929b3ae02c1c62322645d70eb408
ovl: copy-up: don't unlock between lookup and link

Nothing prevents mischief on upper layer while we are busy copying up the
data.

Move the lookup right before the looked up dentry is actually used.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 01ad3eb8a073 ("ovl: concurrent copy up of regular files")
Cc: <stable@vger.kernel.org> # v4.11
fs/overlayfs/copy_up.c