Send devnode invalidate signals on pool and filesystem rename#3988
Send devnode invalidate signals on pool and filesystem rename#3988mulkieran merged 2 commits intostratis-storage:masterfrom
Conversation
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
|
Every Cockpit Stratis test is recorded as success. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThe changes enhance filesystem rename signal handling by collecting affected filesystem paths during pool rename operations and emitting additional devnode invalidation signals for each filesystem through the DBus layer. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can suggest fixes for GitHub Check annotations.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/dbus/pool/pool_3_0/methods.rs`:
- Around line 583-600: The current code abandons sending the pool name signal if
any filesystem path lookup fails; change the filesystem-path collection to be
best-effort so send_pool_name_signal is always called with whatever paths were
found (possibly an empty Vec). In the Some(pool) arm (where pool.filesystems()
is used), replace the filter_map chain with an explicit loop/iteration that for
each (_, fs_uuid, _) calls read_lock.filesystem_get_path(&fs_uuid) and pushes
the path into a mutable Vec when Some(p), and logs the warn when None, then
after the loop call send_pool_name_signal(connection, &p.as_ref(),
fs_paths).await so the name_changed signal is emitted regardless of missing
filesystem lookups.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 55874661-67e3-4ef0-b1ea-06f706b68502
📒 Files selected for processing (2)
src/dbus/pool/pool_3_0/methods.rssrc/dbus/util.rs
| let read_lock = manager.read().await; | ||
| match read_lock.pool_get_path(&pool_uuid) { | ||
| Some(p) => match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await { | ||
| Some(pool) => { | ||
| let fs_paths = pool.filesystems().into_iter().filter_map(|(_, fs_uuid, _)| match read_lock.filesystem_get_path(&fs_uuid) { | ||
| Some(p) => Some(p), | ||
| None => { | ||
| warn!("Could not find filesystem path for filesystem with UUID {fs_uuid}; cannot send devnode invalidate signal"); | ||
| None | ||
| } | ||
| }) | ||
| .collect::<Vec<_>>(); | ||
| send_pool_name_signal(connection, &p.as_ref(), fs_paths).await; | ||
| } | ||
| None => { | ||
| warn!("Could not find filesystems associated with pool with UUID {uuid}; cannot send devnode invalidate signal"); | ||
| } | ||
| }, |
There was a problem hiding this comment.
Don’t drop the pool rename signal when the filesystem lookup misses.
The warning on Line 598 says only the devnode invalidation is lost, but if Line 585 returns None this branch never calls send_pool_name_signal(), so a successful rename can complete without any pool name_changed emission. Please make filesystem-path collection best-effort and still send the pool signal with an empty fs-path list.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/dbus/pool/pool_3_0/methods.rs` around lines 583 - 600, The current code
abandons sending the pool name signal if any filesystem path lookup fails;
change the filesystem-path collection to be best-effort so send_pool_name_signal
is always called with whatever paths were found (possibly an empty Vec). In the
Some(pool) arm (where pool.filesystems() is used), replace the filter_map chain
with an explicit loop/iteration that for each (_, fs_uuid, _) calls
read_lock.filesystem_get_path(&fs_uuid) and pushes the path into a mutable Vec
when Some(p), and logs the warn when None, then after the loop call
send_pool_name_signal(connection, &p.as_ref(), fs_paths).await so the
name_changed signal is emitted regardless of missing filesystem lookups.
mulkieran
left a comment
There was a problem hiding this comment.
@jbaublitz coderabbitai has a point, can you do what it asks?
6dc53fa to
86ec8c7
Compare
|
@mulkieran Okay this should be resolved. |
Closes #3987
Summary by CodeRabbit
Bug Fixes