On 32-bit devices, the hard quota size calculation could overflow that
would cause the hard quota limit size to be much lower than intended.
b/
64160395
Change-Id: If7b0f2a40f77bb5e5957c663999544f4ab2e69be
}
dq.dqb_valid = QIF_LIMITS;
- dq.dqb_bhardlimit = (((stat.f_blocks * stat.f_frsize) / 10) * 9) / QIF_DQBLKSIZE;
+ dq.dqb_bhardlimit =
+ (((static_cast<uint64_t>(stat.f_blocks) * stat.f_frsize) / 10) * 9) / QIF_DQBLKSIZE;
dq.dqb_ihardlimit = (stat.f_files / 2);
if (quotactl(QCMD(Q_SETQUOTA, USRQUOTA), device.c_str(), uid,
reinterpret_cast<char*>(&dq)) != 0) {