Skip to content

Add SSD parity warning for unformatted array devices#2535

Draft
elibosley wants to merge 4 commits intomasterfrom
codex/add-warning-for-ssd-parity-limitations
Draft

Add SSD parity warning for unformatted array devices#2535
elibosley wants to merge 4 commits intomasterfrom
codex/add-warning-for-ssd-parity-limitations

Conversation

@elibosley
Copy link
Member

@elibosley elibosley commented Jan 28, 2026

Motivation

  • Inform users in the array setup view when an unformatted device is an SSD/NVMe that parity is not supported with SSDs due to TRIM and recommend using a pool for maximum speed.

Description

  • Detect unformatted devices by checking fsStatus for values starting with Unmountable and detect SSD/NVMe devices by checking rotational and transport == 'nvme' in emhttp/plugins/dynamix/nchan/device_list inside array_offline().
  • Build an orange warning string: The array does not support parity with SSDs due to TRIM. For maximum speed, assign SSDs to a pool instead. and append it to the existing overwrite/warning message except for devices of type Cache.
  • The change is limited to presenting the warning in the existing offline/unformatted device rows and does not change parity or device assignment logic.

Testing

  • The patch was applied and the modified file emhttp/plugins/dynamix/nchan/device_list was updated successfully; no automated tests were run.
  • No runtime or integration tests were executed as part of this change.

Codex Task

Summary by CodeRabbit

  • New Features

    • SSD-specific parity warnings for offline disks — an orange alert advises assigning parity SSDs to a pool for optimal performance.
  • Improvements

    • Enhanced array/device error tooltips show per-member status and more detailed ZFS-related error lines, plus explicit member ONLINE status when present, improving clarity in offline views.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

Adds SSD parity warning detection and messaging plus finer per-member filesystem error details to the array_offline device handling by introducing two helper functions and injecting an ssdWarning into the offline warning output when applicable.

Changes

Cohort / File(s) Summary
Device list updates
emhttp/plugins/dynamix/nchan/device_list
Added parity_ssd_warning_text() and needs_parity_ssd_warning($disk); enhanced get_fs_error_tooltip to include per-member status/details (match by member key or device); computed ssdWarning in array_offline and appended it to offline warnings when present.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hop through arrays by soft moonlight,
I sniff a parity SSD — orange in sight,
I added two helpers to whisper the claim,
Now offline warnings sing the SSD's name,
Hooray for small flags that keep disks polite.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an SSD parity warning feature for unformatted array devices, which is the primary focus of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.01.28.1703
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2535/webgui-pr-2535.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix/nchan/device_list

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2535, or run:

plugin remove webgui-pr-2535

🤖 This comment is automatically generated and will be updated with each new push to this PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@emhttp/plugins/dynamix/nchan/device_list`:
- Around line 722-723: Remove the redundant duplicate PHP closing tag '?>' (the
second occurrence with a leading space) so the file only ends with a single PHP
closing tag; locate the duplicate '?>' near the end of the file (the two
consecutive closing tags shown in the diff) and delete the extra one to avoid
emitting unexpected whitespace.
- Around line 111-116: The needs_parity_ssd_warning function currently flags any
Parity/Data SSD or NVMe regardless of format; update it to also check the disk's
fsStatus and only return true for devices whose fsStatus indicates
unformatted/unmountable (e.g. starts with "Unmountable"). Inside
needs_parity_ssd_warning (and using existing helpers like _var and the $disk
param), read fsStatus (default to empty) and if it does not start with
"Unmountable" return false before the rotational/transport checks so the warning
appears only for unformatted devices.

Comment on lines +111 to +116
function needs_parity_ssd_warning($disk) {
$type = _var($disk,'type');
if (!in_array($type, ['Parity','Data'])) return false;
if (!_var($disk,'device')) return false;
return !_var($disk,'rotational',1) || _var($disk,'transport')=='nvme';
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Missing unformatted device check as described in PR objectives.

The PR summary states the warning should be shown for "unformatted devices" by checking fsStatus values that start with Unmountable. However, this function shows the warning for all SSDs/NVMe devices in Parity or Data slots regardless of their format status.

If the warning should only appear for unformatted devices, consider adding the fsStatus check:

,

Proposed fix
 function needs_parity_ssd_warning($disk) {
   $type = _var($disk,'type');
   if (!in_array($type, ['Parity','Data'])) return false;
   if (!_var($disk,'device')) return false;
+  // Only warn for unformatted devices
+  $fsStatus = _var($disk,'fsStatus','');
+  if ($fsStatus !== '' && !str_starts_with($fsStatus, 'Unmountable')) return false;
   return !_var($disk,'rotational',1) || _var($disk,'transport')=='nvme';
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function needs_parity_ssd_warning($disk) {
$type = _var($disk,'type');
if (!in_array($type, ['Parity','Data'])) return false;
if (!_var($disk,'device')) return false;
return !_var($disk,'rotational',1) || _var($disk,'transport')=='nvme';
}
function needs_parity_ssd_warning($disk) {
$type = _var($disk,'type');
if (!in_array($type, ['Parity','Data'])) return false;
if (!_var($disk,'device')) return false;
// Only warn for unformatted devices
$fsStatus = _var($disk,'fsStatus','');
if ($fsStatus !== '' && !str_starts_with($fsStatus, 'Unmountable')) return false;
return !_var($disk,'rotational',1) || _var($disk,'transport')=='nvme';
}
🤖 Prompt for AI Agents
In `@emhttp/plugins/dynamix/nchan/device_list` around lines 111 - 116, The
needs_parity_ssd_warning function currently flags any Parity/Data SSD or NVMe
regardless of format; update it to also check the disk's fsStatus and only
return true for devices whose fsStatus indicates unformatted/unmountable (e.g.
starts with "Unmountable"). Inside needs_parity_ssd_warning (and using existing
helpers like _var and the $disk param), read fsStatus (default to empty) and if
it does not start with "Unmountable" return false before the
rotational/transport checks so the warning appears only for unformatted devices.

Comment on lines 722 to +723
?>
?> No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove duplicate closing PHP tag.

Line 723 contains a duplicate ?> tag with a leading space. This will cause unexpected whitespace to be output and the second closing tag is redundant.

Proposed fix
 ?>
- ?>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
?>
?>
?>
🤖 Prompt for AI Agents
In `@emhttp/plugins/dynamix/nchan/device_list` around lines 722 - 723, Remove the
redundant duplicate PHP closing tag '?>' (the second occurrence with a leading
space) so the file only ends with a single PHP closing tag; locate the duplicate
'?>' near the end of the file (the two consecutive closing tags shown in the
diff) and delete the extra one to avoid emitting unexpected whitespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant