Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Correct 32-bit false positive autoexpiration when free space is >2TB.

This corrects the symtomatic instances of improper typing in the
autoexpiration code.  The total free space (in KB) is cast from a
64-bit+ long long, to a size_t which varies depending on architecture.
When compiled on a 32-bit system, this unsafe casting results in an
inversion of the conditional every 2TB of freespace.  At 0-2TB free, or
4-6TB free, everything works properly.  At 2-4TB or 6-8TB free, it
immediately deletes anything it can.
  • Loading branch information...
commit 10d562420ca1b61fb1d6206547cb3ea7e76830ab 1 parent e4660d6
@wagnerrp wagnerrp authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 mythtv/programs/mythbackend/autoexpire.cpp
View
4 mythtv/programs/mythbackend/autoexpire.cpp
@@ -464,7 +464,7 @@ void AutoExpire::ExpireRecordings(void)
continue;
}
- if ((size_t)max(0LL, fsit->freeSpaceKB) < desired_space[fsit->fsID])
+ if ((int64_t)max(0LL, fsit->freeSpaceKB) < desired_space[fsit->fsID])
{
VERBOSE(VB_FILE,
QString(" Not Enough Free Space! We want %1 MB")
@@ -491,7 +491,7 @@ void AutoExpire::ExpireRecordings(void)
QString myHostName = gCoreContext->GetHostName();
pginfolist_t::iterator it = expireList.begin();
while ((it != expireList.end()) &&
- ((size_t)max(0LL, fsit->freeSpaceKB) < desired_space[fsit->fsID]))
+ ((int64_t)max(0LL, fsit->freeSpaceKB) < desired_space[fsit->fsID]))
{
ProgramInfo *p = *it;
it++;
Please sign in to comment.
Something went wrong with that request. Please try again.