From f2f6fe2909e7635ad14b7218664ad7ae09b07630 Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:35:25 +0100 Subject: [PATCH] fix(boot): backport mounted usage stats to 7.3 Restore row-level filesystem rendering to use mount status so mounted boot partitions keep their used/free statistics when the array is stopped. Keep the existing stopped-state guard in my_usage() for the aggregate navigation widget and cover mounted boot versus unmounted data partitions. Refs: https://linear.app/lime-technology/issue/OS-852/740-beta12-regression-boot-device-usedfree-stats-missing-when-array-is --- emhttp/plugins/dynamix/nchan/device_list | 4 ++-- tests/stopped-array-utilization.php | 24 +++++++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/emhttp/plugins/dynamix/nchan/device_list b/emhttp/plugins/dynamix/nchan/device_list index 73d71bb82..6dbb43b36 100755 --- a/emhttp/plugins/dynamix/nchan/device_list +++ b/emhttp/plugins/dynamix/nchan/device_list @@ -682,11 +682,11 @@ function effective_fs_size(&$disk) { } function fs_info(&$disk,$online = false) { - global $display, $var; + global $display; $echo = []; if (empty(_var($disk,'fsStatus',''))) return ""; - if (_var($disk,'fsStatus')=='Mounted' && _var($var,'fsState') == 'Started') { + if (_var($disk,'fsStatus')=='Mounted') { $fsSize = effective_fs_size($disk); $echo[] = "".vfs_type($disk,$online).""; $echo[] = "".my_scale($fsSize*1024,$unit,-1)." $unit"; diff --git a/tests/stopped-array-utilization.php b/tests/stopped-array-utilization.php index 02bfd3e14..b372a343b 100644 --- a/tests/stopped-array-utilization.php +++ b/tests/stopped-array-utilization.php @@ -104,7 +104,8 @@ function assertNotContainsText(string $needle, string $haystack, string $message $navigationUsage = ob_get_clean(); assertContainsText('50%', $navigationUsage, 'Started arrays must keep showing the usage percentage.'); -$disk = [ +$bootPartition = [ + 'type' => 'Cache', 'fsStatus' => 'Mounted', 'fsType' => 'xfs', 'fsSize' => 100, @@ -112,12 +113,25 @@ function assertNotContainsText(string $needle, string $haystack, string $message 'fsFree' => 75, ]; $var['fsState'] = 'Stopped'; -$diskInfo = fs_info($disk, true); -assertContainsText('Mounted', $diskInfo, 'Stopped filesystems must keep showing their status.'); -assertNotContainsText('usage-disk', $diskInfo, 'Stopped filesystems must not show a usage bar.'); +$bootInfo = fs_info($bootPartition, true); +assertContainsText('25', $bootInfo, 'Stopped mounted boot partitions must show used space.'); +assertContainsText('75', $bootInfo, 'Stopped mounted boot partitions must show free space.'); +assertContainsText('usage-disk', $bootInfo, 'Stopped mounted boot partitions must show usage bars.'); + +$flashBootDisk = $bootPartition; +$flashBootDisk['type'] = 'Flash'; +$flashBootInfo = fs_info($flashBootDisk, true); +assertContainsText('25', $flashBootInfo, 'Stopped mounted flash boot devices must show used space.'); +assertContainsText('75', $flashBootInfo, 'Stopped mounted flash boot devices must show free space.'); + +$dataPartition = $bootPartition; +$dataPartition['fsStatus'] = 'Unmounted'; +$dataInfo = fs_info($dataPartition, true); +assertContainsText('Unmounted', $dataInfo, 'Stopped unmounted data partitions must show their status.'); +assertNotContainsText('usage-disk', $dataInfo, 'Stopped unmounted data partitions must not show a usage bar.'); $var['fsState'] = 'Started'; -$diskInfo = fs_info($disk, true); +$diskInfo = fs_info($bootPartition, true); assertContainsText('usage-disk', $diskInfo, 'Started filesystems must keep showing a usage bar.'); echo "Stopped array utilization regression test passed.\n";