lvm: Add warning when user specifies invalid VDO index memory size - #1203
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughVDO pool creation and conversion now validate nonzero index memory values before LVM operations. The helper warns for values that LVM rounds. VDO tests use a 9 GiB backing loop and accepted index-memory parameters. ChangesVDO index memory validation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/_lvm_cases.py (1)
2169-2169: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd dedicated coverage for invalid index-memory warnings.
These changes remove the invalid
300 MiBinputs from the feature-toggle tests. The new512 MiBtest covers only an accepted value. Add a focused test that passes300 * 1024**2and verifies that the warning is emitted.Also applies to: 2195-2195
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/_lvm_cases.py` at line 2169, Add a focused test near the existing VDO pool creation tests using BlockDev.lvm_vdo_pool_create with 300 * 1024**2 as the index-memory value, and assert that the expected invalid index-memory warning is emitted. Keep the feature-toggle tests limited to accepted values such as 512 MiB.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/_lvm_cases.py`:
- Line 2169: Add a focused test near the existing VDO pool creation tests using
BlockDev.lvm_vdo_pool_create with 300 * 1024**2 as the index-memory value, and
assert that the expected invalid index-memory warning is emitted. Keep the
feature-toggle tests limited to accepted values such as 512 MiB.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e8f15575-8fac-4a64-a858-ab40aa52c13c
📒 Files selected for processing (5)
src/plugins/lvm/lvm-common.csrc/plugins/lvm/lvm-dbus.csrc/plugins/lvm/lvm-private.hsrc/plugins/lvm/lvm.ctests/_lvm_cases.py
The invalid values are silently rounded up by LVM.
f638658 to
db8a5b7
Compare
b1ba4a2
into
storaged-project:master
The invalid values are silently rounded up by LVM.
This was found by our tests mostly by accident, bigger index now needs more disk space so our tests started failing on systems with the latest LVM.
Summary by CodeRabbit
Bug Fixes
Tests