[mythtv-commits] Ticket #4179: (patch included) BackendQueryDiskSpace incorrectly aggregates identical local disks
MythTV
mythtv at cvs.mythtv.org
Fri Nov 16 23:56:07 UTC 2007
#4179: (patch included) BackendQueryDiskSpace incorrectly aggregates identical
local disks
-------------------------------+--------------------------------------------
Reporter: cmoates at gmail.com | Owner: ijr
Type: defect | Status: new
Priority: minor | Milestone: 0.21
Component: mythtv | Version: head
Severity: medium | Mlocked: 0
-------------------------------+--------------------------------------------
I just installed three brand new, identical disks, partitioned them, and
formatted them. They have the same capacity and free space.
When going into System Status, I noticed the following:
{{{
MythTV Drive #0:
Directories:
/mnt/myth/sda1
/mnt/myth/sdb1
/mnt/myth/sdc1
}}}
It thinks they are all the same disk, because of the method used to
determine if two disks are "the same disk but in different places."
Looking at the source, I noticed the following test being made:
if (total capacity of two disks is about the same)
&& (total free space of two disks is about the same)
then (they are the same disk)
I've changed this to say:
if (total capacity of two disks is about the same)
&& (total free space of two disks is about the same)
&& (NOT (both disks are local disks))
then (they are the same disk)
This resolves the issue of two identical capacity drives with roughly
identical free space being aggregated.
Note that this affected the "amount of total disk space available for
myth" calculations as well.
Here's the patch as generated by svn diff:
{{{
Index: programs/mythbackend/backendutil.cpp
===================================================================
--- programs/mythbackend/backendutil.cpp (revision 14666)
+++ programs/mythbackend/backendutil.cpp (working copy)
@@ -178,7 +178,8 @@
// different than when it is locally mounted because of block
sizes
if ((absLongLong(it1->totalSpaceKB - it2->totalSpaceKB) <= 16
) &&
(absLongLong(it1->usedSpaceKB - it2->usedSpaceKB)
- < maxWriteFiveSec))
+ < maxWriteFiveSec) &&
+ (!(it1->isLocal && it2->isLocal)))
{
if (!it1->hostname.contains(it2->hostname))
it1->hostname = it1->hostname + "," + it2->hostname;
}}}
Thanks,
Chris Moates
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/4179>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list