Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b58d372 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Installd: Fix math overflow on quota calculation" into oc-mr1-dev am: 40cd6376

am: c856156c

Change-Id: Ied4b589d2139f857782f20bad67393d06f4f0c17
parents 31974d72 c856156c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -320,7 +320,8 @@ static int prepare_app_quota(const std::unique_ptr<std::string>& uuid, const std
        }
        }


        dq.dqb_valid = QIF_LIMITS;
        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);
        dq.dqb_ihardlimit = (stat.f_files / 2);
        if (quotactl(QCMD(Q_SETQUOTA, USRQUOTA), device.c_str(), uid,
        if (quotactl(QCMD(Q_SETQUOTA, USRQUOTA), device.c_str(), uid,
                reinterpret_cast<char*>(&dq)) != 0) {
                reinterpret_cast<char*>(&dq)) != 0) {