ANDROID: sdcardfs: Protect set_top
authorDaniel Rosenberg <drosen@google.com>
Fri, 2 Feb 2018 00:52:22 +0000 (16:52 -0800)
committerDaniel Rosenberg <drosen@google.com>
Sat, 3 Feb 2018 04:04:44 +0000 (20:04 -0800)
commit108bd1bb74df402952f949f2eca978d3b93cb3bb
treeb727fd0f2e2a4276239d5a69ab21e30c15e655cf
parent21de4c6b9603359cb92feb5004728f042ee38582
ANDROID: sdcardfs: Protect set_top

If the top is changed while we're attempting to use it, it's
possible that the reference will be put while we are in the
process of grabbing a reference.

Now we grab a spinlock to protect grabbing our reference count.

Additionally, we now set the inode_info's top value to point to
it's own data when initializing, which makes tracking changes
easier.

Change-Id: If15748c786ce4c0480ab8c5051a92523aff284d2
Signed-off-by: Daniel Rosenberg <drosen@google.com>
fs/sdcardfs/derived_perm.c
fs/sdcardfs/main.c
fs/sdcardfs/sdcardfs.h
fs/sdcardfs/super.c