ANDROID: sdcardfs: fix potential crash when reserved_mb is not zero
authorLianjun Huang <huanglianjun@vivo.com>
Sat, 16 Jun 2018 14:59:46 +0000 (22:59 +0800)
committerDaniel Rosenberg <drosen@google.com>
Mon, 25 Jun 2018 22:13:02 +0000 (22:13 +0000)
commitc4b98f6473c93884012401786a2a707113eaf524
tree7f0bd542872b43bbc6737f8057a98eb2ad26053a
parent94ab648b00e46743c50e2f50e556bcfef7456e90
ANDROID: sdcardfs: fix potential crash when reserved_mb is not zero

sdcardfs_mkdir() calls check_min_free_space(). When reserved_mb is not zero, a negative dentry will be passed to
ext4_statfs() at last and ext4_statfs() will crash. The parent dentry is positive. So we use the parent dentry to
check free space.

Change-Id: I80ab9623fe59ba911f4cc9f0e029a1c6f7ee421b
Signed-off-by: Lianjun Huang <huanglianjun@vivo.com>
fs/sdcardfs/inode.c