Porting the sdcard panic fix from qcom
authora17671 <a17671@motorola.com>
Tue, 18 Sep 2018 09:30:19 +0000 (17:30 +0800)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:49 +0000 (20:23 +0300)
commitc004983deef12d86a41869c46ed79eed45827acc
tree80e5c764003e51ce5d5562b5eaa02b574b79661c
parent9b7c9b19bb2e37fdd2e5bc0dd62ed6a41f1cd609
Porting the sdcard panic fix from qcom

Porting the change 226f96b0 from QCOM
Fix potential crash when reserved_mb is not zero
Author: Lianjun Huang <huanglianjun@vivo.com>
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 possitive. So we use the parrent dentry to check free space.

Change-Id: I0c7c6e38cf116660bc573a7e81a679366aa6c334
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/1242998
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Master Yoda
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
fs/sdcardfs/inode.c