CHROMIUM: esdfs: drop lock before deriving mkdir contents

In esdfs_mkdir(), we call inode_lock(_, I_MUTEX_PARENT) on the
lower parent's inode before creating the directory.

Then, in esdfs_derive_mkdir_contents(), if we can't find a ".nomedia"
file and if the directory created is either 'Android/data' or
'Android/obb', we attempt to create the file by calling
inode_lock(_, I_MUTEX_PARENT) on the lower directory's inode.

Lockdep is really sad about taking two mutexes with the same lockdep
class, which can be fixed by annotating the second mutex lock with
I_MUTEX_CHILD. But creating a file doesn't need the grandparent's inode
locked anyway, so drop the grandparent's lock before calling
esdfs_derive_mkdir_contents().

BUG=b:150039314
TEST=compilation

Change-Id: Ic7e3abe9f2091f0ad2dd404b0ec3c03b0989d9af
Signed-off-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2071135
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
(cherry picked from commit d6a0c2abe13d69f32e2da9ebdf75bfa133a57a3a)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2084424
1 file changed