Index: mythtv/programs/mythbackend/httpstatus.cpp
===================================================================
--- mythtv.orig/programs/mythbackend/httpstatus.cpp	2009-05-24 16:23:03.000000000 -0400
+++ mythtv/programs/mythbackend/httpstatus.cpp	2009-05-25 16:28:41.000000000 -0400
@@ -339,6 +339,9 @@
     BackendQueryDiskSpace(strlist, m_pEncoders, true, m_bIsMaster);
     QDomElement total;
 
+    // Make a temporary list to hold the per-filesystem elements so that the
+    // total is always the first element.
+    QList<QDomElement> fsXML;
     QStringList::const_iterator sit = strlist.begin();
     while (sit != strlist.end())
     {
@@ -362,14 +365,18 @@
         group.setAttribute("free" , (int)(iAvail>>10) );
         group.setAttribute("dir"  , directory );
 
-        // Make sure that the total is always the last element.
         if (fsID == "total")
             total = group;
         else
-            storage.appendChild(group);
+            fsXML << group;
     }
 
     storage.appendChild(total);
+    int num_elements = fsXML.size();
+    for (int fs_index = 0; fs_index < num_elements; fs_index++)
+    {
+            storage.appendChild(fsXML[fs_index]);
+    }
 
     // load average ---------------------
 

