Skip to content

Conversation

@mulkieran
Copy link
Member

@mulkieran mulkieran commented Nov 21, 2025

Summary by CodeRabbit

  • Dependencies

    • Switched D‑Bus backend to zbus (optional, tokio-enabled).
  • New Features

    • Full D‑Bus surface for manager, pool, filesystem and block device across revisions r0–r9.
    • Automatic udev-driven pool discovery/registration and background D‑Bus signals.
    • New D‑Bus properties and setters: user info, new physical size, filesystem size limits, rename support.
  • API Changes

    • Filesystem creation names now use a Name type; unified IPC/D‑Bus initialization and centralized register/unregister APIs.

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

@mulkieran mulkieran self-assigned this Nov 21, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Walkthrough

Replaces dbus/dbus-tree with optional zbus/zvariant and adds a zbus-based D-Bus surface: base constants, manager/pool/filesystem/blockdev R0–R9 interfaces, shared helpers/macros, UdevHandler, registration orchestration, IPC rewiring, Name-based filesystem API changes, and many property/method implementations. (44 words)

Changes

Cohort / File(s) Summary
Manifest
\Cargo.toml``
Remove dbus/dbus-tree; add optional zbus and zvariant; change dbus_enabled feature to depend on dep:zbus.
Top-level D‑Bus wiring & constants
\src/dbus/mod.rs`, `src/dbus/consts.rs``
Add create_dbus_handler, central setup for zbus Connection, exports, and constants STRATIS_BASE_PATH, STRATIS_BASE_SERVICE, OK_STRING.
Utilities & macros
\src/dbus/util.rs`, `src/dbus/macros.rs``
Add tuple/option/result converters, engine→DBus error mapping, background signal dispatchers, and handle_action! macro.
Udev / IPC handler
\src/dbus/udev.rs`, `src/stratis/ipc_support/dbus_support.rs``
Add UdevHandler with event processing and register_pool; simplify IPC setup to accept a UdevHandler and run event loop.
Manager core & registry
\src/dbus/manager/mod.rs`, `src/dbus/manager/*``
Add central Manager (path↔UUID maps), register_manager, and re-export ManagerR0..ManagerR9; per-version manager modules and registration.
Manager methods & props (versions)
\src/dbus/manager/manager_3_/.rs``
Implement versioned manager methods (list/set/unset keys, create/destroy/start/stop/unlock pools), stopped/locked pools props, and helpers across 3_0..3_9.
Pool orchestration & modules
\src/dbus/pool/mod.rs`, `src/dbus/pool/*``
Add register_pool/unregister_pool, PoolR0/PoolR9 modules, pool props, create_filesystems flows, and manager updates on register/unregister.
Pool methods
\src/dbus/pool/pool_3_0/methods.rs`, `src/dbus/pool/pool_3_6/methods.rs``
Add create/destroy/snapshot/set_name/create_filesystems_method handlers with engine calls and D-Bus registration/unregistration of filesystems.
Filesystem modules & props
\src/dbus/filesystem/*``
Add FilesystemR0..R9 modules, property helpers (created, devnode, name, pool, size, used, size_limit, merge/origin), set_name_method, registration/unregister wiring.
Blockdev modules & props
\src/dbus/blockdev/*``
Add BlockdevR0..R9 modules, property helpers (devnode, hardware/user info, init time, physical path, total/new physical size, tier), set_user_info_method, register_blockdev, and shared helpers.
Shared D‑Bus helpers & types
\src/dbus/types.rs`, `src/dbus/*/shared.rs``
Add marshalling for locked/stopped pools, ManagerR2/ManagerR8 wrappers, DbusErrorEnum, ParentPool types, and shared property accessors for pools/filesystems/blockdevs.
Registration orchestrators
\src/dbus/manager/`, `src/dbus/pool/`, `src/dbus/blockdev/*``
Sequential registration utilities for ManagerR*, PoolR*, FilesystemR*, BlockdevR* using AtomicU64-based ObjectPath generation and Manager map updates.
Engine API & implementations
\src/engine/engine.rs`, `src/engine//pool/.rs``
Change Pool::create_filesystems to accept &str and return SetCreateAction<(Name, FilesystemUuid, Sectors)>; propagate Name through sim/v1/v2/dispatch and tests.
Types & conditional DBus support
\src/engine/types/mod.rs`, `src/engine/types/keys.rs``
Introduce Name type, conditional zvariant Type/Value derives under dbus_enabled, change ClevisInfo to serde_json::Value, gate DBus derives for KeyDescription/UnlockMethod.
Runtime integration & timers
\src/stratis/run.rs`, `src/stratis/dm.rs`, `src/stratis/timer.rs`, `src/stratis/ipc_support/jsonrpc_support.rs``
Rewire IPC startup to use create_dbus_handler; thread/timer signatures now accept Connection/Manager; replace action-channel use with background signal helpers; drain udev events via try_recv.
Engine exports & lib module rename
\src/lib.rs`, `src/engine/mod.rs``
Under dbus_enabled rename module dbus_apidbus; re-export SomeLockReadGuard/SomeLockWriteGuard in engine public exports.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Runner as run.rs
    participant DBusInit as create_dbus_handler
    participant Conn as zbus::Connection
    participant Manager as Manager registry
    participant Udev as UdevHandler
    participant Engine as Engine

    Runner->>DBusInit: create_dbus_handler(engine, udev_receiver)
    DBusInit->>Conn: open system connection (STRATIS_BASE_SERVICE)
    DBusInit->>Manager: register_manager(connection, engine, manager, counter)
    Manager->>Manager: register ManagerR0..R9 at STRATIS_BASE_PATH
    DBusInit->>Udev: construct UdevHandler(connection, engine, manager, receiver, counter)
    DBusInit-->>Runner: return (connection, udev_handler, manager)

    Runner->>Udev: spawn process_udev_events
    Udev->>Engine: engine.handle_events(events)
    Engine-->>Udev: pool_infos
    Udev->>Manager: register_pool(pool_uuid)
    Manager->>Conn: register pool, filesystem, blockdev objects (sequential register calls)
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

  • Focus review areas:
    • Conditional zbus / zvariant derives, Value conversions and StratisError ↔ zbus mapping.
    • Engine API change (create_filesystems → Name) and propagation through sim/v1/v2/dispatch and tests.
    • Concurrency and correctness of Manager path↔UUID maps, register/unregister lifecycles, and AtomicU64 counter usage.
    • Signal emission correctness (send_*_background_signals) and ownership/lifetimes of Arc passed to registered objects.
    • D-Bus interface signatures and zbus attribute correctness (property emits semantics, out-args, and return marshalling).

Suggested labels

enhancement

Poem

🐇 I hopped from dbus to zbus with glee,
Registered pools and blockdevs one-two-three,
Names snug like carrots in tidy array,
Udev nudged managers to bustle and play,
A rabbit cheers — IPC is brighter today!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 79.58% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Blockdev changes' is vague and does not specify the primary change. While it refers to a real part of the changeset (blockdev-related modifications), it lacks clarity about what specific aspect of blockdev is being changed. Consider revising the title to describe the specific change more clearly, such as 'Migrate blockdev D-Bus interface to zbus' or 'Add multiple blockdev interface versions' to better convey the primary objective.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

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

Copy link

@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: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/engine/strat_engine/pool/v2.rs (1)

751-800: The review comment is accurate—remove the unused lifetime parameter from create_filesystems in v2.rs

The Pool trait in src/engine/engine.rs (lines 162–167) defines create_filesystems with no lifetime parameter, but the implementation in src/engine/strat_engine/pool/v2.rs (line 751) declares fn create_filesystems<'a>(...), which causes a trait signature mismatch. The lifetime is not used in the method body and would be a compile-time error. All other implementations (v1, dispatch, sim_engine) correctly omit the lifetime.

The fix is correct as stated in the review: remove the <'a> generic parameter from the impl method signature at line 751.

🧹 Nitpick comments (6)
src/stratis/ipc_support/jsonrpc_support.rs (1)

21-35: try_recv()-based drain correctly batches events; optional consideration on batch size

The new pattern of awaiting a single recv().await and then draining with while let Ok(event) = recv.try_recv() correctly:

  • Handles the channel-closed case via the outer recv().await returning None.
  • Batches all currently queued events into one Vec for a single engine.handle_events(events).await call.

Semantics look sound. If udev bursts can be very large, you might optionally consider capping the number of try_recv() iterations per loop to avoid extremely large batches or long single-task runs, but that’s a design/perf choice, not a correctness issue.

src/dbus/macros.rs (1)

5-12: handle_action! macro is correct; consider using Debug for broader applicability

Macro behavior (single evaluation, returning original Result) looks good. The log::info!("{}", a) line requires all Ok payload types to implement Display; for a general-purpose helper that will wrap various engine actions, using "{:?}" and a Debug bound is usually less constraining and avoids needing to implement Display on every action/result type.

src/dbus/blockdev/blockdev_3_3/props.rs (1)

10-20: new_physical_size_prop matches existing patterns; clarify the set_user_info_prop stub’s intent

The new_physical_size_prop implementation aligns with the usual (bool, String) property convention and looks correct.

set_user_info_prop is currently a no-op stub marked FIXME and allowed as dead code. If this setter is not meant to be wired into any D-Bus property yet, that’s fine; otherwise, consider either removing it until needed or implementing at least a minimal behavior (e.g., returning an error) so that accidental wiring doesn’t silently ignore updates.

src/dbus/pool/shared.rs (1)

11-39: Pool helpers look correct; consider FnOnce and clarifying try_pool_prop semantics

Implementation and error mapping are fine. Two minor ergonomic points:

  • Both helpers only invoke the closure once, so f: impl FnOnce(...) -> R would be strictly more flexible than Fn(...) -> R for callers that move captured values.
  • pool_prop and try_pool_prop currently behave identically; if this mirrors an older API, consider adding a brief comment about why both exist now, or give try_pool_prop distinct semantics so the naming conveys a real difference.
src/dbus/blockdev/shared.rs (1)

45-47: Clarify the not-found error message.

This branch still reports “filesystem” when the helper is resolving block devices, which leaks a misleading failure over D-Bus. Please update the wording.

-        .ok_or_else(|| Error::Failed(format!("No filesystem associated with UUID {bd_uuid}")))?;
+        .ok_or_else(|| Error::Failed(format!("No block device associated with UUID {bd_uuid}")))?;
src/engine/types/mod.rs (1)

58-68: Align trait derives for UUID newtypes across dbus_enabled and non‑DBus builds

Right now the uuid! macro derives Ord, PartialOrd, and Default only when dbus_enabled is set, while the non‑DBus branch omits them. That makes the public capabilities of DevUuid/FilesystemUuid/PoolUuid depend on the feature flag, which can be surprising and complicate shared generic code.

Consider deriving the same trait set in both branches (with Type gated only behind dbus_enabled) to keep these wrappers consistent across builds. For example:

-        #[cfg(not(feature = "dbus_enabled"))]
-        #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Deserialize, Serialize)]
-        $vis struct $ident(pub uuid::Uuid);
+        #[cfg(not(feature = "dbus_enabled"))]
+        #[derive(
+            Copy,
+            Clone,
+            Debug,
+            Hash,
+            Eq,
+            PartialEq,
+            Ord,
+            PartialOrd,
+            Default,
+            Deserialize,
+            Serialize,
+        )]
+        $vis struct $ident(pub uuid::Uuid);

This keeps behavior uniform while still only enabling zvariant Type and From<$ident> for Value when DBus support is compiled in.

Also applies to: 99-104

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6a4ad6 and a099d76.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (61)
  • Cargo.toml (2 hunks)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/consts.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_9/mod.rs (1 hunks)
  • src/dbus/filesystem/mod.rs (1 hunks)
  • src/dbus/filesystem/shared.rs (1 hunks)
  • src/dbus/macros.rs (1 hunks)
  • src/dbus/manager/manager_3_0/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_0/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_0/props.rs (1 hunks)
  • src/dbus/manager/manager_3_1/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_2/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_2/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_2/props.rs (1 hunks)
  • src/dbus/manager/manager_3_8/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_8/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_9/mod.rs (1 hunks)
  • src/dbus/manager/mod.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
  • src/dbus/pool/pool_3_0/mod.rs (1 hunks)
  • src/dbus/pool/pool_3_0/props.rs (1 hunks)
  • src/dbus/pool/pool_3_6/methods.rs (1 hunks)
  • src/dbus/pool/pool_3_6/mod.rs (1 hunks)
  • src/dbus/pool/pool_3_9/mod.rs (1 hunks)
  • src/dbus/pool/shared.rs (1 hunks)
  • src/dbus/types.rs (1 hunks)
  • src/dbus/udev.rs (1 hunks)
  • src/dbus/util.rs (1 hunks)
  • src/engine/engine.rs (1 hunks)
  • src/engine/mod.rs (1 hunks)
  • src/engine/sim_engine/pool.rs (5 hunks)
  • src/engine/strat_engine/pool/dispatch.rs (1 hunks)
  • src/engine/strat_engine/pool/v1.rs (2 hunks)
  • src/engine/strat_engine/pool/v2.rs (2 hunks)
  • src/engine/types/actions.rs (2 hunks)
  • src/engine/types/keys.rs (4 hunks)
  • src/engine/types/mod.rs (4 hunks)
  • src/lib.rs (1 hunks)
  • src/stratis/dm.rs (4 hunks)
  • src/stratis/errors.rs (3 hunks)
  • src/stratis/ipc_support/dbus_support.rs (1 hunks)
  • src/stratis/ipc_support/jsonrpc_support.rs (2 hunks)
  • src/stratis/run.rs (2 hunks)
  • src/stratis/timer.rs (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/manager/manager_3_8/mod.rs
  • src/dbus/manager/manager_3_0/props.rs
  • src/dbus/pool/pool_3_0/mod.rs
  • src/dbus/pool/pool_3_0/props.rs
  • src/dbus/blockdev/shared.rs
  • src/dbus/manager/manager_3_8/methods.rs
  • src/engine/engine.rs
  • src/dbus/pool/shared.rs
  • src/dbus/pool/pool_3_6/mod.rs
  • src/dbus/manager/manager_3_2/methods.rs
  • src/engine/strat_engine/pool/v1.rs
  • src/dbus/types.rs
  • src/dbus/pool/pool_3_6/methods.rs
  • src/engine/types/keys.rs
  • src/engine/strat_engine/pool/dispatch.rs
  • src/stratis/ipc_support/dbus_support.rs
  • src/dbus/manager/mod.rs
  • src/stratis/dm.rs
  • src/dbus/pool/mod.rs
  • src/engine/strat_engine/pool/v2.rs
  • src/dbus/pool/pool_3_9/mod.rs
  • src/dbus/util.rs
  • src/engine/sim_engine/pool.rs
  • src/stratis/timer.rs
  • src/dbus/manager/manager_3_9/mod.rs
  • src/dbus/manager/manager_3_2/mod.rs
  • src/dbus/manager/manager_3_0/methods.rs
  • src/dbus/manager/manager_3_1/mod.rs
  • src/dbus/manager/manager_3_0/mod.rs
📚 Learning: 2025-09-05T14:32:42.528Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3898
File: src/engine/sim_engine/pool.rs:934-948
Timestamp: 2025-09-05T14:32:42.528Z
Learning: In src/engine/sim_engine/pool.rs, the start_encrypt_pool method intentionally creates a SizedKeyMemory with 1 byte allocated but 0 length reported - this is to avoid NULL pointer issues while simulating an empty key slice in the sim engine.

Applied to files:

  • src/dbus/manager/manager_3_8/mod.rs
  • src/dbus/manager/manager_3_8/methods.rs
  • src/dbus/manager/manager_3_2/methods.rs
  • src/engine/strat_engine/pool/dispatch.rs
  • src/engine/sim_engine/pool.rs
🧬 Code graph analysis (52)
src/dbus/filesystem/filesystem_3_0/mod.rs (1)
src/dbus/filesystem/filesystem_3_0/props.rs (1)
  • name_prop (7-9)
src/dbus/macros.rs (1)
src/bin/utils/generators/lib.rs (1)
  • log (26-28)
src/dbus/manager/manager_3_8/mod.rs (1)
src/dbus/manager/manager_3_8/methods.rs (1)
  • create_pool_method (32-130)
src/dbus/manager/manager_3_0/props.rs (1)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/pool/pool_3_0/mod.rs (1)
src/dbus/pool/pool_3_0/props.rs (4)
  • allocated_prop (29-31)
  • name_prop (12-15)
  • size_prop (17-19)
  • used_prop (21-27)
src/dbus/filesystem/shared.rs (3)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/filesystem/filesystem_3_9/mod.rs (1)
  • Name (54-56)
src/dbus/manager/manager_3_2/methods.rs (1)
  • guard (72-76)
src/dbus/pool/pool_3_0/props.rs (2)
src/dbus/util.rs (1)
  • option_to_tuple (36-41)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/filesystem/filesystem_3_0/props.rs (2)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/filesystem/filesystem_3_9/mod.rs (1)
  • Name (54-56)
src/engine/types/actions.rs (2)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/filesystem/filesystem_3_9/mod.rs (1)
  • Name (54-56)
src/dbus/manager/manager_3_8/methods.rs (5)
src/dbus/pool/mod.rs (2)
  • pool (53-53)
  • register_pool (26-68)
src/dbus/util.rs (7)
  • engine_to_dbus_err_tuple (67-73)
  • tuple_to_option (27-33)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/engine/types/keys.rs (12)
  • new (46-48)
  • new (126-144)
  • new (278-282)
  • new (728-730)
  • from (251-258)
  • from (645-661)
  • from (669-677)
  • from (813-820)
  • try_from (499-521)
  • try_from (705-713)
  • try_from (719-721)
  • uuid (732-734)
src/engine/types/mod.rs (8)
  • default (565-567)
  • new (178-180)
  • new (277-279)
  • new (310-322)
  • new (375-377)
  • from (291-296)
  • from (358-368)
  • try_from (573-593)
src/stratis/errors.rs (8)
  • from (165-167)
  • from (171-173)
  • from (177-179)
  • from (183-185)
  • from (189-191)
  • from (195-197)
  • from (201-203)
  • from (207-209)
src/stratis/errors.rs (2)
src/dbus_api/blockdev/blockdev_3_0/api.rs (9)
  • f (34-34)
  • f (41-41)
  • f (48-48)
  • f (57-57)
  • f (64-64)
  • f (71-71)
  • f (78-78)
  • f (85-85)
  • f (92-92)
src/dbus_api/filesystem/filesystem_3_0/api.rs (3)
  • f (33-33)
  • f (40-40)
  • f (47-47)
src/engine/engine.rs (7)
src/engine/sim_engine/pool.rs (1)
  • create_filesystems (221-263)
src/engine/strat_engine/pool/dispatch.rs (1)
  • create_filesystems (111-121)
src/engine/strat_engine/pool/v1.rs (1)
  • create_filesystems (846-895)
src/engine/strat_engine/pool/v2.rs (1)
  • create_filesystems (751-800)
src/dbus_api/pool/pool_3_0/methods.rs (1)
  • create_filesystems (29-129)
src/dbus_api/pool/pool_3_6/methods.rs (1)
  • create_filesystems (21-130)
src/engine/shared.rs (1)
  • specs (248-256)
src/dbus/pool/shared.rs (1)
src/engine/engine.rs (1)
  • get_pool (487-490)
src/dbus/pool/pool_3_6/mod.rs (1)
src/dbus/pool/pool_3_6/methods.rs (1)
  • create_filesystems_method (25-124)
src/dbus/udev.rs (1)
src/dbus/pool/mod.rs (2)
  • pool (53-53)
  • register_pool (26-68)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
src/dbus_api/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info (16-73)
src/dbus/manager/manager_3_2/methods.rs (3)
src/dbus/filesystem/mod.rs (1)
  • register_filesystem (25-43)
src/dbus/pool/mod.rs (1)
  • unregister_pool (70-84)
src/dbus/util.rs (9)
  • engine_to_dbus_err_tuple (67-73)
  • send_locked_pools_signals (123-145)
  • send_stopped_pools_signals (147-160)
  • tuple_to_option (27-33)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/dbus/filesystem/mod.rs (4)
src/dbus/util.rs (5)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/dbus/pool/pool_3_9/mod.rs (2)
  • connection (73-73)
  • register (49-67)
src/dbus/manager/manager_3_0/mod.rs (1)
  • register (53-70)
src/dbus/filesystem/filesystem_3_9/mod.rs (1)
  • register (30-41)
src/engine/strat_engine/pool/v1.rs (4)
src/engine/engine.rs (3)
  • create_filesystems (162-167)
  • size (93-93)
  • size (122-122)
src/engine/sim_engine/pool.rs (2)
  • create_filesystems (221-263)
  • new (58-77)
src/engine/strat_engine/pool/dispatch.rs (1)
  • create_filesystems (111-121)
src/engine/strat_engine/pool/v2.rs (1)
  • create_filesystems (751-800)
src/dbus/types.rs (1)
src/dbus/util.rs (1)
  • result_option_to_tuple (50-63)
src/dbus/pool/pool_3_6/methods.rs (3)
src/dbus/filesystem/mod.rs (1)
  • register_filesystem (25-43)
src/engine/engine.rs (2)
  • filesystems (317-317)
  • create_filesystems (162-167)
src/engine/types/actions.rs (16)
  • new (235-237)
  • new (311-313)
  • new (586-589)
  • changed (35-35)
  • changed (54-59)
  • changed (176-181)
  • changed (200-205)
  • changed (262-273)
  • changed (327-333)
  • changed (396-401)
  • changed (518-523)
  • changed (606-612)
  • changed (675-680)
  • changed (724-729)
  • changed (759-764)
  • changed (829-834)
src/engine/types/keys.rs (2)
src/engine/strat_engine/liminal/device_info.rs (11)
  • into (74-101)
  • into (194-221)
  • into (268-273)
  • into (773-775)
  • into (804-806)
  • from (61-68)
  • from (125-133)
  • from (182-188)
  • from (257-262)
  • from (472-480)
  • from (484-492)
src/dbus/types.rs (2)
  • from (47-110)
  • from (204-210)
src/engine/strat_engine/pool/dispatch.rs (6)
src/engine/engine.rs (1)
  • create_filesystems (162-167)
src/engine/sim_engine/pool.rs (1)
  • create_filesystems (221-263)
src/engine/strat_engine/pool/v1.rs (1)
  • create_filesystems (846-895)
src/engine/strat_engine/pool/v2.rs (1)
  • create_filesystems (751-800)
src/dbus_api/pool/pool_3_0/methods.rs (1)
  • create_filesystems (29-129)
src/engine/shared.rs (1)
  • specs (248-256)
src/stratis/ipc_support/dbus_support.rs (4)
src/stratis/ipc_support/jsonrpc_support.rs (1)
  • setup (39-56)
src/engine/engine.rs (1)
  • pools (507-507)
src/engine/strat_engine/engine.rs (2)
  • pools (201-203)
  • pools (739-741)
src/engine/sim_engine/engine.rs (1)
  • pools (300-302)
src/dbus/manager/mod.rs (7)
src/dbus/types.rs (2)
  • from (47-110)
  • from (204-210)
src/dbus/util.rs (5)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/dbus/pool/pool_3_9/mod.rs (2)
  • connection (73-73)
  • register (49-67)
src/dbus/manager/manager_3_2/mod.rs (1)
  • register (61-78)
src/dbus/manager/manager_3_1/mod.rs (1)
  • register (51-68)
src/dbus/manager/manager_3_0/mod.rs (1)
  • register (53-70)
src/dbus/manager/manager_3_9/mod.rs (1)
  • register (43-60)
src/dbus/blockdev/blockdev_3_6/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/stratis/dm.rs (1)
src/dbus/util.rs (7)
  • send_fs_background_signals (115-121)
  • send_pool_background_signals (76-112)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/dbus/pool/mod.rs (3)
src/dbus/blockdev/mod.rs (1)
  • register_blockdev (43-138)
src/dbus/udev.rs (2)
  • register_pool (62-72)
  • new (25-39)
src/dbus/pool/pool_3_9/mod.rs (5)
  • connection (73-73)
  • register (49-67)
  • Uuid (98-100)
  • new (33-47)
  • unregister (69-75)
src/dbus/blockdev/blockdev_3_9/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/engine/strat_engine/pool/v2.rs (5)
src/engine/shared.rs (1)
  • specs (248-256)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/filesystem/filesystem_3_9/mod.rs (1)
  • Name (54-56)
src/engine/types/mod.rs (4)
  • new (178-180)
  • new (277-279)
  • new (310-322)
  • new (375-377)
src/engine/types/actions.rs (3)
  • new (235-237)
  • new (311-313)
  • new (586-589)
src/dbus/blockdev/blockdev_3_8/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_1/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/mod.rs (8)
  • new (31-37)
  • register (39-50)
  • SetUserInfo (57-59)
  • Devnode (63-65)
  • UserInfo (81-83)
  • Pool (93-95)
  • Uuid (99-101)
  • Tier (105-107)
src/dbus/blockdev/blockdev_3_4/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_2/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/engine/types/mod.rs (3)
src/engine/types/keys.rs (5)
  • uuid (732-734)
  • from (251-258)
  • from (645-661)
  • from (669-677)
  • from (813-820)
src/dbus/pool/pool_3_9/mod.rs (2)
  • Uuid (98-100)
  • Name (104-106)
src/dbus/types.rs (1)
  • from (47-110)
src/dbus/pool/pool_3_9/mod.rs (5)
src/dbus/pool/pool_3_0/props.rs (4)
  • allocated_prop (29-31)
  • name_prop (12-15)
  • size_prop (17-19)
  • used_prop (21-27)
src/dbus/pool/pool_3_6/methods.rs (1)
  • create_filesystems_method (25-124)
src/dbus/pool/shared.rs (2)
  • pool_prop (21-29)
  • try_pool_prop (31-39)
src/dbus/filesystem/filesystem_3_9/mod.rs (4)
  • new (22-28)
  • register (30-41)
  • Uuid (48-50)
  • Name (54-56)
src/dbus/manager/manager_3_9/mod.rs (2)
  • new (29-41)
  • register (43-60)
src/dbus/util.rs (2)
src/stratis/errors.rs (9)
  • fmt (93-159)
  • from (165-167)
  • from (171-173)
  • from (177-179)
  • from (183-185)
  • from (189-191)
  • from (195-197)
  • from (201-203)
  • from (207-209)
src/dbus/types.rs (2)
  • from (47-110)
  • from (204-210)
src/dbus/mod.rs (5)
src/dbus/util.rs (7)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
  • send_fs_background_signals (115-121)
  • send_pool_background_signals (76-112)
src/dbus/blockdev/mod.rs (1)
  • register_blockdev (43-138)
src/dbus/manager/mod.rs (1)
  • register_manager (112-127)
src/dbus/udev.rs (1)
  • new (25-39)
src/engine/structures/lock.rs (1)
  • new_shared (84-86)
src/engine/sim_engine/pool.rs (9)
src/engine/engine.rs (3)
  • create_filesystems (162-167)
  • size (93-93)
  • size (122-122)
src/engine/strat_engine/pool/dispatch.rs (1)
  • create_filesystems (111-121)
src/engine/strat_engine/pool/v1.rs (1)
  • create_filesystems (846-895)
src/engine/strat_engine/pool/v2.rs (1)
  • create_filesystems (751-800)
src/dbus_api/pool/pool_3_0/methods.rs (1)
  • create_filesystems (29-129)
src/dbus_api/pool/pool_3_6/methods.rs (1)
  • create_filesystems (21-130)
src/engine/shared.rs (1)
  • specs (248-256)
src/engine/types/mod.rs (6)
  • new (178-180)
  • new (277-279)
  • new (310-322)
  • new (375-377)
  • as_ref (188-190)
  • as_ref (412-417)
src/engine/types/actions.rs (3)
  • new (235-237)
  • new (311-313)
  • new (586-589)
src/dbus/blockdev/blockdev_3_0/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/stratis/timer.rs (1)
src/dbus/util.rs (7)
  • send_fs_background_signals (115-121)
  • send_pool_background_signals (76-112)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/dbus/blockdev/blockdev_3_3/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_5/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_7/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/mod.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • register (39-50)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • register (35-46)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • register (35-46)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • register (39-50)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • register (37-48)
src/dbus/manager/manager_3_9/mod.rs (2)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_8/methods.rs (4)
  • create_pool_method (32-130)
  • devs (47-47)
  • key_desc (48-51)
  • clevis_info (52-52)
src/dbus/filesystem/filesystem_3_9/mod.rs (2)
src/dbus/filesystem/filesystem_3_0/props.rs (1)
  • name_prop (7-9)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (11-27)
src/dbus/manager/manager_3_2/mod.rs (4)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_2/methods.rs (3)
  • refresh_state_method (202-207)
  • start_pool_method (28-129)
  • stop_pool_method (131-200)
src/dbus/manager/manager_3_2/props.rs (1)
  • stopped_pools_prop (12-16)
src/dbus/util.rs (5)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/dbus/manager/manager_3_0/methods.rs (3)
src/dbus/pool/mod.rs (3)
  • pool (53-53)
  • register_pool (26-68)
  • unregister_pool (70-84)
src/dbus/util.rs (8)
  • engine_to_dbus_err_tuple (67-73)
  • send_locked_pools_signals (123-145)
  • tuple_to_option (27-33)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/engine/types/keys.rs (13)
  • new (46-48)
  • new (126-144)
  • new (278-282)
  • new (728-730)
  • key_desc (84-89)
  • clevis_info (91-96)
  • clevis_info (628-641)
  • from (251-258)
  • from (645-661)
  • from (669-677)
  • from (813-820)
  • new_legacy (105-124)
  • uuid (732-734)
src/stratis/run.rs (5)
src/dbus/mod.rs (1)
  • create_dbus_handler (34-55)
src/stratis/ipc_support/dbus_support.rs (1)
  • setup (23-51)
src/stratis/ipc_support/jsonrpc_support.rs (1)
  • setup (39-56)
src/stratis/dm.rs (1)
  • dm_event_thread (36-110)
src/stratis/timer.rs (1)
  • run_timers (74-88)
src/dbus/manager/manager_3_1/mod.rs (2)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/util.rs (5)
  • connection (84-86)
  • connection (97-99)
  • connection (126-128)
  • connection (135-137)
  • connection (150-152)
src/dbus/manager/manager_3_0/mod.rs (4)
src/dbus/manager/manager_3_0/methods.rs (7)
  • create_pool_method (99-157)
  • destroy_pool_method (159-206)
  • list_keys_method (34-44)
  • set_key_method (46-74)
  • unlock_pool_method (208-236)
  • unset_key_method (76-96)
  • devs (111-111)
src/dbus/manager/manager_3_0/props.rs (2)
  • locked_pools_prop (16-18)
  • version_prop (12-14)
src/dbus/pool/pool_3_9/mod.rs (3)
  • new (33-47)
  • connection (73-73)
  • register (49-67)
src/dbus/manager/manager_3_9/mod.rs (3)
  • new (29-41)
  • register (43-60)
  • CreatePool (67-91)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: python-based-tests
  • GitHub Check: checks (make -f Makefile check-typos, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile fmt-ci, 1.91.0, rustfmt)
🔇 Additional comments (22)
src/stratis/ipc_support/jsonrpc_support.rs (1)

5-5: Arc import is appropriate and matches existing usage

The added use std::sync::Arc; cleanly aligns with the Arc<dyn Engine> signatures and improves readability over fully-qualified paths. No issues here.

src/engine/mod.rs (1)

18-18: Re-exporting SomeLockReadGuard looks appropriate

Exposing SomeLockReadGuard alongside the other guard types is consistent with existing exports and supports the new pool helpers without changing behavior.

src/dbus/blockdev/blockdev_3_0/methods.rs (1)

13-53: Async set_user_info_method port looks consistent with prior behavior

Lookup, action dispatch, and mapping of RenameAction and errors back to ((bool, String), u16, String) match the old dbus_api logic, and there are no .awaits while holding the mutable guard. This method looks good as-is.

src/dbus/manager/manager_3_2/methods.rs (1)

131-207: Stop/refresh manager methods look consistent and non-blocking

The stop_pool_method and refresh_state_method implementations cleanly map engine results and errors into the D-Bus tuples and don’t appear to hold engine or manager locks across await points. Behavior for StopAction::{Identity, Stopped, Partial} and error mapping via engine_to_dbus_err_tuple looks coherent.

src/stratis/errors.rs (2)

231-242: LGTM!

The From trait implementations for the new zbus error types are correct and follow the established pattern.


54-56: No changes needed — zbus::Error is already optimized for cheap cloning.

zbus::Error implements Clone with several variants using Arc/Box internally (InputOutput is Arc, FDO is Box) and Message is Arc-backed, making cloning already cheap without additional Arc wrapping. The removal of Arc from the Dbus variant is intentional and correct, not an inconsistency. Other error types like Io and Serde retain Arc because their underlying types (std::io::Error, etc.) are expensive to clone — zbus::Error doesn't have this problem.

src/dbus/manager/manager_3_2/props.rs (1)

12-16: LGTM!

The async property function correctly wraps the engine's stopped_pools() result in a ManagerR2 type for D-Bus exposure. The implementation is clean and follows the established pattern.

src/lib.rs (1)

42-42: Breaking change: public module renamed.

The public module has been renamed from dbus_api to dbus. This is a breaking change that will affect all consumers importing from the dbus_api module path. Ensure this is documented in release notes and migration guides.

src/dbus/pool/pool_3_6/mod.rs (1)

5-7: LGTM!

The module structure follows the established pattern for versioned D-Bus interfaces, with a clear re-export of the create_filesystems_method from the methods submodule.

src/dbus/filesystem/filesystem_3_0/mod.rs (1)

5-7: LGTM!

The module organization is clean and consistent with the versioned D-Bus interface pattern used throughout the codebase.

src/dbus/manager/manager_3_8/mod.rs (1)

5-7: LGTM!

The module follows the established versioned interface pattern for manager components, with a straightforward re-export of the create_pool_method.

src/dbus/pool/pool_3_0/mod.rs (1)

5-7: LGTM!

The module correctly re-exports the pool property accessors (allocated_prop, name_prop, size_prop, used_prop) following the established pattern for versioned D-Bus interfaces.

src/dbus/filesystem/filesystem_3_0/props.rs (1)

7-9: LGTM!

The name_prop function is a simple pass-through that returns the input Name. The unused parameters (FilesystemUuid and &dyn Filesystem) are intentionally ignored, which is appropriate for maintaining a consistent function signature across property accessors.

src/dbus/consts.rs (1)

1-7: Centralizing DBus constants looks good

The base path, service name, and OK_STRING are clearly defined and ready to be reused across DBus modules; no issues from an API or correctness standpoint.

src/dbus/manager/manager_3_0/props.rs (1)

12-18: Thin manager property helpers are correct

version_prop and locked_pools_prop are simple, side-effect-free accessors that cleanly expose engine state for DBus without adding policy; implementation looks fine.

src/engine/strat_engine/pool/dispatch.rs (1)

111-121: Dispatch for create_filesystems matches the updated trait

The AnyPool implementation now matches the trait’s Name-based result type and updated specs signature, and simply forwards to V1/V2 without changing behavior; all good.

src/dbus/filesystem/shared.rs (1)

11-27: Filesystem lookup helper is well-structured

The helper correctly handles both “pool not found” and “filesystem not found” cases with clear Error::Failed messages, and confines the filesystem borrow to the callback scope; this looks solid.

src/dbus/filesystem/mod.rs (1)

25-43: Filesystem registration helper is consistent with pool/manager registration

The helper cleanly constructs a unique object path under STRATIS_BASE_PATH, delegates registration to FilesystemR9::register, and then records the filesystem in Manager under a write lock. This matches the existing registration patterns for pools/managers and looks correct.

src/stratis/timer.rs (1)

22-61: DBus background signal wiring in timers looks consistent

Passing Arc<Connection> and Lockable<Arc<RwLock<Manager>>> through check_pool_and_fs and process_checks and using send_pool_background_signals / send_fs_background_signals is clean and correctly gated behind dbus_enabled. Cloning Lockable per loop iteration is cheap and keeps the API straightforward; non‑DBus builds retain the previous behavior. No issues spotted here.

Also applies to: 74-85

src/dbus/blockdev/blockdev_3_9/mod.rs (1)

22-48: BlockdevR9 interface and registration align with existing patterns

The BlockdevR9 struct, its register function, and all property getters cleanly reuse blockdev_prop and the existing prop helpers. The interface name, signatures, and emits‑changed annotations are consistent with the other BlockdevR* implementations. I don’t see issues here.

Also applies to: 51-151

src/dbus/manager/mod.rs (1)

34-110: Manager path/UUID bookkeeping and registration look correct

The bidirectional maps for pools, filesystems, and blockdevs are updated symmetrically in the add/get/remove methods, and register_manager wires all ManagerR* variants plus ObjectManager at STRATIS_BASE_PATH in a straightforward way. Assuming callers consistently use the provided add/remove helpers, this should behave as intended.

Also applies to: 112-127

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

22-48: BlockdevR6 implementation is consistent with the other blockdev versions

The BlockdevR6 struct, register method, and property getters mirror the existing BlockdevR* pattern and correctly reuse blockdev_prop plus the shared prop helpers. The interface name and signatures are appropriate for r6. No issues found here.

Also applies to: 51-151

Comment on lines 28 to 110
pub async fn start_pool_method<'a>(
engine: &Arc<dyn Engine>,
connection: &Arc<Connection>,
manager: &Lockable<Arc<RwLock<Manager>>>,
counter: &Arc<AtomicU64>,
pool_uuid: PoolUuid,
unlock_method_tuple: (bool, UnlockMethod),
) -> (
(
bool,
(ObjectPath<'a>, Vec<ObjectPath<'a>>, Vec<ObjectPath<'a>>),
),
u16,
String,
) {
let default_return = (
false,
(ObjectPath::default(), Vec::default(), Vec::default()),
);

let unlock_method = tuple_to_option(unlock_method_tuple);

match handle_action!(
engine
.start_pool(
PoolIdentifier::Uuid(pool_uuid),
TokenUnlockMethod::from(unlock_method),
None,
false
)
.await
) {
Ok(StartAction::Started(_)) => {
let guard = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
Some(g) => g,
None => {
return (
default_return,
DbusErrorEnum::ERROR as u16,
format!("No pool found for newly started pool with UUID {pool_uuid}"),
);
}
};
let mut fs_paths = Vec::default();
for fs_uuid in guard
.filesystems()
.into_iter()
.map(|(_, fs_uuid, _)| fs_uuid)
.collect::<Vec<_>>()
{
let fs_path = match register_filesystem(
engine, connection, manager, counter, pool_uuid, fs_uuid,
)
.await
{
Ok(fp) => fp,
Err(e) => {
let (rc, rs) = engine_to_dbus_err_tuple(&e);
return (default_return, rc, rs);
}
};
fs_paths.push(fs_path);
}
let (pool_path, dev_paths) =
match register_pool(engine, connection, manager, counter, pool_uuid).await {
Ok(pp) => pp,
Err(e) => {
let (rc, rs) = engine_to_dbus_err_tuple(&e);
return (default_return, rc, rs);
}
};

if guard.is_encrypted() {
if let Err(e) = send_locked_pools_signals(connection).await {
warn!(
"Failed to send signals for changed properties for the Manager interfaces: {e}"
);
}
}
if let Err(e) = send_stopped_pools_signals(connection).await {
warn!(
"Failed to send signals for changed properties for the Manager interfaces: {e}"
);
}

(
(true, (pool_path, dev_paths, fs_paths)),
DbusErrorEnum::OK as u16,
OK_STRING.to_string(),
)
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid holding SomeLockReadGuard across await points in start_pool_method

In the StartAction::Started(_) branch, the guard from engine.get_pool(...) is kept in scope while you:

  • await inside register_filesystem(...) in the loop,
  • await in register_pool(...),
  • await in send_locked_pools_signals / send_stopped_pools_signals.

If SomeLockReadGuard is a real read-lock on engine/pool state (as its name suggests), this means you’re holding that lock across multiple async calls, which can lead to deadlocks or at least unnecessary contention if any of those operations try to touch engine state themselves.

You can avoid this by extracting the data you need (filesystem UUIDs and is_encrypted flag) in a small inner scope, then dropping the guard before any awaits:

-        Ok(StartAction::Started(_)) => {
-            let guard = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
-                Some(g) => g,
-                None => {
-                    return (
-                        default_return,
-                        DbusErrorEnum::ERROR as u16,
-                        format!("No pool found for newly started pool with UUID {pool_uuid}"),
-                    );
-                }
-            };
-            let mut fs_paths = Vec::default();
-            for fs_uuid in guard
-                .filesystems()
-                .into_iter()
-                .map(|(_, fs_uuid, _)| fs_uuid)
-                .collect::<Vec<_>>()
-            {
+        Ok(StartAction::Started(_)) => {
+            let (is_encrypted, fs_uuids) = {
+                let guard = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
+                    Some(g) => g,
+                    None => {
+                        return (
+                            default_return,
+                            DbusErrorEnum::ERROR as u16,
+                            format!(
+                                "No pool found for newly started pool with UUID {pool_uuid}"
+                            ),
+                        );
+                    }
+                };
+                let fs_uuids = guard
+                    .filesystems()
+                    .into_iter()
+                    .map(|(_, fs_uuid, _)| fs_uuid)
+                    .collect::<Vec<_>>();
+                (guard.is_encrypted(), fs_uuids)
+            };
+
+            let mut fs_paths = Vec::default();
+            for fs_uuid in fs_uuids {
                 let fs_path = match register_filesystem(
                     engine, connection, manager, counter, pool_uuid, fs_uuid,
                 )
@@ -99,9 +121,9 @@
                     }
                 };
 
-            if guard.is_encrypted() {
+            if is_encrypted {
                 if let Err(e) = send_locked_pools_signals(connection).await {
                     warn!(
                         "Failed to send signals for changed properties for the Manager interfaces: {e}"
                     );
                 }
             }

This keeps the behavior the same while ensuring the guard (and any underlying lock) is released before performing the async registrations and signaling.

@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/stratis-storage-stratisd-3937-copr_pull
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Copy link

@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: 1

♻️ Duplicate comments (3)
src/dbus/manager/manager_3_2/methods.rs (1)

60-111: Avoid holding the pool guard across multiple await points in start_pool_method

In the StartAction::Started(_) arm, the guard from engine.get_pool(...) is kept alive while you:

  • loop and await inside register_filesystem(...),
  • await in register_pool(...),
  • await in send_locked_pools_signals / send_stopped_pools_signals.

If that guard encapsulates a lock on engine/pool state (which is likely), this pattern can cause unnecessary contention or even deadlocks if any of those helpers also need engine/pool locks.

You can pull the data you need under a short‑lived scope and drop the guard before the first await, e.g.:

-        Ok(StartAction::Started(_)) => {
-            let guard = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
-                Some(g) => g,
-                None => {
-                    return (
-                        default_return,
-                        DbusErrorEnum::ERROR as u16,
-                        format!("No pool found for newly started pool with UUID {pool_uuid}"),
-                    );
-                }
-            };
-            let mut fs_paths = Vec::default();
-            for fs_uuid in guard
-                .filesystems()
-                .into_iter()
-                .map(|(_, fs_uuid, _)| fs_uuid)
-                .collect::<Vec<_>>()
-            {
+        Ok(StartAction::Started(_)) => {
+            let (is_encrypted, fs_uuids) = {
+                let guard = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
+                    Some(g) => g,
+                    None => {
+                        return (
+                            default_return,
+                            DbusErrorEnum::ERROR as u16,
+                            format!(
+                                "No pool found for newly started pool with UUID {pool_uuid}"
+                            ),
+                        );
+                    }
+                };
+                let fs_uuids = guard
+                    .filesystems()
+                    .into_iter()
+                    .map(|(_, fs_uuid, _)| fs_uuid)
+                    .collect::<Vec<_>>();
+                (guard.is_encrypted(), fs_uuids)
+            };
+
+            let mut fs_paths = Vec::default();
+            for fs_uuid in fs_uuids {
                 let fs_path = match register_filesystem(
                     engine, connection, manager, counter, pool_uuid, fs_uuid,
                 )
@@ -100,7 +123,7 @@
-            }
-            let (pool_path, dev_paths) =
+            }
+            let (pool_path, dev_paths) =
                 match register_pool(engine, connection, manager, counter, pool_uuid).await {
                     Ok(pp) => pp,
                     Err(e) => {
@@ -108,7 +131,7 @@
                         return (default_return, rc, rs);
                     }
                 };
-
-            if guard.is_encrypted() {
+
+            if is_encrypted {

This preserves behavior while ensuring the guard (and any underlying lock) is released before performing the async work.

src/dbus/pool/mod.rs (1)

33-67: Unregister PoolR9 on pool-lookup failure and drop the pool guard before awaiting

If engine.get_pool(PoolIdentifier::Uuid(pool_uuid)) returns None, we currently return an error but leave the PoolR9 object registered on the D-Bus connection, which corrupts the object-server view. We also keep the pool guard alive across the register_blockdev awaits. Both issues were already raised in an earlier review and are still present.

You can address both with a small restructuring:

  • Unregister PoolR9 before returning on the None branch.
  • Bind the pool in a let pool = match ... expression, extract the blockdev UUIDs, drop(pool), then perform the async blockdev registrations.

For example:

-    PoolR9::register(
-        engine,
-        connection,
-        manager,
-        counter,
-        path.clone(),
-        pool_uuid,
-    )
-    .await?;
-
-    match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
-        Some(pool) => {
-            manager.write().await.add_pool(&path, pool_uuid);
-
-            let mut bd_paths = Vec::new();
-            let bd_uuids = pool.blockdevs().into_iter().map(|(u, _, _)| u).collect::<Vec<_>>();
-            for dev_uuid in bd_uuids {
-                match register_blockdev(engine, connection, manager, counter, pool_uuid, dev_uuid).await {
-                    Ok(op) => bd_paths.push(op),
-                    Err(_) => {
-                        warn!("Unable to register object path for blockdev with UUID {dev_uuid} belonging to pool {pool_uuid} on the D-Bus");
-                    },
-                }
-            }
-            Ok((path, bd_paths))
-        }
-        None => {
-            Err(StratisError::Msg(format!("Pool with {pool_uuid} was successfully started but appears to have been removed before it could be exposed on the D-Bus")))
-        }
-    }
+    PoolR9::register(
+        engine,
+        connection,
+        manager,
+        counter,
+        path.clone(),
+        pool_uuid,
+    )
+    .await?;
+
+    let pool = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
+        Some(pool) => pool,
+        None => {
+            let _ = PoolR9::unregister(connection, path.clone()).await;
+            return Err(StratisError::Msg(format!(
+                "Pool with {pool_uuid} was successfully started but appears to have been removed before it could be exposed on the D-Bus"
+            )));
+        }
+    };
+
+    manager.write().await.add_pool(&path, pool_uuid);
+
+    let mut bd_paths = Vec::new();
+    let bd_uuids = pool
+        .blockdevs()
+        .into_iter()
+        .map(|(u, _, _)| u)
+        .collect::<Vec<_>>();
+    drop(pool);
+
+    for dev_uuid in bd_uuids {
+        match register_blockdev(engine, connection, manager, counter, pool_uuid, dev_uuid).await {
+            Ok(op) => bd_paths.push(op),
+            Err(_) => {
+                warn!(
+                    "Unable to register object path for blockdev with UUID {dev_uuid} belonging to pool {pool_uuid} on the D-Bus"
+                );
+            },
+        }
+    }
+
+    Ok((path, bd_paths))
src/dbus/blockdev/blockdev_3_0/props.rs (1)

28-31: pool_prop should return the real pool object path, not /

ObjectPath::default() serializes to /, so every caller of the Pool property sees the D-Bus root path instead of the block device’s owning pool. That makes the Pool property essentially useless for clients trying to navigate back to the pool interface.

This was already called out and is still present; it should be fixed by deriving the actual pool object path from the parent pool UUID/manager state instead of returning a placeholder.

🧹 Nitpick comments (9)
src/dbus/blockdev/blockdev_3_3/props.rs (1)

10-20: new_physical_size_prop matches existing prop-helper patterns; stub setter is fine as a placeholder

The new_physical_size_prop implementation is consistent with the other BlockDev property helpers (Option → (bool, String) via option_to_tuple) and looks correct. The set_user_info_prop stub is harmless while unused; just keep the FIXME in mind when wiring a set_UserInfo method later.

src/dbus/blockdev/blockdev_3_8/mod.rs (1)

20-151: BlockdevR8 interface and registration look consistent with the other blockdev versions

Struct layout, register wiring, and all exposed properties correctly reuse the shared helpers (blockdev_prop, uuid_prop, new_physical_size_prop, etc.) and follow the same D-Bus patterns as the existing Rk variants. The commented‑out set_UserInfo block aligns with the stub setter and can be enabled later without impacting current behavior.

src/dbus/manager/manager_3_5/mod.rs (1)

34-171: ManagerR5 wiring and D-Bus surface are consistent with the other ManagerRk variants

The struct, register helper, and all exposed D-Bus methods cleanly delegate to the shared helpers (*_method, version_prop, stopped_pools_prop) and reuse the existing engine/manager/counter state. Using types::ManagerR2<StoppedPoolsInfo> for StoppedPools matches the marshalling helpers in dbus/types.rs. No issues from a correctness or concurrency standpoint.

src/dbus/types.rs (1)

33-216: Double‑check inner Dict value signatures vs. the types you’re adding

For both LockedPoolsInfo and stopped_pools_to_value you construct inner dicts as:

let mut dict = Dict::new(&Signature::Str, &Signature::Variant);

but then add values like:

  • result_option_to_tuple(...)(bool, Value<'_>),
  • info.devices.iter().map(...).collect::<Vec<_>>()Vec<HashMap<String, Value>>.

Given the declared value signature is Variant, it’s not obvious that these concrete types will match what Dict expects on the wire; depending on zvariant::Dict’s runtime checks, this may either:

  • produce IncompatibleType errors (triggering your warn! paths and silently dropping entries), or
  • yield a different on‑wire type than the intended a{sv}/(b(…)) shapes.

It would be good to verify, e.g., by adding/adjusting tests or inspecting the exposed D‑Bus signatures with busctl introspect to ensure LockedPoolsInfo and ManagerR2/ManagerR8<StoppedPoolsInfo> actually serialize to the schema you expect. If needed, you might want to:

  • store Value/Variant explicitly in the dicts, or
  • adjust result_option_to_tuple to return a plain (bool, T) and let the dict’s value type be that tuple instead of Variant.
src/engine/types/mod.rs (1)

20-22: uuid! macro dbus feature-split and zvariant conversion look good; check trait usage across configs.

The cfg‑split in uuid! to add zbus::zvariant::Type and a From<$ident> for zvariant::Value<'a> impl under dbus_enabled is a sensible way to keep D‑Bus concerns gated, and the conversion via uuid.simple().to_string() matches how these IDs are exposed elsewhere. One subtle point: in the dbus‑enabled branch the UUID wrappers now also derive Ord, PartialOrd, and Default, while the non‑dbus branch does not. That’s fine as long as any code relying on these extra traits is itself behind #[cfg(feature = "dbus_enabled")]; otherwise non‑dbus builds could fail to compile.

If you want identical trait sets across configurations, you could mirror Ord/PartialOrd/Default into the non‑dbus derive as well.

Also applies to: 58-105

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

39-51: Consider aligning register’s engine parameter with other register helpers.

Here register takes engine: Arc<dyn Engine> by value, while most manager-side register helpers take &Arc<dyn Engine> and clone inside. For consistency of the public API across these D-Bus registration functions (and to avoid requiring call sites to decide when to clone vs. move), consider switching this to &Arc<dyn Engine> and cloning in Self::new.

src/dbus/manager/mod.rs (1)

55-75: Avoid recomputing OwnedObjectPath twice in each add_* helper.

In add_pool, add_filesystem, and add_blockdev, you call OwnedObjectPath::from(path.clone()) twice on the same input. You can construct it once and reuse it:

 pub fn add_pool(&mut self, path: &ObjectPath<'_>, uuid: PoolUuid) {
-    self.pool_path_to_uuid
-        .insert(OwnedObjectPath::from(path.clone()), uuid);
-    self.pool_uuid_to_path
-        .insert(uuid, OwnedObjectPath::from(path.clone()));
+    let owned = OwnedObjectPath::from(path.clone());
+    self.pool_path_to_uuid.insert(owned.clone(), uuid);
+    self.pool_uuid_to_path.insert(uuid, owned);
 }

Same pattern applies to add_filesystem and add_blockdev.

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

77-91: Clarify intent for the commented-out set_UserInfo property.

There’s a // FIXME block with a fully sketched set_UserInfo property that’s currently commented out. If this setter isn’t part of the r6 D-Bus surface, consider removing the dead code (or moving it behind a feature flag) to reduce confusion. If it is meant to be supported eventually, it might be worth opening a tracked issue and adding a brief comment describing what’s still missing (e.g., signal emission, error handling), so the next change is straightforward.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

77-91: Resolve or remove the commented-out set_UserInfo property.

As with R6, there’s a // FIXME block containing a complete but commented-out set_UserInfo implementation. If R5 is not meant to support this setter, consider deleting the stub to keep the versioned interface definition clean. If it is meant to be added later, a short comment or tracked issue reference explaining what’s missing would help future maintainers.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a099d76 and dee83a8.

📒 Files selected for processing (36)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/manager/manager_3_2/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_2/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_2/props.rs (1 hunks)
  • src/dbus/manager/manager_3_3/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_4/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_4/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_5/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_6/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_6/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_7/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_8/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_8/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_8/props.rs (1 hunks)
  • src/dbus/manager/manager_3_9/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_9/mod.rs (1 hunks)
  • src/dbus/manager/mod.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
  • src/dbus/types.rs (1 hunks)
  • src/dbus/util.rs (1 hunks)
  • src/engine/types/mod.rs (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/dbus/blockdev/shared.rs
  • src/dbus/manager/manager_3_2/props.rs
  • src/dbus/manager/manager_3_8/methods.rs
  • src/dbus/blockdev/mod.rs
  • src/dbus/manager/manager_3_8/mod.rs
  • src/dbus/blockdev/blockdev_3_7/mod.rs
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/manager/manager_3_6/methods.rs
  • src/dbus/manager/manager_3_8/props.rs
  • src/dbus/manager/manager_3_4/methods.rs
  • src/dbus/manager/manager_3_3/mod.rs
  • src/dbus/manager/manager_3_9/methods.rs
  • src/dbus/manager/manager_3_9/mod.rs
  • src/dbus/manager/manager_3_2/mod.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
  • src/dbus/types.rs
  • src/dbus/pool/mod.rs
  • src/dbus/util.rs
  • src/dbus/manager/manager_3_6/mod.rs
  • src/dbus/manager/manager_3_7/mod.rs
  • src/dbus/manager/manager_3_5/mod.rs
  • src/dbus/manager/mod.rs
  • src/dbus/manager/manager_3_2/methods.rs
  • src/dbus/manager/manager_3_4/mod.rs
📚 Learning: 2025-09-05T14:32:42.528Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3898
File: src/engine/sim_engine/pool.rs:934-948
Timestamp: 2025-09-05T14:32:42.528Z
Learning: In src/engine/sim_engine/pool.rs, the start_encrypt_pool method intentionally creates a SizedKeyMemory with 1 byte allocated but 0 length reported - this is to avoid NULL pointer issues while simulating an empty key slice in the sim engine.

Applied to files:

  • src/dbus/manager/manager_3_4/methods.rs
  • src/dbus/manager/manager_3_9/methods.rs
  • src/dbus/manager/manager_3_2/methods.rs
🧬 Code graph analysis (22)
src/dbus/manager/manager_3_6/methods.rs (3)
src/dbus/pool/mod.rs (1)
  • unregister_pool (70-84)
src/dbus/util.rs (15)
  • engine_to_dbus_err_tuple (70-76)
  • send_locked_pools_signals (126-148)
  • send_stopped_pools_signals (150-226)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus/manager/manager_3_2/methods.rs (1)
  • stop_pool_method (131-199)
src/dbus/manager/manager_3_4/methods.rs (3)
src/dbus/filesystem/mod.rs (1)
  • register_filesystem (25-43)
src/dbus/util.rs (16)
  • engine_to_dbus_err_tuple (70-76)
  • send_locked_pools_signals (126-148)
  • send_stopped_pools_signals (150-226)
  • tuple_to_option (30-36)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus_api/api/manager_3_2/methods.rs (1)
  • start_pool (22-129)
src/dbus/manager/manager_3_3/mod.rs (2)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/util.rs (12)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/engine/types/mod.rs (2)
src/engine/types/keys.rs (5)
  • uuid (732-734)
  • from (251-258)
  • from (645-661)
  • from (669-677)
  • from (813-820)
src/dbus/types.rs (1)
  • from (52-115)
src/dbus/manager/manager_3_9/mod.rs (3)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_8/methods.rs (4)
  • create_pool_method (40-138)
  • key_desc (56-59)
  • devs (55-55)
  • clevis_info (60-60)
src/dbus/manager/manager_3_8/mod.rs (3)
  • Version (87-89)
  • StoppedPools (93-95)
  • ListKeys (98-100)
src/dbus/blockdev/blockdev_3_4/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/manager/manager_3_2/mod.rs (3)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_2/methods.rs (2)
  • start_pool_method (28-129)
  • stop_pool_method (131-199)
src/dbus/manager/manager_3_2/props.rs (1)
  • stopped_pools_prop (12-16)
src/dbus/blockdev/blockdev_3_0/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_6/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (1)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/types.rs (1)
src/dbus/util.rs (1)
  • result_option_to_tuple (53-66)
src/dbus/blockdev/blockdev_3_9/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_0/mod.rs (8)
  • new (31-37)
  • Devnode (63-65)
  • HardwareInfo (69-77)
  • UserInfo (81-83)
  • InitializationTime (87-89)
  • Pool (93-95)
  • Uuid (99-101)
  • Tier (105-107)
src/dbus/util.rs (1)
src/stratis/errors.rs (1)
  • fmt (93-159)
src/dbus/blockdev/blockdev_3_3/mod.rs (7)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_0/mod.rs (10)
  • new (31-37)
  • register (39-50)
  • Devnode (63-65)
  • HardwareInfo (69-77)
  • InitializationTime (87-89)
  • Pool (93-95)
  • Uuid (99-101)
  • Tier (105-107)
  • PhysicalPath (111-119)
  • TotalPhysicalSize (123-131)
src/dbus/blockdev/blockdev_3_1/mod.rs (10)
  • new (27-33)
  • register (35-46)
  • Devnode (59-61)
  • HardwareInfo (65-73)
  • InitializationTime (83-85)
  • Pool (89-91)
  • Uuid (95-97)
  • Tier (101-103)
  • PhysicalPath (107-115)
  • TotalPhysicalSize (119-127)
src/dbus/blockdev/blockdev_3_2/mod.rs (10)
  • new (27-33)
  • register (35-46)
  • Devnode (59-61)
  • HardwareInfo (65-73)
  • InitializationTime (83-85)
  • Pool (89-91)
  • Uuid (95-97)
  • Tier (101-103)
  • PhysicalPath (107-115)
  • TotalPhysicalSize (119-127)
src/dbus/blockdev/blockdev_3_4/mod.rs (11)
  • new (29-35)
  • register (37-48)
  • Devnode (55-57)
  • HardwareInfo (61-69)
  • InitializationTime (95-97)
  • Pool (101-103)
  • Uuid (107-109)
  • Tier (113-115)
  • PhysicalPath (119-127)
  • TotalPhysicalSize (131-139)
  • NewPhysicalSize (143-151)
src/dbus/manager/manager_3_6/mod.rs (2)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_2/methods.rs (1)
  • refresh_state_method (201-206)
src/dbus/manager/manager_3_7/mod.rs (2)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/util.rs (12)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus/blockdev/blockdev_3_5/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/mod.rs (5)
src/dbus/util.rs (12)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus/pool/pool_3_9/mod.rs (2)
  • connection (73-73)
  • new (33-47)
src/dbus/blockdev/mod.rs (1)
  • register_blockdev (43-138)
src/dbus/manager/mod.rs (1)
  • register_manager (123-144)
src/dbus/udev.rs (1)
  • new (25-39)
src/dbus/manager/manager_3_5/mod.rs (2)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/util.rs (12)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus/manager/mod.rs (10)
src/dbus/manager/manager_3_8/mod.rs (1)
  • register (62-79)
src/dbus/manager/manager_3_9/mod.rs (1)
  • register (61-78)
src/dbus/manager/manager_3_7/mod.rs (1)
  • register (57-74)
src/dbus/manager/manager_3_6/mod.rs (1)
  • register (60-77)
src/dbus/manager/manager_3_5/mod.rs (1)
  • register (56-73)
src/dbus/manager/manager_3_4/mod.rs (1)
  • register (59-76)
src/dbus/manager/manager_3_3/mod.rs (1)
  • register (57-74)
src/dbus/manager/manager_3_2/mod.rs (1)
  • register (58-75)
src/dbus/manager/manager_3_0/mod.rs (1)
  • register (53-70)
src/dbus/manager/manager_3_1/mod.rs (1)
  • register (51-68)
src/dbus/manager/manager_3_2/methods.rs (4)
src/dbus/filesystem/mod.rs (1)
  • register_filesystem (25-43)
src/dbus/pool/mod.rs (1)
  • unregister_pool (70-84)
src/dbus/util.rs (15)
  • engine_to_dbus_err_tuple (70-76)
  • send_locked_pools_signals (126-148)
  • send_stopped_pools_signals (150-226)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus/manager/manager_3_6/methods.rs (1)
  • stop_pool_method (21-100)
src/dbus/blockdev/blockdev_3_2/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/mod.rs (4)
  • new (31-37)
  • Pool (93-95)
  • Uuid (99-101)
  • Tier (105-107)
src/dbus/manager/manager_3_4/mod.rs (3)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/manager/manager_3_4/methods.rs (1)
  • start_pool_method (28-142)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile check-typos, 1.91.0, cargo)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: python-based-tests
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
🔇 Additional comments (42)
src/dbus/manager/manager_3_8/props.rs (1)

1-16: Thin D‑Bus adapter looks correct and consistent with existing patterns

This helper cleanly wraps engine.stopped_pools().await into ManagerR8<StoppedPoolsInfo>, with appropriate async usage and types. The &Arc<dyn Engine> parameter matches the established pattern from other manager versions and avoids unnecessary cloning. No issues from a correctness or API‑shape standpoint.

src/dbus/manager/manager_3_2/methods.rs (1)

131-198: stop_pool_method and refresh_state_method match existing patterns and look correct

  • stop_pool_method mirrors the established 3.6 implementation: resolves PoolUuid, calls engine.stop_pool, unregisters on Stopped/Partial, and sends stopped/locked pool signals with sensible warnings on failure.
  • refresh_state_method cleanly wraps engine.refresh_state() and reuses engine_to_dbus_err_tuple for error mapping.

No issues spotted here.

src/dbus/types.rs (1)

14-32: Overall D-Bus type/marshalling additions look coherent

The FilesystemSpec alias, ManagerR2/ManagerR8 wrappers, DbusErrorEnum, and the Type/From<Value> impls for LockedPoolsInfo, ManagerR2<StoppedPoolsInfo>, ManagerR8<StoppedPoolsInfo>, and PoolUuid all fit cleanly into the existing D-Bus typing scheme and align with how these types are consumed by the new Manager interfaces.

Also applies to: 222-281

src/dbus/blockdev/blockdev_3_1/mod.rs (1)

49-127: Blockdev R1 wiring mirrors the shared helpers

The SetUserInfo method and all property accessors cleanly delegate to the established blockdev helpers with the correct signal semantics, so R1 stays consistent with the prior surfaces. Nicely done.

src/dbus/manager/manager_3_2/mod.rs (1)

58-172: ManagerR2 surface composes the shared helpers cleanly

Registration threads the shared state through as expected, and each D-Bus entry point defers to the existing helper logic, so behavior stays aligned with previous revisions. Looks good to me.

src/dbus/manager/manager_3_9/methods.rs (1)

31-154: R9 StartPool flow matches expectations

The expanded parameter handling (ID parsing, unlock options, key FD, remove-cache) integrates cleanly with the existing registration/signal flow, so the R9 surface should behave in line with earlier versions.

src/dbus/blockdev/blockdev_3_0/methods.rs (1)

13-53: SetUserInfo helper reuse is spot on

The helper fetches the pool mutably, forwards to set_blockdev_user_info, and maps each outcome to the established D-Bus tuple format, so the new interface hook stays in sync with engine behavior.

src/dbus/manager/manager_3_6/methods.rs (1)

21-100: StopPool ID routing looks solid

Parsing either UUID or name into PoolIdentifier and then driving the usual unregister/signal flow keeps the method consistent with previous versions while expanding the call surface—looks good.

src/dbus/manager/manager_3_4/methods.rs (1)

28-142: R4 StartPool remains aligned with shared flow

The method still performs the expected ID parsing, pool/filesystem registration, and signal emission steps, so the R4 surface stays behaviorally consistent.

src/dbus/manager/manager_3_3/mod.rs (2)

35-75: ManagerR3 struct and registration pattern look consistent.

The struct field choices, new() constructor, and register() implementation (cloning Arcs/Lockable and registering at STRATIS_BASE_PATH) match the established pattern for other manager versions and integrate cleanly with register_manager.


77-171: Confirm StoppedPools wrapper version choice for the r3 interface.

The StoppedPools property on ManagerR3 returns types::ManagerR2<StoppedPoolsInfo> while exposing the org.storage.stratis3.Manager.r3 interface. This follows the pattern of reusing earlier wrapper versions when the schema is unchanged, but please double‑check that ManagerR2 is indeed the intended D‑Bus type for r3 here. The rest of the methods delegating to shared helpers (*_method/*_prop) look consistent.

src/dbus/mod.rs (1)

34-55: create_dbus_handler wiring is coherent and side‑effect ordering is sound.

Counter, shared Manager, and system connection are initialized once and then consistently passed to register_manager and UdevHandler::new. The returned (Arc<Connection>, UdevHandler, Lockable<Arc<RwLock<Manager>>>) neatly exposes the pieces needed by the caller without leaking unnecessary internals.

src/dbus/manager/manager_3_9/mod.rs (1)

39-187: ManagerR9 implementation follows existing patterns; verify StoppedPools wrapper choice.

The ManagerR9 struct, new()/register() helpers, and interface methods cleanly mirror earlier manager versions, delegating all behavior to the shared *_method/*_prop helpers (including the new start_pool_method from this module). The only subtle point is StoppedPools returning types::ManagerR8<StoppedPoolsInfo> on the r9 interface; that reuse makes sense if the D‑Bus schema for this property is unchanged from r8, but it’s worth confirming that this is intentional.

src/dbus/blockdev/blockdev_3_4/mod.rs (1)

22-151: BlockdevR4 cleanly reuses shared property helpers and registration logic.

The BlockdevR4 struct, register() helper, and org.storage.stratis3.blockdev.r4 interface are wired consistently with earlier blockdev revisions: properties all go through blockdev_prop with the existing 3_0/3_3 prop functions, and the registration simply attaches the instance to the given object path. This doesn’t introduce any new behavior around the existing Pool path FIXME, so there’s no regression there.

src/engine/types/mod.rs (1)

108-266: Name and ClevisInfo types integrate cleanly with the new D‑Bus plumbing.

The ClevisInfo alias clarifies tuple semantics, and splitting Name’s definition via cfg to add Type/Value derives (with signature = "s") only when dbus_enabled is active keeps the core engine representation unchanged while making D‑Bus serialization straightforward. Using Name as the key in the name_to_uuid maps for LockedPoolsInfo and StoppedPoolsInfo aligns well with the Borrow<str>/Deref<str> implementations and should behave just like String keys from a caller’s perspective.

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

24-153: BlockdevR3 D-Bus wiring looks consistent with other versions

The struct, register() helper, and all property accessors correctly follow the established pattern (using blockdev_prop with the 3_0 props plus new_physical_size_prop), and I don’t see functional issues here.

src/dbus/pool/mod.rs (1)

70-84: unregister_pool flow looks sound

unregister_pool cleanly unregisters PoolR9 from the object server, then removes the pool mapping from Manager, returning the UUID; the error path for a missing mapping is explicit. I don’t see issues here.

src/dbus/blockdev/blockdev_3_0/props.rs (1)

12-26: Other BlockDev property accessors look correct

devnode_prop, hardware_info_prop, init_time_prop, and physical_path_prop map cleanly onto the BlockDev trait (paths, hardware info, init time, and devnode), and their types align with the D-Bus surface expectations.

src/dbus/blockdev/blockdev_3_9/mod.rs (1)

22-151: BlockdevR9 interface is wired consistently with other blockdev revisions

The struct, register() helper, and property implementations correctly reuse the shared 3_0 props and new_physical_size_prop, following the same pattern as earlier revisions. I don’t see functional or API-shape problems here.

src/dbus/util.rs (2)

29-76: DBus utility conversions and error mapping look correct

The tuple_to_option / option_to_tuple / result_option_to_tuple helpers implement the documented contract for representing optional values and fetch errors on D-Bus, and engine_to_dbus_err_tuple sensibly normalizes StratisError into the (code, message) tuple using DbusErrorEnum::ERROR. No functional issues spotted.


78-226: Pool and manager background-signal helpers are reasonable

send_pool_background_signals, send_fs_background_signals, send_locked_pools_signals, and send_stopped_pools_signals all follow a straightforward pattern: resolve the relevant interface from the object server, then emit the appropriate signals, short-circuiting on errors via ?. The lock usage and signal emission ordering look fine.

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

51-151: BlockdevR6 interface wiring looks consistent with shared helpers and other versions.

The struct fields, register helper, and property implementations all follow the same pattern as other blockdev versions, delegating cleanly to blockdev_prop and the shared prop functions (including new_physical_size_prop). I don’t see correctness issues in this wiring.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

51-151: BlockdevR5 property delegation and registration pattern look correct.

The D-Bus interface definition for r5 closely follows the established pattern: registration via register, and all properties delegate to blockdev_prop and the shared prop helpers (including new_physical_size_prop). I don’t see functional issues here.

src/dbus/blockdev/blockdev_3_2/mod.rs (1)

20-128: BlockdevR2 cleanly reuses the 3.0 helpers; no issues spotted.

Struct layout, register, SetUserInfo, and all property getters are consistent with BlockdevR0, correctly reusing set_user_info_method and the shared prop functions from blockdev_3_0. The D-Bus types and signatures look coherent; I don’t see anything that needs changing here.

src/dbus/manager/manager_3_7/mod.rs (1)

35-172: ManagerR7 interface is a consistent forwarder to shared manager helpers.

The struct fields, new/register helpers, and all D-Bus methods/properties mirror the existing ManagerR* versions and correctly delegate to create_pool_method, destroy_pool_method, list_keys_method, set_key_method, unset_key_method, start_pool_method, stop_pool_method, refresh_state_method, and stopped_pools_prop. Argument ordering and result types look coherent; I don’t see functional issues here.

src/dbus/manager/mod.rs (1)

123-144: Code pattern is correct per zbus documentation.

zbus's ObjectServer::at supports registering multiple different interface implementors on the same object path and will add distinct interfaces side-by-side. It only refuses/returns false if the same interface (same interface name) is already registered at that path.

The register_manager() function correctly registers each of the ManagerR0 through ManagerR9 types (distinct interfaces) along with fdo::ObjectManager on STRATIS_BASE_PATH via repeated at(...) calls. Since these are different interface names, they will coexist without conflict.

src/dbus/manager/manager_3_6/mod.rs (8)

1-36: LGTM!

The imports and module structure follow the established pattern for versioned manager interfaces. The re-export of stop_pool_method is appropriate given that this version introduces changes to the StopPool API.


38-43: LGTM!

The struct definition correctly mirrors the pattern used in other manager versions with appropriate shared ownership types for concurrent D-Bus operations.


45-78: LGTM!

The constructor and registration logic follow the established pattern for versioned manager interfaces with proper Arc cloning and async D-Bus registration.


80-93: LGTM!

Properties are correctly defined with appropriate signal emission behavior and delegate to shared helper functions following the established pattern.


95-112: LGTM!

Key management methods correctly delegate to the shared implementations from manager_3_0 with appropriate signatures and return types.


167-170: Note the API harmonization with StartPool.

The StopPool method in R6 uses id and id_type parameters (matching StartPool's pattern), whereas R4's StopPool accepts an ObjectPath. This harmonization improves API consistency by allowing pools to be stopped using the same identifier types as starting them.


114-134: LGTM!

CreatePool correctly omits the redundancy parameter that was present in R4, reflecting intentional API evolution. The method properly delegates to create_pool_method with all required parameters.


136-165: LGTM!

DestroyPool, StartPool, and RefreshState methods correctly delegate to their underlying implementations with appropriate parameters and return types.

Also applies to: 172-175

src/dbus/manager/manager_3_4/mod.rs (8)

1-35: LGTM!

The imports correctly reference stop_pool_method from manager_3_2 (pre-existing) and re-export start_pool_method as a new capability introduced in this version. The module structure follows the established pattern.


37-42: LGTM!

The struct definition is identical to ManagerR6 with appropriate shared ownership types.


44-77: LGTM!

Constructor and registration logic match the established pattern with proper Arc cloning and async D-Bus registration.


79-92: LGTM!

Properties are correctly defined with appropriate signal emission behavior and delegation to shared helper functions.


94-111: LGTM!

Key management methods correctly delegate to shared implementations with appropriate signatures.


115-134: Unused redundancy parameter is acceptable for API compatibility.

The _redundancy parameter is marked as unused with the underscore prefix, which correctly suppresses compiler warnings while maintaining API compatibility with the D-Bus interface contract for version 3.4. This parameter is removed in later versions (e.g., R6).


167-170: Note: StopPool API evolves in R6.

This R4 implementation uses ObjectPath for the pool parameter, while R6 changes to id and id_type parameters (matching StartPool's pattern). Both implementations correctly delegate to their respective stop_pool_method implementations.


136-139: LGTM!

DestroyPool, StartPool, and RefreshState methods correctly delegate to their underlying implementations with appropriate parameters and return types.

Also applies to: 141-165, 172-175

Copy link

@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: 1

🧹 Nitpick comments (1)
src/dbus/blockdev/mod.rs (1)

43-140: register_blockdev flow looks good; consider a couple of small cleanups

The overall orchestration (unique path via atomic counter, sequential BlockdevR0..R9 registration on that path, and final Manager::add_blockdev update) looks sound and easy to follow.

A few non-blocking nits you might consider:

  • The lifetime parameter 'a on register_blockdev doesn’t seem to buy much, since path is built from an owned String (ObjectPath::try_from(format!(...))), which should yield an owned ObjectPath. You could simplify the signature to something like -> StratisResult<ObjectPath<'static>> (or just ObjectPath<'_>) and drop the explicit lifetime to reduce generic noise.
  • The counter.fetch_add(1, Ordering::AcqRel) use is stronger than necessary if this counter is only used to generate unique IDs and isn’t synchronizing with other state; Ordering::Relaxed would be sufficient and more idiomatic for a plain monotonic ID.
  • Depending on how Lockable is defined, manager: &Lockable<Arc<RwLock<Manager>>> may be more layers of locking/indirection than you need. If the intent is simply to mutate Manager under a single lock, collapsing this to a single layer (e.g., Lockable<Manager> or Arc<RwLock<Manager>>) would make manager.write().await.add_blockdev(..) more obviously operate on the Manager itself.

None of these are correctness issues; just possible simplifications if they fit the broader design.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a86243 and bb7efca.

📒 Files selected for processing (3)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/dbus/pool/mod.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/blockdev/blockdev_3_0/mod.rs
🧬 Code graph analysis (2)
src/dbus/blockdev/blockdev_3_0/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-31)
  • tier_prop (37-39)
  • total_physical_size_prop (33-35)
  • user_info_prop (41-44)
  • uuid_prop (46-49)
src/dbus/blockdev/mod.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • register (46-58)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • register (35-46)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • register (39-50)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • register (35-46)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • register (37-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (32)
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: python-based-tests
  • GitHub Check: stratis-min-cli-checks
🔇 Additional comments (1)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)

24-58: BlockdevR0 struct and register wiring look correct

Storing parent_object_path as a String in BlockdevR0 and passing the validated ObjectPath only at construction time cleanly sidesteps lifetime headaches for the Pool property. The register helper is straightforward: it builds the object with the expected engine, parent_path, and UUIDs, and calls object_server().at(path, blockdev); assuming the existing From<zbus::Error>/From<zvariant::Error> conversions into StratisResult are in place elsewhere, this piece looks good to me.

Copy link

@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

♻️ Duplicate comments (1)
src/dbus/pool/mod.rs (1)

48-67: Tear down the D-Bus object when the pool lookup fails.

The PoolR9 object is registered (lines 38-46) before verifying that engine.get_pool() still returns the pool. If get_pool() returns None, the function returns an error (line 65) without unregistering the PoolR9 object. This leaves the object pinned in the connection's object server, corrupting the D-Bus view and creating inconsistent manager mappings.

Unregister the PoolR9 object before returning the error:

     match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
         Some(pool) => {
             manager.write().await.add_pool(&path, pool_uuid);

             let mut bd_paths = Vec::new();
             let bd_uuids = pool.blockdevs().into_iter().map(|(u, _, _)| u).collect::<Vec<_>>();
             for dev_uuid in bd_uuids {
                 match register_blockdev(engine, connection, manager, counter, &path, pool_uuid, dev_uuid).await {
                     Ok(op) => bd_paths.push(op),
                     Err(_) => {
                         warn!("Unable to register object path for blockdev with UUID {dev_uuid} belonging to pool {pool_uuid} on the D-Bus");
                     },
                 }
             }
             Ok((path, bd_paths))
         }
         None => {
+            let _ = PoolR9::unregister(connection, path.clone()).await;
             Err(StratisError::Msg(format!("Pool with {pool_uuid} was successfully started but appears to have been removed before it could be exposed on the D-Bus")))
         }
     }
🧹 Nitpick comments (1)
src/dbus/pool/mod.rs (1)

53-61: Drop the pool before blockdev registration to avoid holding locks unnecessarily.

The pool variable obtained on line 49 is used only on line 53 to extract blockdev UUIDs. However, it remains in scope through line 61 during the blockdev registration loop, potentially holding internal locks that could block other operations.

Extract the UUIDs and explicitly drop the pool reference before the loop:

             let mut bd_paths = Vec::new();
             let bd_uuids = pool.blockdevs().into_iter().map(|(u, _, _)| u).collect::<Vec<_>>();
+            drop(pool);
             for dev_uuid in bd_uuids {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb7efca and 15eec29.

📒 Files selected for processing (3)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/dbus/blockdev/blockdev_3_0/mod.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/pool/mod.rs
🧬 Code graph analysis (2)
src/dbus/pool/mod.rs (1)
src/dbus/pool/pool_3_9/mod.rs (5)
  • connection (73-73)
  • register (49-67)
  • Uuid (98-100)
  • new (33-47)
  • unregister (69-75)
src/dbus/blockdev/mod.rs (1)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • register (46-58)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: python-based-tests
  • GitHub Check: stratis-min-cli-checks
🔇 Additional comments (4)
src/dbus/blockdev/mod.rs (2)

1-31: LGTM!

The module structure, imports, and declarations are well-organized and appropriate for the multi-version blockdev registration pattern.


32-41: LGTM!

The re-export structure provides a clean public API for all blockdev revision interfaces.

src/dbus/pool/mod.rs (2)

1-24: LGTM!

The module structure and imports are well-organized and follow consistent patterns with the blockdev module.


70-84: LGTM!

The unregister_pool function correctly unregisters the D-Bus object, removes the manager mapping, and returns the associated UUID. The error handling and lock scope are appropriate.

Comment on lines 43 to 148
pub async fn register_blockdev<'a>(
engine: &Arc<dyn Engine>,
connection: &Arc<Connection>,
manager: &Lockable<Arc<RwLock<Manager>>>,
counter: &Arc<AtomicU64>,
pool_object_path: &ObjectPath<'_>,
pool_uuid: PoolUuid,
dev_uuid: DevUuid,
) -> StratisResult<ObjectPath<'a>> {
let path = ObjectPath::try_from(format!(
"{}/{}",
consts::STRATIS_BASE_PATH,
counter.fetch_add(1, Ordering::AcqRel),
))?;
BlockdevR0::register(
engine.clone(),
connection,
pool_object_path.clone(),
pool_uuid,
path.clone(),
dev_uuid,
)
.await?;
BlockdevR1::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
BlockdevR2::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
BlockdevR3::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
BlockdevR4::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
BlockdevR5::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
BlockdevR6::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
BlockdevR7::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
BlockdevR8::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
BlockdevR9::register(
engine.clone(),
connection,
path.clone(),
pool_uuid,
dev_uuid,
)
.await?;
manager.write().await.add_blockdev(&path, dev_uuid);
Ok(path)
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Roll back partial registrations on error.

If any BlockdevRX::register call fails (e.g., BlockdevR5::register on line 98), the function returns immediately via ?, leaving previously registered blockdev interfaces (BlockdevR0 through BlockdevR4) pinned in the D-Bus object server. The Manager update on line 138 never executes, creating an inconsistent state where orphaned D-Bus objects exist without corresponding manager mappings.

Consider wrapping the registration sequence in error handling that unregisters previously registered interfaces on failure. For example:

pub async fn register_blockdev<'a>(
    engine: &Arc<dyn Engine>,
    connection: &Arc<Connection>,
    manager: &Lockable<Arc<RwLock<Manager>>>,
    counter: &Arc<AtomicU64>,
    pool_object_path: &ObjectPath<'_>,
    pool_uuid: PoolUuid,
    dev_uuid: DevUuid,
) -> StratisResult<ObjectPath<'a>> {
    let path = ObjectPath::try_from(format!(
        "{}/{}",
        consts::STRATIS_BASE_PATH,
        counter.fetch_add(1, Ordering::AcqRel),
    ))?;
    
    // Register all interfaces, rolling back on error
    if let Err(e) = async {
        BlockdevR0::register(
            engine.clone(),
            connection,
            pool_object_path.clone(),
            pool_uuid,
            path.clone(),
            dev_uuid,
        )
        .await?;
        BlockdevR1::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        BlockdevR2::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        BlockdevR3::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        BlockdevR4::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        BlockdevR5::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        BlockdevR6::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        BlockdevR7::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        BlockdevR8::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        BlockdevR9::register(engine.clone(), connection, path.clone(), pool_uuid, dev_uuid).await?;
        Ok::<_, StratisError>(())
    }.await {
        // Unregister all interfaces on error
        let _ = connection.object_server().remove::<BlockdevR0, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR1, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR2, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR3, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR4, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR5, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR6, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR7, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR8, _>(&path).await;
        let _ = connection.object_server().remove::<BlockdevR9, _>(&path).await;
        return Err(e);
    }
    
    manager.write().await.add_blockdev(&path, dev_uuid);
    Ok(path)
}
🤖 Prompt for AI Agents
In src/dbus/blockdev/mod.rs around lines 43 to 140, the sequence of
BlockdevR*.register calls can leave previously-registered D-Bus interfaces
pinned if a later register call fails; wrap the whole registration sequence in a
fallible async block and on error call
connection.object_server().remove::<BlockdevR#,&_>(&path).await for each
previously-registered interface (ignore/remove any errors) to unregister them,
then return the original error; only call
manager.write().await.add_blockdev(&path, dev_uuid) after the registration block
succeeds.

Copy link

@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: 0

♻️ Duplicate comments (3)
src/dbus/pool/mod.rs (2)

52-61: Document the partial blockdev registration behavior.

The function logs warnings and continues when individual register_blockdev calls fail (lines 57-59), ultimately returning success with an incomplete list of blockdev paths. This creates a pool D-Bus object with some blockdevs missing from the D-Bus interface. While this may be an intentional design choice to maximize availability, consider adding a doc comment to register_pool explaining this behavior so callers understand that the returned Vec<ObjectPath> may not include all blockdevs.


38-67: Unregister PoolR9 on the error path when pool lookup fails.

Despite the previous review comment being marked as "Addressed," the code still registers PoolR9 (lines 38-46) before verifying the pool exists via engine.get_pool() (line 48). If get_pool() returns None (lines 64-66), the function returns an error without calling PoolR9::unregister(), leaving the pool object pinned in the D-Bus object server and creating an inconsistent state.

Apply this diff to unregister the pool on the error path:

     None => {
+        let _ = PoolR9::unregister(connection, path.clone()).await;
         Err(StratisError::Msg(format!("Pool with {pool_uuid} was successfully started but appears to have been removed before it could be exposed on the D-Bus")))
     }
src/dbus/blockdev/mod.rs (1)

43-138: Roll back partial registrations on error.

This is a duplicate of a previous review comment, but the issue remains unaddressed: if any BlockdevR{N}::register call fails (e.g., line 96-103 for R5), the function returns immediately via ?, leaving previously registered blockdev interfaces (R0 through R4) pinned in the D-Bus object server. The manager update on line 136 never executes, creating an inconsistent state where orphaned D-Bus objects exist without corresponding manager mappings.

The previous review suggested wrapping the registration sequence in error handling that unregisters previously registered interfaces on failure. Please refer to the existing comment for the detailed implementation approach.

🧹 Nitpick comments (1)
src/dbus/types.rs (1)

283-302: Dead code annotations suggest future usage.

Both OwnedParentPool (line 288) and ParentPool::to_owned (line 295) are marked with #[allow(dead_code)] but are fully implemented. This suggests they may be needed for future work or are kept for API completeness. If they're truly unused and not planned for future use, consider removing them to reduce maintenance burden.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15eec29 and ea1c286.

📒 Files selected for processing (4)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
  • src/dbus/types.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/pool/mod.rs
  • src/dbus/types.rs
  • src/dbus/blockdev/mod.rs
🧬 Code graph analysis (4)
src/dbus/mod.rs (4)
src/dbus/manager/manager_3_9/mod.rs (1)
  • new (47-59)
src/dbus/manager/manager_3_0/mod.rs (1)
  • new (39-51)
src/dbus/udev.rs (1)
  • new (25-39)
src/engine/structures/lock.rs (1)
  • new_shared (84-86)
src/dbus/pool/mod.rs (2)
src/dbus/blockdev/mod.rs (1)
  • register_blockdev (43-138)
src/dbus/pool/pool_3_9/mod.rs (5)
  • connection (73-73)
  • register (49-67)
  • Uuid (98-100)
  • new (33-47)
  • unregister (69-75)
src/dbus/types.rs (3)
src/dbus/util.rs (1)
  • result_option_to_tuple (53-66)
src/dbus/manager/manager_3_8/mod.rs (1)
  • new (48-60)
src/dbus/manager/manager_3_2/mod.rs (1)
  • new (44-56)
src/dbus/blockdev/mod.rs (10)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • register (35-46)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • register (39-50)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • register (39-50)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • register (35-46)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • register (37-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (32)
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: python-based-tests
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
🔇 Additional comments (4)
src/dbus/mod.rs (1)

35-56: LGTM!

The create_dbus_handler initialization flow is clear and well-structured. The function properly sequences the creation of shared state (counter, manager), D-Bus connection setup, manager registration, and UdevHandler construction before returning the initialized components.

src/dbus/pool/mod.rs (1)

70-84: LGTM!

The unregister_pool function correctly unregisters the PoolR9 object, retrieves the UUID from the manager, removes the pool mapping, and returns the UUID.

src/dbus/types.rs (2)

33-116: LGTM!

The Type and From implementations for LockedPoolsInfo correctly construct nested D-Bus dictionary structures. The error handling pattern (logging warnings and continuing) is appropriate for D-Bus serialization, ensuring that failures in individual field conversions don't prevent the entire structure from being serialized.


118-220: LGTM!

The stopped_pools_to_value helper and the ManagerR2/ManagerR8 wrapper implementations correctly serialize stopped pool information to D-Bus format. The metadata parameter appropriately controls whether metadata_version and features fields are included, differentiating between the R2 and R8 API versions.

Copy link

@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: 0

♻️ Duplicate comments (3)
src/dbus/blockdev/mod.rs (1)

43-138: Partial registration rollback concern already noted

The sequence of BlockdevR0BlockdevR9::register calls still short-circuits on the first error, potentially leaving earlier interfaces registered on the object server without a corresponding manager entry. I see coderabbitai’s earlier comment already called this out with a concrete rollback pattern; that feedback still applies to the current version of this function.

src/dbus/pool/mod.rs (2)

26-68: Previous cleanup concern may still apply: pool object persists after get_pool failure.

The past review flagged that PoolR9::register (line 38-46) succeeds before checking engine.get_pool (line 48), and if the pool lookup returns None, the D-Bus object remains registered while an error is returned. The previous review comment indicates this was addressed in earlier commits, but the current code still shows the same pattern. Verify whether:

  1. The fix was applied differently than expected, or
  2. The code reverted to the original state.

If the issue remains, consider calling PoolR9::unregister on the error path before returning the StratisError.


52-61: Acknowledge partial blockdev registration behavior.

As noted in previous reviews, individual blockdev registration failures are logged but don't fail the overall pool registration. This creates a partial-success scenario where some blockdevs aren't exposed on D-Bus. While this maximizes availability, the return type doesn't distinguish partial from complete success. Consider whether the API contract should be clarified or the return type adjusted to signal incomplete registration.

🧹 Nitpick comments (6)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)

71-91: Commented-out set_UserInfo FIXME: either plan it or trim it

The active properties on BlockdevR8 are wired correctly and mirror the R3 pattern, including NewPhysicalSize via new_physical_size_prop. The only thing that stands out is the // FIXME block for set_UserInfo.

If you don’t expect to implement the writable property soon, consider dropping the commented-out code (and possibly opening a tracking issue instead) to keep this module focused on the behavior that actually exists today.

src/dbus/mod.rs (1)

35-55: create_dbus_handler composes connection, manager, and udev cleanly

The handler factory cleanly encapsulates: counter setup, shared Manager creation, system-bus Connection creation with the correct service name, manager registration, and UdevHandler construction. The sharing and lifetimes (Arc/Lockable<Arc<RwLock<Manager>>>) all look consistent with the rest of the D-Bus stack.

If you later need more flexible testing (e.g., injecting a non-system connection), you could consider an overload or a small internal helper that takes a pre-built Connection, but that’s not necessary for this PR.

src/dbus/blockdev/mod.rs (1)

51-55: Atomic counter can likely use Relaxed ordering

For generating unique numeric suffixes for object paths, there’s no cross-thread data dependency on the incremented value beyond uniqueness. You could simplify to Ordering::Relaxed here without changing behavior:

-        counter.fetch_add(1, Ordering::AcqRel),
+        counter.fetch_add(1, Ordering::Relaxed),

This is micro-optimisation only; feel free to defer if you prefer the stronger ordering for consistency.

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

20-153: BlockdevR3 implementation and NewPhysicalSize wiring look good

The struct, register() function, and all property accessors (including NewPhysicalSize via the local props module) follow the established blockdev patterns and use the shared helpers correctly. The only nit is the commented-out set_UserInfo FIXME block, which you might eventually either implement or drop as in the R8 module to avoid long-lived dead code, but functionally this module looks solid.

src/dbus/blockdev/blockdev_3_4/mod.rs (2)

77-91: Consider tracking the FIXME or removing dead code.

The commented-out set_UserInfo method appears across multiple BlockdevR* versions. If this is deferred work, consider opening an issue to track it; otherwise, removing the commented code would reduce clutter.

Would you like me to help track this across all affected files or open an issue for the missing setter implementation?


51-152: Property implementation is solid; consider reducing duplication across versions.

The D-Bus interface implementation correctly delegates to shared property helpers and sets appropriate signal emission semantics. However, BlockdevR4 (and R0, R2, R5, R6, R7) share nearly identical property accessor patterns, which could benefit from macro-based code generation or trait-based delegation to reduce maintenance burden.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea1c286 and d9179ec.

📒 Files selected for processing (15)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
  • src/dbus/types.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/dbus/blockdev/blockdev_3_9/mod.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/pool/mod.rs
  • src/dbus/blockdev/mod.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
  • src/dbus/types.rs
🧬 Code graph analysis (10)
src/dbus/mod.rs (4)
src/dbus/manager/mod.rs (1)
  • register_manager (123-144)
src/dbus/types.rs (1)
  • new (290-295)
src/dbus/udev.rs (1)
  • new (25-39)
src/engine/structures/lock.rs (1)
  • new_shared (84-86)
src/dbus/blockdev/blockdev_3_8/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-30)
  • tier_prop (36-38)
  • total_physical_size_prop (32-34)
  • user_info_prop (40-43)
  • uuid_prop (45-48)
src/dbus/types.rs (1)
  • new (290-295)
src/dbus/blockdev/blockdev_3_3/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-30)
  • tier_prop (36-38)
  • total_physical_size_prop (32-34)
  • user_info_prop (40-43)
  • uuid_prop (45-48)
src/dbus/blockdev/blockdev_3_0/mod.rs (11)
  • new (31-37)
  • register (39-50)
  • Devnode (63-65)
  • HardwareInfo (69-77)
  • UserInfo (81-83)
  • InitializationTime (87-89)
  • Pool (93-95)
  • Uuid (99-101)
  • Tier (105-107)
  • PhysicalPath (111-119)
  • TotalPhysicalSize (123-131)
src/dbus/blockdev/blockdev_3_7/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-30)
  • tier_prop (36-38)
  • total_physical_size_prop (32-34)
  • user_info_prop (40-43)
  • uuid_prop (45-48)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/types.rs (1)
  • new (290-295)
src/dbus/blockdev/blockdev_3_4/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-30)
  • tier_prop (36-38)
  • total_physical_size_prop (32-34)
  • user_info_prop (40-43)
  • uuid_prop (45-48)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/types.rs (1)
  • new (290-295)
src/dbus/blockdev/blockdev_3_6/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-30)
  • tier_prop (36-38)
  • total_physical_size_prop (32-34)
  • user_info_prop (40-43)
  • uuid_prop (45-48)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/types.rs (1)
  • new (290-295)
src/dbus/blockdev/blockdev_3_5/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-30)
  • tier_prop (36-38)
  • total_physical_size_prop (32-34)
  • user_info_prop (40-43)
  • uuid_prop (45-48)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/types.rs (1)
  • new (290-295)
src/dbus/blockdev/mod.rs (13)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/pool/mod.rs (1)
  • pool (53-53)
src/engine/strat_engine/metadata/bda.rs (1)
  • dev_uuid (125-127)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • register (39-50)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • register (35-46)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • register (35-46)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • register (39-50)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • register (37-48)
src/dbus/blockdev/blockdev_3_2/mod.rs (5)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (9)
  • devnode_prop (12-14)
  • hardware_info_prop (16-18)
  • init_time_prop (20-22)
  • physical_path_prop (24-26)
  • pool_prop (28-30)
  • tier_prop (36-38)
  • total_physical_size_prop (32-34)
  • user_info_prop (40-43)
  • uuid_prop (45-48)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/mod.rs (4)
  • new (31-37)
  • Pool (93-95)
  • Uuid (99-101)
  • Tier (105-107)
src/dbus/types.rs (1)
  • new (290-295)
src/dbus/types.rs (1)
src/dbus/util.rs (1)
  • result_option_to_tuple (53-66)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (31)
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile fmt-ci, 1.91.0, rustfmt)
  • GitHub Check: checks (make -f Makefile check-typos, 1.91.0, cargo)
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: python-based-tests
  • GitHub Check: checks-with-ci-repo
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
🔇 Additional comments (15)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)

20-127: BlockdevR1 interface cleanly mirrors existing blockdev patterns

The struct shape, register() implementation, and all property/method bindings reuse the shared helpers consistently with the R0/R2+ variants. I don’t see any behavioral or API-shape issues here; this looks ready to go.

src/dbus/blockdev/blockdev_3_4/mod.rs (2)

22-35: LGTM!

The struct definition and constructor follow the established pattern across BlockdevR* implementations.


37-48: LGTM!

The registration pattern correctly delegates to the connection's object server and handles errors appropriately.

src/dbus/pool/mod.rs (2)

1-24: LGTM!

Module structure and imports are appropriate for the pool registration functionality.


70-84: LGTM!

The unregister flow correctly removes the D-Bus object, looks up the UUID, and cleans up the manager state.

src/dbus/blockdev/blockdev_3_7/mod.rs (1)

1-152: Implementation is consistent with other BlockdevR versions.*

BlockdevR7 follows the same pattern as R4, R5, and R6. The structure, registration, and property delegation are all correct. The same optional refactoring suggestions apply: consider consolidating the duplicated code across versions and addressing the commented-out set_UserInfo method.

src/dbus/types.rs (5)

14-31: LGTM!

The type definitions provide clear version-specific wrappers and appropriate enums for D-Bus marshalling.


33-116: LGTM!

The LockedPoolsInfo marshalling handles complex nested structures appropriately, with proper error logging for conversion failures while allowing partial success.


118-220: LGTM!

The shared helper function cleanly handles both R2 and R8 cases with a metadata flag, avoiding duplication while maintaining proper error handling.


222-276: LGTM!

The wrapper pattern cleanly differentiates R2 and R8 behavior while sharing the underlying marshalling logic.


278-296: LGTM!

The Basic implementation for PoolUuid and the ParentPool struct provide the necessary type infrastructure for cross-module D-Bus coordination.

src/dbus/blockdev/blockdev_3_2/mod.rs (1)

1-128: LGTM!

BlockdevR2 represents an earlier interface version with SetUserInfo implemented and without NewPhysicalSize. The implementation is consistent and correct for its version level.

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

1-132: LGTM!

BlockdevR0 provides the foundational interface and correctly re-exports property helpers used across all versions. The implementation is clean and previous concerns have been addressed.

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

1-152: Implementation is consistent with other BlockdevR versions.*

BlockdevR6 follows the same pattern as R4, R5, and R7. The implementation is correct, and the same optional refactoring suggestions apply regarding code duplication and the commented-out set_UserInfo method.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

1-152: Implementation is consistent with other BlockdevR versions.*

BlockdevR5 follows the same pattern as R4, R6, and R7. The implementation is correct, and the same optional refactoring suggestions apply regarding code duplication and the commented-out set_UserInfo method.

Copy link

@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: 1

♻️ Duplicate comments (4)
src/dbus/pool/mod.rs (2)

52-61: Consider the impact of partial blockdev registration and pool lock lifetime.

Two concerns:

  1. Partial registration (duplicate concern): When register_blockdev fails for individual devices, the function logs a warning and continues, ultimately returning success with an incomplete list of blockdev paths. This results in a pool being exposed on D-Bus with some blockdevs missing, creating an inconsistent view. Consider whether the caller should be notified of partial registration or if the behavior should be documented.

  2. Pool lock: After calling pool.blockdevs() on line 53, the pool reference remains in scope during the entire blockdev registration loop (lines 54-61). If the pool holds internal locks, this could block concurrent operations. Consider explicitly dropping the pool before the loop:

     let mut bd_paths = Vec::new();
     let bd_uuids = pool.blockdevs().into_iter().map(|(u, _, _)| u).collect::<Vec<_>>();
+    drop(pool);
     for dev_uuid in bd_uuids {

64-66: Must unregister PoolR9 before returning error.

The PoolR9 object is registered on D-Bus at lines 38-46, but when engine.get_pool() returns None, this error path returns without unregistering the object. This leaves an orphaned D-Bus object in the connection's object server, corrupting the D-Bus view and making manager mappings inconsistent.

Apply this diff to unregister the object before returning:

     None => {
+        let _ = PoolR9::unregister(connection, path.clone()).await;
         Err(StratisError::Msg(format!("Pool with {pool_uuid} was successfully started but appears to have been removed before it could be exposed on the D-Bus")))
     }

Note: This issue was previously flagged and marked as "Addressed" but the fix is not present in the current code.

src/dbus/blockdev/shared.rs (1)

24-27: Eliminate the expect() panic path and fix the error message.

get_mut_blockdev() can return an error. Using expect("FIXME") will crash stratisd instead of surfacing a D-Bus failure. Additionally, the error message incorrectly references "filesystem" instead of "block device".

     let (tier, bd) = guard
         .get_mut_blockdev(bd_uuid)
-        .expect("FIXME")
-        .ok_or_else(|| Error::Failed(format!("No filesystem associated with UUID {bd_uuid}")))?;
+        .map_err(|e| Error::Failed(format!("Failed to access block device {bd_uuid}: {e}")))?
+        .ok_or_else(|| Error::Failed(format!("No block device associated with UUID {bd_uuid}")))?;
src/dbus/blockdev/blockdev_3_2/mod.rs (1)

71-99: Shared blockdev_prop error message still mentions “filesystem”

Because Devnode, HardwareInfo, UserInfo, InitializationTime, etc. all delegate through blockdev_prop, D‑Bus errors for a missing block device will currently say “No filesystem associated with UUID {bd_uuid}” (per src/dbus/blockdev/shared.rs). That’s potentially confusing for blockdev callers; renaming it to reference “block device” would make the diagnostics clearer and more accurate.

🧹 Nitpick comments (6)
src/dbus/blockdev/blockdev_3_3/props.rs (1)

17-20: Stub noted for future implementation.

The set_user_info_prop is correctly marked with #[allow(dead_code)] and has a FIXME comment. This is acceptable as a placeholder for future setter support.

Would you like me to help implement this setter when you're ready to address the FIXME?

src/dbus/blockdev/blockdev_3_0/props.rs (1)

21-23: Potential truncation for pre-epoch timestamps.

Casting timestamp() (which returns i64) to u64 will produce incorrect values if the initialization time is somehow before Unix epoch (1970). While this is unlikely for block device initialization times, consider using timestamp() as u64 only after validating non-negativity, or document the assumption.

src/dbus/blockdev/blockdev_3_1/mod.rs (1)

131-141: Missing emits_changed_signal attribute.

TotalPhysicalSize is the only property without an explicit emits_changed_signal attribute. Other properties consistently specify this (e.g., "const" for immutable values, "false" for mutable ones). This defaults to "true" which may or may not be the intended behavior.

Consider adding the appropriate signal emission behavior for consistency:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn TotalPhysicalSize(&self) -> Result<String, Error> {
src/dbus/blockdev/blockdev_3_8/mod.rs (1)

90-104: Offer: Address the commented-out set_UserInfo setter.

This FIXME placeholder appears across multiple BlockdevRX versions. If you'd like, I can help implement the setter logic or open an issue to track this work.

src/dbus/blockdev/blockdev_3_9/mod.rs (1)

1-165: Consider: Macro-based generation for BlockdevRX variants.

All BlockdevRX implementations (R0-R9) follow an identical structure with only the interface version number differing. A declarative macro could generate these implementations, reducing boilerplate and ensuring consistency:

// Example macro sketch (in a shared module)
macro_rules! impl_blockdev_interface {
    ($name:ident, $version:literal) => {
        pub struct $name { /* ... */ }
        impl $name { /* new, register */ }
        #[interface(name = concat!("org.storage.stratis3.blockdev.", $version))]
        impl $name { /* properties */ }
    };
}

impl_blockdev_interface!(BlockdevR9, "r9");

This is optional given the current approach is explicit and works correctly.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

84-88: Confirm emits_changed_signal semantics for UserInfo/NewPhysicalSize on R5

Here UserInfo (and NewPhysicalSize) use the default #[zbus(property)] annotation, whereas earlier versions (e.g., R0/R2) explicitly mark UserInfo with emits_changed_signal = "false". If the 3.5 D‑Bus contract wasn’t meant to change in this respect, it may be safer to align these annotations with the earlier revisions so clients don’t see inconsistent introspection metadata across versions. If 3.5 is intentionally different, a brief comment explaining the divergence could help future maintainers.

Also applies to: 142-164

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9179ec and 52a899b.

📒 Files selected for processing (17)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/dbus/blockdev/mod.rs
  • src/dbus/blockdev/blockdev_3_6/mod.rs
  • src/dbus/mod.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/blockdev/shared.rs
  • src/dbus/pool/mod.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
🧬 Code graph analysis (9)
src/dbus/blockdev/blockdev_3_3/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/shared.rs (11)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • Uuid (123-125)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • Uuid (120-122)
src/engine/strat_engine/thinpool/filesystem.rs (1)
  • format (156-162)
src/dbus/pool/mod.rs (3)
src/dbus/blockdev/mod.rs (1)
  • register_blockdev (43-148)
src/dbus/util.rs (12)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus/pool/pool_3_9/mod.rs (5)
  • connection (73-73)
  • register (49-67)
  • Uuid (98-100)
  • new (33-47)
  • unregister (69-75)
src/dbus/blockdev/blockdev_3_0/methods.rs (11)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • Uuid (123-125)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • Uuid (120-122)
src/dbus/pool/mod.rs (1)
  • pool (53-53)
src/dbus/blockdev/blockdev_3_9/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_1/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_4/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_2/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (34-50)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: python-based-tests
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: checks (make -f Makefile check-typos, 1.91.0, cargo)
🔇 Additional comments (20)
src/dbus/pool/mod.rs (2)

1-24: LGTM!

The imports, module declarations, and re-exports are well-structured and appropriate for the pool registration functionality.


70-84: LGTM!

The unregistration flow is correctly ordered: it first unregisters the D-Bus object (line 75), then removes the pool from the manager state (lines 77-81). This ensures that if the D-Bus unregistration fails, the manager state remains consistent.

src/dbus/blockdev/blockdev_3_3/props.rs (1)

10-15: LGTM!

The new_physical_size_prop function correctly maps the optional new_size from the block device to a D-Bus-compatible tuple representation using option_to_tuple.

src/dbus/blockdev/blockdev_3_0/props.rs (2)

29-41: Proper error handling for missing pool paths.

This correctly returns an error when the pool object path cannot be found, rather than returning a default placeholder path. This addresses the D-Bus contract requirements.


51-54: FIXME: Consider lazy evaluation.

The comment notes that option_to_tuple could be made lazy. This is a minor optimization opportunity where the default String::new() allocation could be avoided when the option has a value.

src/dbus/blockdev/blockdev_3_1/mod.rs (1)

48-60: LGTM!

The register function correctly constructs the BlockdevR1 instance and registers it on the D-Bus object server. Error propagation is handled via ?.

src/dbus/blockdev/blockdev_3_0/methods.rs (1)

13-53: LGTM!

The set_user_info_method implementation is well-structured:

  • Properly handles the async pool lookup with appropriate error conversion
  • Covers all RenameAction variants (NoSource, Renamed, Identity)
  • Uses consistent error codes (DbusErrorEnum::ERROR/OK) and response formatting
  • The default return value using DevUuid::nil() appropriately signals no change occurred
src/dbus/blockdev/blockdev_3_8/mod.rs (2)

27-62: LGTM: BlockdevR8 struct and registration logic are well-structured.

The struct properly stores all required context (engine, manager, parent_uuid, uuid) and the register function correctly instantiates and registers the object with the D-Bus object server.


64-165: LGTM: D-Bus interface implementation is correct.

Property methods properly delegate to the shared blockdev_prop helpers with appropriate signal emission settings (const, false, or default). The interface name matches the expected version (r8).

src/dbus/blockdev/blockdev_3_4/mod.rs (2)

27-62: LGTM: BlockdevR4 struct and registration follow the established pattern.


64-165: LGTM: D-Bus interface correctly implements org.storage.stratis3.blockdev.r4.

Property implementations correctly delegate to shared helpers with appropriate emission settings.

src/dbus/blockdev/blockdev_3_7/mod.rs (2)

28-63: LGTM: BlockdevR7 struct and registration logic are correct.


65-166: LGTM: D-Bus interface correctly implements org.storage.stratis3.blockdev.r7.

src/dbus/blockdev/blockdev_3_3/mod.rs (3)

26-28: LGTM: Properly declares and re-exports new_physical_size_prop.

This module serves as the source for new_physical_size_prop which is correctly re-exported for use by other BlockdevRX versions (R4, R7, R8, R9).


30-65: LGTM: BlockdevR3 struct and registration logic are well-structured.


67-168: LGTM: D-Bus interface correctly implements org.storage.stratis3.blockdev.r3.

src/dbus/blockdev/blockdev_3_9/mod.rs (2)

27-62: LGTM: BlockdevR9 struct and registration logic are correct.


64-165: LGTM: D-Bus interface correctly implements org.storage.stratis3.blockdev.r9.

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

30-145: BlockdevR0 registration and property wiring look consistent and correct

The struct layout, register helper, and D‑Bus interface implementation all line up cleanly with the shared helpers (blockdev_prop, pool_prop, set_user_info_method). Ownership via Arc/Lockable and the use of OwnedObjectPath for Pool are appropriate; I don’t see functional or concurrency issues in this module.

src/dbus/blockdev/blockdev_3_2/mod.rs (1)

26-61: R2 interface and registration mirror R0 cleanly

BlockdevR2’s constructor, register helper, SetUserInfo wiring, and property implementations all consistently reuse the shared helpers from blockdev_3_0/shared.rs. The use of OwnedObjectPath for Pool and DevUuid for Uuid matches the props signatures and looks sound; I don’t see functional issues in this module.

Also applies to: 63-142

Copy link

@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: 0

♻️ Duplicate comments (4)
src/dbus/blockdev/shared.rs (2)

24-29: Fix the incorrect error message.

The error message at line 28 references "filesystem" but this function operates on block devices. This should say "No block device associated with UUID" for accurate debugging.

         .and_then(|v| {
-            v.ok_or_else(|| Error::Failed(format!("No filesystem associated with UUID {bd_uuid}")))
+            v.ok_or_else(|| Error::Failed(format!("No block device associated with UUID {bd_uuid}")))
         })?;

47-49: Fix the incorrect error message.

The error message references "filesystem" but this function operates on block devices. This should say "No block device associated with UUID" for consistency and accurate debugging.

     let (tier, bd) = guard
         .get_blockdev(bd_uuid)
-        .ok_or_else(|| Error::Failed(format!("No filesystem associated with UUID {bd_uuid}")))?;
+        .ok_or_else(|| Error::Failed(format!("No block device associated with UUID {bd_uuid}")))?;
src/dbus/blockdev/mod.rs (1)

56-146: Roll back partial registrations on error.

If any BlockdevRX::register call fails mid-sequence, previously registered interfaces remain on the D-Bus object server without corresponding manager mappings. This creates orphaned D-Bus objects.

Consider wrapping the registration sequence to clean up on failure:

if let Err(e) = async {
    BlockdevR0::register(...).await?;
    BlockdevR1::register(...).await?;
    // ... all others
    Ok::<_, StratisError>(())
}.await {
    let _ = connection.object_server().remove::<BlockdevR0, _>(&path).await;
    let _ = connection.object_server().remove::<BlockdevR1, _>(&path).await;
    // ... cleanup all
    return Err(e);
}
src/dbus/pool/mod.rs (1)

33-67: Unregister PoolR9 on get_pool failure and drop pool before async blockdev registration

Right now the flow is:

  • You successfully call PoolR9::register(...) for path.
  • Then you call engine.get_pool(...). If this returns None, you immediately return an Err (Line 64–66) but never undo the registration.

That leaves a PoolR9 object pinned in the connection’s object server for a pool we consider “gone”, which makes the D‑Bus view inconsistent with the engine/manager state.

Additionally, in the Some(pool) branch you build bd_uuids from pool.blockdevs() and then await inside the for dev_uuid in bd_uuids loop; unless pool is trivially cheap, it’s safer to drop it before entering the async loop to avoid holding any underlying guards/locks across .await.

A concrete fix would look like:

@@
-    PoolR9::register(
+    PoolR9::register(
         engine,
         connection,
         manager,
         counter,
         path.clone(),
         pool_uuid,
     )
     .await?;
 
-    match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
-        Some(pool) => {
-            manager.write().await.add_pool(&path, pool_uuid);
-
-            let mut bd_paths = Vec::new();
-            let bd_uuids = pool.blockdevs().into_iter().map(|(u, _, _)| u).collect::<Vec<_>>();
-            for dev_uuid in bd_uuids {
+    let pool = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
+        Some(pool) => pool,
+        None => {
+            // Tear down the D‑Bus object we just registered before surfacing the error.
+            let _ = PoolR9::unregister(connection, path.clone()).await;
+            return Err(StratisError::Msg(format!(
+                "Pool with {pool_uuid} was successfully started but appears to have been removed before it could be exposed on the D-Bus"
+            )));
+        }
+    };
+
+    manager.write().await.add_pool(&path, pool_uuid);
+
+    let mut bd_paths = Vec::new();
+    let bd_uuids = pool.blockdevs().into_iter().map(|(u, _, _)| u).collect::<Vec<_>>();
+    drop(pool);
+    for dev_uuid in bd_uuids {
         match register_blockdev(engine, connection, manager, counter, pool_uuid, dev_uuid).await {
             Ok(op) => bd_paths.push(op),
             Err(_) => {
                 warn!("Unable to register object path for blockdev with UUID {dev_uuid} belonging to pool {pool_uuid} on the D-Bus");
             },
         }
-        }
-        None => {
-            Err(StratisError::Msg(format!("Pool with {pool_uuid} was successfully started but appears to have been removed before it could be exposed on the D-Bus")))
-        }
-    }
+    }
+    Ok((path, bd_paths))

This keeps the D‑Bus and manager/engine views aligned even on failure and avoids holding pool across async registration of blockdevs.

🧹 Nitpick comments (2)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)

131-141: Inconsistent emits_changed_signal annotation.

TotalPhysicalSize uses #[zbus(property)] without an explicit emits_changed_signal specification, while all other properties explicitly declare their signal behavior. This may result in the default behavior (typically "true"), which might not be the intended semantics for a property that can change when the block device is resized.

Consider adding an explicit annotation for consistency and correctness:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
src/dbus/blockdev/blockdev_3_6/mod.rs (1)

85-89: Add explicit emits_changed_signal values to UserInfo and NewPhysicalSize

The web search confirms that zbus defaults to emits_changed_signal = "true" when the annotation is omitted, which appears in D-Bus introspection as org.freedesktop.DBus.Property.EmitsChangedSignal="true".

In this file, most properties explicitly set emits_changed_signal to either "const" (Devnode, HardwareInfo, InitializationTime, Pool, Uuid, PhysicalPath) or "false" (Tier). However, UserInfo and NewPhysicalSize omit this value, causing them to default to "true" and emit change signals, which is inconsistent with the majority of other properties in the interface.

For D-Bus contract clarity and consistency, explicitly set emits_changed_signal for both properties (e.g., "false" if they should not emit signals, or "const" if appropriate).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52a899b and f3c7d91.

📒 Files selected for processing (17)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/dbus/blockdev/blockdev_3_3/props.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/blockdev/mod.rs
  • src/dbus/blockdev/shared.rs
  • src/dbus/pool/mod.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
🧬 Code graph analysis (12)
src/dbus/blockdev/blockdev_3_1/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/mod.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • register (52-64)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • register (48-60)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • register (48-60)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • register (52-64)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • register (50-62)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • register (50-62)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/shared.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • Uuid (123-125)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_2/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/mod.rs (10)
src/dbus/util.rs (12)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus/pool/pool_3_9/mod.rs (2)
  • connection (73-73)
  • new (33-47)
src/dbus/blockdev/mod.rs (1)
  • register_blockdev (43-148)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/pool/mod.rs (1)
  • pool (53-53)
src/dbus/manager/manager_3_9/mod.rs (1)
  • new (47-59)
src/dbus/manager/manager_3_0/mod.rs (1)
  • new (39-51)
src/engine/types/mod.rs (4)
  • new (178-180)
  • new (277-279)
  • new (310-322)
  • new (375-377)
src/dbus/udev.rs (1)
  • new (25-39)
src/engine/structures/lock.rs (1)
  • new_shared (84-86)
src/dbus/blockdev/blockdev_3_8/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_0/methods.rs (13)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • Uuid (123-125)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • Uuid (120-122)
src/engine/strat_engine/thinpool/filesystem.rs (1)
  • format (156-162)
src/dbus/pool/mod.rs (1)
  • pool (53-53)
src/dbus/blockdev/blockdev_3_7/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/props.rs (5)
  • devnode_prop (13-15)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_5/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_4/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_6/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_3/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-54)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: stratis-cli-checks
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks-with-ci-repo
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
🔇 Additional comments (17)
src/dbus/blockdev/blockdev_3_1/mod.rs (2)

1-61: LGTM on struct definition and registration.

The BlockdevR1 struct and register method follow the established pattern from other BlockdevRX variants, correctly cloning the manager handle and registering the instance on the D-Bus object server.


63-117: Interface methods and properties are correctly implemented.

The SetUserInfo method and property getters delegate appropriately to the shared helpers and reuse code from blockdev_3_0. The emits_changed_signal annotations are consistent with the expected mutability characteristics of each property.

src/dbus/blockdev/shared.rs (1)

11-34: set_blockdev_prop is marked #[allow(dead_code)] — verify intended usage.

The function is allowed as dead code, suggesting it may be reserved for future use. Confirm this is intentional and consider adding a brief doc comment explaining its purpose or removing it if not needed.

src/dbus/blockdev/mod.rs (1)

43-55: LGTM on path generation.

The atomic counter with Ordering::AcqRel correctly ensures unique path generation across concurrent registrations.

src/dbus/blockdev/blockdev_3_0/methods.rs (1)

13-53: LGTM!

The set_user_info_method correctly handles all RenameAction outcomes, uses appropriate error codes, and follows the established D-Bus method return pattern for stratisd.

src/dbus/mod.rs (2)

34-55: LGTM!

The create_dbus_handler function correctly initializes the D-Bus subsystem with proper Arc sharing of the connection, counter, and manager. The error propagation via ? ensures failures at any step bubble up appropriately.


10-15: Public API surface is well-organized.

The re-exports provide a clean public interface for external consumers of the D-Bus module, exposing only the necessary types and registration functions.

src/dbus/blockdev/blockdev_3_8/mod.rs (1)

27-165: BlockdevR8 D‑Bus surface looks consistent and correctly wired

The struct fields, register helper, and all property accessors cleanly delegate to the shared helpers (blockdev_prop, pool_prop, new_physical_size_prop) and match the established pattern from the other blockdev R* interfaces. I don’t see correctness or lifetime issues here.

src/dbus/blockdev/blockdev_3_4/mod.rs (1)

27-165: BlockdevR4 implementation mirrors other versions cleanly

BlockdevR4’s struct, register helper, and property methods are a straightforward clone of the proven pattern (via blockdev_prop, pool_prop, new_physical_size_prop). I don’t see any functional or lifetime issues here.

src/dbus/blockdev/blockdev_3_9/mod.rs (1)

27-165: BlockdevR9 D‑Bus surface is consistent with prior R variants*

The BlockdevR9 struct, register function, and property accessors are wired exactly like the earlier revisions, delegating to the shared helpers and manager without introducing new edge cases. Looks good.

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

26-168: BlockdevR3 + new_physical_size_prop re-export look correct

The R3 module cleanly introduces its props submodule, re‑exports new_physical_size_prop, and wires all properties via the shared helpers (blockdev_prop, pool_prop). The register helper and interface definition follow the same, already‑validated pattern; no issues spotted.

src/dbus/blockdev/blockdev_3_7/mod.rs (1)

28-165: BlockdevR7 follows the shared blockdev property pattern

BlockdevR7 correctly reuses the common property helpers and new_physical_size_prop, and its register method mirrors the other versions. I don’t see any functional problems here.

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

30-146: Baseline BlockdevR0 interface and helpers look solid

BlockdevR0 cleanly wraps set_user_info_method and routes all properties through the shared helpers (blockdev_prop, pool_prop, etc.), matching the pattern reused by the higher‑revision interfaces. I don’t see any correctness or concurrency issues in this module.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

27-165: BlockdevR5 implementation is consistent and reuse-focused

The BlockdevR5 struct/register combo and its D‑Bus properties all delegate to the shared helpers and new_physical_size_prop, in line with the other R* implementations. No issues stand out.

src/dbus/blockdev/blockdev_3_2/mod.rs (1)

26-141: BlockdevR2 registration and property wiring look correct

Struct fields, constructor, register, SetUserInfo, and all properties are consistently wired through the shared helpers (blockdev_prop, pool_prop, set_user_info_method) and match the established blockdev patterns. I don't see any functional or API-surface issues here.

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

28-63: BlockdevR6 object construction and shared-property usage look solid

BlockdevR6 mirrors the R2 pattern, register cleanly binds the interface on the connection, and all read-side properties are correctly delegated to the shared helpers (blockdev_prop, pool_prop, new_physical_size_prop). No obvious correctness or API issues here.

Also applies to: 65-83, 107-153

src/dbus/blockdev/blockdev_3_0/props.rs (1)

13-54: Shared blockdev_3_0 property helpers and pool_prop are well-structured

The property helpers are simple, side-effect-free views over BlockDev, and pool_prop now correctly looks up and clones the real pool object path via pool_get_path, returning a descriptive Error::Failed when missing. This aligns with how later blockdev surfaces consume these helpers and avoids the earlier issue of returning the default / path.

Copy link

@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: 0

♻️ Duplicate comments (3)
src/dbus/blockdev/shared.rs (2)

47-49: Fix the incorrect error message.

The error message references "filesystem" but this function operates on block devices. This should say "No block device associated with UUID" for consistency and accurate debugging.

Apply this diff:

     let (tier, bd) = guard
         .get_blockdev(bd_uuid)
-        .ok_or_else(|| Error::Failed(format!("No filesystem associated with UUID {bd_uuid}")))?;
+        .ok_or_else(|| Error::Failed(format!("No block device associated with UUID {bd_uuid}")))?;

24-29: Fix the incorrect error message.

Line 28 references "filesystem" but this function operates on block devices. The error message should say "No block device associated with UUID" for consistency and accurate debugging.

Apply this diff:

     let (tier, bd) = guard
         .get_mut_blockdev(bd_uuid)
         .map_err(|e| Error::Failed(e.to_string()))
         .and_then(|v| {
-            v.ok_or_else(|| Error::Failed(format!("No filesystem associated with UUID {bd_uuid}")))
+            v.ok_or_else(|| Error::Failed(format!("No block device associated with UUID {bd_uuid}")))
         })?;
src/dbus/blockdev/mod.rs (1)

43-148: Roll back partial registrations on error.

If any BlockdevRX::register call fails mid-sequence, previously registered interfaces remain on the D-Bus object server while the manager is never updated, creating orphaned D-Bus objects. Consider wrapping the registration sequence in error handling that removes previously registered interfaces if a later registration fails.

🧹 Nitpick comments (3)
src/dbus/blockdev/blockdev_3_3/props.rs (1)

17-20: Track the set_UserInfo implementation.

This is a no-op stub marked FIXME. Ensure this placeholder is addressed before the property setter is exposed in the D-Bus interface.

Do you want me to open a tracking issue for implementing the set_user_info_prop functionality, or is this already planned for a follow-up?

src/dbus/blockdev/blockdev_3_8/mod.rs (1)

64-165: LGTM, but note the FIXME for set_UserInfo.

The D-Bus interface properties are correctly implemented. The commented-out set_UserInfo property setter (lines 90-104) is marked FIXME and should be tracked for future implementation.

Do you want me to open a tracking issue for implementing the set_UserInfo property setter across all blockdev versions?

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

30-168: LGTM! Consistent BlockdevR3 implementation.

The D-Bus interface implementation follows the established pattern across all blockdev versions. Property delegation to shared helpers is correct, and the new NewPhysicalSize property is properly wired.

Regarding the commented-out set_UserInfo property setter (lines 93-107): If you'd like to implement this, I can help generate the required set_blockdev_prop helper or open an issue to track it.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3c7d91 and 3b6873f.

📒 Files selected for processing (17)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/dbus/blockdev/blockdev_3_9/mod.rs
  • src/dbus/pool/mod.rs
  • src/dbus/blockdev/blockdev_3_2/mod.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/blockdev/shared.rs
  • src/dbus/blockdev/mod.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
🧬 Code graph analysis (11)
src/dbus/blockdev/blockdev_3_1/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_3/mod.rs (6)
  • new (38-50)
  • Devnode (71-73)
  • HardwareInfo (77-85)
  • Pool (117-119)
  • Uuid (123-125)
  • Tier (129-131)
src/dbus/blockdev/blockdev_3_8/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (5)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/shared.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • Uuid (109-111)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • Uuid (123-125)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • Uuid (121-123)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • Uuid (120-122)
src/dbus/blockdev/mod.rs (13)
src/stratis/keys.rs (1)
  • engine (28-46)
src/engine/strat_engine/metadata/bda.rs (1)
  • dev_uuid (125-127)
src/engine/strat_engine/thinpool/filesystem.rs (1)
  • format (156-162)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • register (52-64)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • register (48-60)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • register (48-60)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • register (52-64)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • register (50-62)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • register (50-62)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_4/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_0/methods.rs (2)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (113-115)
src/dbus/pool/mod.rs (1)
  • pool (53-53)
src/dbus/blockdev/blockdev_3_0/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/mod.rs (2)
src/dbus/manager/mod.rs (1)
  • register_manager (123-144)
src/dbus/udev.rs (1)
  • new (25-39)
src/dbus/blockdev/blockdev_3_7/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_6/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (36-52)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_0/props.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • new (38-50)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • new (34-46)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • new (34-46)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • new (38-50)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • new (36-48)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • new (36-48)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • new (35-47)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: python-based-tests
  • GitHub Check: stratis-min-cli-checks
🔇 Additional comments (13)
src/dbus/mod.rs (1)

34-55: LGTM!

The create_dbus_handler function correctly orchestrates D-Bus setup: creates shared state, builds the connection with the Stratis service name, registers all manager interfaces, and returns the wired components for the caller.

src/dbus/blockdev/blockdev_3_3/props.rs (1)

10-15: LGTM!

The new_physical_size_prop correctly retrieves the new size from the block device and formats it as a D-Bus-compatible tuple.

src/dbus/blockdev/blockdev_3_1/mod.rs (2)

26-61: LGTM!

The BlockdevR1 struct and registration logic follow the established pattern used across other blockdev versions, correctly wiring the engine, manager, and UUIDs.


63-142: LGTM!

The D-Bus interface properties and methods are correctly implemented, delegating to shared property helpers and maintaining consistency with the blockdev interface contract.

src/dbus/blockdev/blockdev_3_0/methods.rs (1)

13-53: LGTM!

The set_user_info_method correctly handles the full workflow: pool lookup, user info update via the engine, and mapping of RenameAction outcomes to D-Bus response tuples with appropriate status codes.

src/dbus/blockdev/blockdev_3_8/mod.rs (1)

27-62: LGTM!

The BlockdevR8 struct and registration logic follow the established pattern, correctly integrating with the engine, manager, and D-Bus connection.

src/dbus/blockdev/blockdev_3_4/mod.rs (2)

27-62: LGTM!

The BlockdevR4 struct and registration method follow the established pattern used across blockdev versions, correctly wiring the necessary components.


64-165: LGTM, but note the FIXME for set_UserInfo.

The D-Bus interface properties are correctly implemented using shared helpers. The commented-out set_UserInfo property setter (lines 90-104) with FIXME should be tracked for future implementation.

src/dbus/blockdev/blockdev_3_7/mod.rs (1)

28-166: LGTM! BlockdevR7 implementation is consistent.

The implementation correctly follows the established pattern and properly imports new_physical_size_prop from the blockdev_3_3 module. All property delegations are correct.

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

30-146: LGTM! BlockdevR0 implementation is solid.

The base blockdev interface is well-structured. The SetUserInfo method (lines 69-73) correctly delegates to set_user_info_method and returns the appropriate status tuple. All property implementations properly delegate to shared helpers.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

27-165: LGTM! BlockdevR5 follows the established pattern.

Property implementations are correct and consistent with other versions. All delegations to shared helpers work properly.

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

28-166: LGTM! BlockdevR6 implementation is consistent.

All property implementations correctly delegate to shared helpers. The interface follows the established pattern.

src/dbus/blockdev/blockdev_3_0/props.rs (1)

13-53: LGTM! Property helper functions are well-implemented.

All property accessors correctly delegate to the underlying BlockDev trait methods with appropriate transformations. The pool_prop implementation (lines 29-41) properly retrieves the pool path from the Manager and provides a clear error message when the path is not found.

Copy link

@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: 0

♻️ Duplicate comments (1)
src/dbus/blockdev/shared.rs (1)

49-51: Fix the incorrect error message.

The error message references "filesystem" but this function operates on block devices. This was previously flagged and should be corrected.

     let (tier, bd) = guard
         .get_blockdev(bd_uuid)
-        .ok_or_else(|| Error::Failed(format!("No filesystem associated with UUID {bd_uuid}")))?;
+        .ok_or_else(|| Error::Failed(format!("No block device associated with UUID {bd_uuid}")))?;
🧹 Nitpick comments (15)
src/dbus/blockdev/blockdev_3_3/props.rs (1)

17-20: Address the FIXME placeholder.

This is a stub function with a FIXME comment. The #[allow(dead_code)] attribute confirms it's not yet wired into the D-Bus surface.

Would you like me to help implement the set_user_info_prop function, or should I open an issue to track this task?

src/dbus/blockdev/blockdev_3_1/mod.rs (1)

135-145: Consider adding emits_changed_signal annotation for consistency.

The TotalPhysicalSize property uses #[zbus(property)] without an explicit emits_changed_signal value, unlike other properties in this interface (e.g., Devnode, PhysicalPath use "const", UserInfo and Tier use "false"). If the size can change at runtime, "false" would be appropriate; if it's constant, "const" would be more accurate.

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn TotalPhysicalSize(&self) -> Result<String, Error> {
src/dbus/blockdev/blockdev_3_8/mod.rs (2)

106-114: Consider simplifying the nested Result unwrapping.

The nested match can be simplified using and_then:

     #[zbus(property(emits_changed_signal = "const"))]
     #[allow(non_snake_case)]
     async fn InitializationTime(&self) -> Result<u64, Error> {
-        match blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop).await {
-            Ok(Err(r)) => Err(r),
-            Err(r) => Err(r),
-            Ok(Ok(r)) => Ok(r),
-        }
+        blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop)
+            .await
+            .and_then(|r| r)
     }

90-104: Track the set_UserInfo placeholder for future implementation.

The commented-out setter appears across all BlockdevRN versions. Consider creating an issue to track this pending implementation.

Would you like me to open an issue to track the set_UserInfo implementation across all blockdev versions?

src/dbus/blockdev/blockdev_3_4/mod.rs (1)

106-114: Same simplification opportunity as other versions.

The nested match for InitializationTime could use .and_then(|r| r) as suggested for BlockdevR8.

src/dbus/blockdev/blockdev_3_9/mod.rs (1)

106-114: Same nested match pattern as other versions.

Consider applying the .and_then(|r| r) simplification consistently across all BlockdevRN implementations.

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

109-117: Same InitializationTime simplification opportunity.

This nested match pattern appears across all BlockdevRN versions. Consider applying the .and_then(|r| r) refactor consistently.

src/dbus/blockdev/blockdev_3_7/mod.rs (2)

109-115: Consider flattening the nested Result pattern.

The nested match with Ok(Err(r)), Err(r), and Ok(Ok(r)) works but is verbose. Since init_time_prop returns Result<u64, Error> and blockdev_prop wraps it, you could simplify with and_then or a helper:

 async fn InitializationTime(&self) -> Result<u64, Error> {
-    match blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop).await {
-        Ok(Err(r)) => Err(r),
-        Err(r) => Err(r),
-        Ok(Ok(r)) => Ok(r),
-    }
+    blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop)
+        .await?
 }

Note: This pattern appears in all BlockdevR* implementations—if simplified, consider updating them all for consistency.


91-105: Track or remove the commented set_UserInfo FIXME.

The commented-out set_UserInfo property setter has been present since R5. If this feature is planned, consider opening an issue to track it; otherwise, remove the commented code to reduce maintenance noise.

Do you want me to help draft an issue or verify if this is already tracked?

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

101-107: Consider flattening the nested Result pattern.

The nested match with Ok(Err(r)), Err(r), and Ok(Ok(r)) works but is verbose:

 async fn InitializationTime(&self) -> Result<u64, Error> {
-    match blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop).await {
-        Ok(Err(r)) => Err(r),
-        Err(r) => Err(r),
-        Ok(Ok(r)) => Ok(r),
-    }
+    blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop)
+        .await?
 }
src/dbus/blockdev/blockdev_3_5/mod.rs (2)

108-114: Consider flattening the nested Result pattern.

Same nested match pattern as in other versions:

 async fn InitializationTime(&self) -> Result<u64, Error> {
-    match blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop).await {
-        Ok(Err(r)) => Err(r),
-        Err(r) => Err(r),
-        Ok(Ok(r)) => Ok(r),
-    }
+    blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop)
+        .await?
 }

90-104: Track or remove the commented set_UserInfo FIXME.

This commented property setter appears in R5, R6, and R7. Consider tracking this as a feature request or removing the placeholder.

src/dbus/blockdev/blockdev_3_2/mod.rs (1)

97-103: Consider flattening the nested Result pattern.

Same nested match pattern:

 async fn InitializationTime(&self) -> Result<u64, Error> {
-    match blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop).await {
-        Ok(Err(r)) => Err(r),
-        Err(r) => Err(r),
-        Ok(Ok(r)) => Ok(r),
-    }
+    blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop)
+        .await?
 }
src/dbus/blockdev/blockdev_3_6/mod.rs (2)

109-115: Consider flattening the nested Result pattern.

Same nested match pattern as in all other versions:

 async fn InitializationTime(&self) -> Result<u64, Error> {
-    match blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop).await {
-        Ok(Err(r)) => Err(r),
-        Err(r) => Err(r),
-        Ok(Ok(r)) => Ok(r),
-    }
+    blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop)
+        .await?
 }

91-105: Track or remove the commented set_UserInfo FIXME.

This commented property setter appears across R5, R6, and R7. Consider tracking as a feature or removing to reduce clutter.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b6873f and ebc91de.

📒 Files selected for processing (17)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/dbus/pool/mod.rs
  • src/dbus/blockdev/mod.rs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/blockdev/blockdev_3_0/props.rs
  • src/dbus/blockdev/shared.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
🧬 Code graph analysis (11)
src/dbus/blockdev/blockdev_3_1/mod.rs (2)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • new (34-46)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • new (38-50)
src/dbus/blockdev/blockdev_3_0/props.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • new (38-50)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • new (34-46)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • new (34-46)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • new (38-50)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • new (36-48)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • new (36-48)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_9/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_4/mod.rs (2)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/shared.rs (11)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (117-119)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • Uuid (127-129)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • Uuid (124-126)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • Uuid (124-126)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • Uuid (125-127)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • Uuid (125-127)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • Uuid (124-126)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • Uuid (124-126)
src/dbus/mod.rs (4)
src/dbus/blockdev/mod.rs (1)
  • register_blockdev (43-148)
src/dbus/manager/mod.rs (1)
  • register_manager (123-144)
src/dbus/udev.rs (1)
  • new (25-39)
src/engine/structures/lock.rs (1)
  • new_shared (84-86)
src/dbus/blockdev/blockdev_3_5/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_7/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_0/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_0/methods.rs (4)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (117-119)
src/engine/strat_engine/thinpool/filesystem.rs (1)
  • format (156-162)
src/dbus/pool/mod.rs (1)
  • pool (53-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: python-based-tests
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: stratis-min-cli-checks
🔇 Additional comments (17)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)

13-53: LGTM! Clean implementation of the D-Bus method.

The function correctly handles all RenameAction variants with appropriate status codes and error messages. The pattern of using a default return value with DevUuid::nil() for unchanged cases aligns with D-Bus conventions for optional return data.

src/dbus/blockdev/blockdev_3_3/props.rs (1)

10-15: LGTM! Correct property accessor implementation.

The new_physical_size_prop function properly converts the optional new_size to a D-Bus-compatible tuple using option_to_tuple.

src/dbus/blockdev/shared.rs (1)

11-36: LGTM! Proper error handling for mutable access.

The set_blockdev_prop function correctly propagates errors from get_mut_blockdev using map_err and provides clear error messages for missing pool/block device.

src/dbus/blockdev/blockdev_3_1/mod.rs (1)

26-61: LGTM! Well-structured D-Bus interface registration.

The BlockdevR1 struct and its register method follow the established pattern from other blockdev versions, correctly wiring up the engine, manager, and connection.

src/dbus/mod.rs (1)

34-55: LGTM! Clean D-Bus handler initialization.

The create_dbus_handler function properly:

  • Creates shared state (counter, manager) with appropriate synchronization primitives
  • Establishes the D-Bus system connection with the Stratis service name
  • Registers all manager interfaces before creating the UdevHandler
  • Returns the necessary components for further D-Bus operations

The error propagation via ? ensures failures are surfaced to callers.

src/dbus/blockdev/blockdev_3_8/mod.rs (1)

27-62: LGTM! BlockdevR8 struct and registration follow established patterns.

The struct definition and register function correctly implement the D-Bus object registration, consistent with other BlockdevRN versions.

src/dbus/blockdev/blockdev_3_4/mod.rs (1)

27-62: LGTM! BlockdevR4 implementation is consistent with the R0-R9 family.

The struct and registration logic correctly follow the established pattern.

src/dbus/blockdev/blockdev_3_9/mod.rs (1)

27-62: LGTM! BlockdevR9 correctly completes the R0-R9 interface family.

The implementation maintains consistency with other versions.

src/dbus/blockdev/blockdev_3_0/props.rs (1)

13-53: LGTM! Property accessors are well-structured and reusable.

The functions correctly implement the property access pattern with appropriate error handling. The init_time_prop properly handles the potential u64 conversion failure for timestamps, and pool_prop provides a clear error message when the pool path is not found.

src/dbus/blockdev/blockdev_3_3/mod.rs (2)

26-28: LGTM! Module organization correctly introduces new_physical_size_prop.

BlockdevR3 appropriately declares the props module and re-exports new_physical_size_prop for use by later versions (R4-R9).


30-65: BlockdevR3 struct and registration are consistent with the interface family.

The implementation follows the established pattern.

src/dbus/blockdev/blockdev_3_7/mod.rs (1)

28-62: LGTM: Clean struct and registration pattern.

The BlockdevR7 struct and register method follow the established pattern for D-Bus blockdev interfaces, correctly wiring the engine, manager, and UUIDs through to the zbus object server.

src/dbus/blockdev/blockdev_3_0/mod.rs (2)

30-64: LGTM: Well-structured BlockdevR0 foundation.

The struct and registration logic are clean and correctly establish the base pattern for the R0 interface. The SetUserInfo method (lines 69-73) provides the mutable operation that later versions expose differently.


93-97: Note: UserInfo signal emission differs from R5/R6/R7.

BlockdevR0 specifies emits_changed_signal = "false" for UserInfo, while R5, R6, and R7 use the default emission behavior (which emits changes). If this is intentional API evolution, it's fine; otherwise, consider aligning the signal behavior across versions for consistency.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

27-61: LGTM: BlockdevR5 correctly extends the pattern.

The struct and registration logic follow the established pattern and correctly integrate the NewPhysicalSize property introduced in this version.

src/dbus/blockdev/blockdev_3_2/mod.rs (1)

26-60: LGTM: BlockdevR2 correctly follows the R0/R2 pattern.

The struct and registration logic are consistent with R0, providing the SetUserInfo method and omitting NewPhysicalSize as appropriate for this version.

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

28-62: LGTM: BlockdevR6 follows the established pattern correctly.

The struct and registration logic cleanly implement the R6 interface with the expected property set.

Copy link

@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: 1

♻️ Duplicate comments (4)
src/dbus/blockdev/shared.rs (1)

49-51: Fix the incorrect error message.

The error message references "filesystem" but this function operates on block devices. This should say "No block device associated with UUID" for consistency and accurate debugging.

     let (tier, bd) = guard
         .get_blockdev(bd_uuid)
-        .ok_or_else(|| Error::Failed(format!("No filesystem associated with UUID {bd_uuid}")))?;
+        .ok_or_else(|| Error::Failed(format!("No block device associated with UUID {bd_uuid}")))?;
src/dbus/blockdev/mod.rs (1)

56-147: Roll back partial registrations on error.

If any BlockdevRX::register call fails after previous registrations succeeded, the function returns immediately via ?, leaving previously registered blockdev interfaces pinned in the D-Bus object server. The Manager update on line 146 never executes, creating an inconsistent state where orphaned D-Bus objects exist without corresponding manager mappings.

Consider wrapping the registration sequence in error handling that unregisters previously registered interfaces on failure, or document that partial registration failures are expected to be fatal for the daemon.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

84-88: Align UserInfo property emission behavior (same as R7).

Same issue as in BlockdevR7: the UserInfo property should explicitly set emits_changed_signal = "false" to match R0 and R2.

Apply this diff:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn UserInfo(&self) -> Result<(bool, String), Error> {
src/dbus/blockdev/blockdev_3_6/mod.rs (1)

85-89: Align UserInfo property emission behavior (same as R5/R7).

Same issue as in BlockdevR5 and BlockdevR7: the UserInfo property should explicitly set emits_changed_signal = "false" to match R0 and R2.

Apply this diff:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn UserInfo(&self) -> Result<(bool, String), Error> {
🧹 Nitpick comments (6)
src/dbus/blockdev/blockdev_3_3/props.rs (1)

17-20: Address the FIXME placeholder.

This function is marked with #[allow(dead_code)] and contains a FIXME comment indicating incomplete implementation. If property setters are needed for the D-Bus interface, the implementation should be completed.

Would you like me to help implement this setter or open an issue to track this task?

src/dbus/blockdev/blockdev_3_1/mod.rs (1)

97-103: Consider simplifying nested Result handling.

The nested match can be simplified using transpose() or flatten() for cleaner code:

     #[zbus(property(emits_changed_signal = "const"))]
     #[allow(non_snake_case)]
     async fn InitializationTime(&self) -> Result<u64, Error> {
-        match blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop).await {
-            Ok(Err(r)) => Err(r),
-            Err(r) => Err(r),
-            Ok(Ok(r)) => Ok(r),
-        }
+        blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop)
+            .await
+            .and_then(|r| r)
     }
src/dbus/blockdev/blockdev_3_8/mod.rs (2)

90-104: Track the FIXME for set_UserInfo implementation.

The commented-out setter indicates incomplete functionality. Consider creating a tracking issue to ensure this doesn't get forgotten.

Would you like me to open a new issue to track the implementation of set_UserInfo across all BlockdevR* interfaces?


106-114: Consider simplifying nested Result handling.

The current pattern works but could be more idiomatic using and_then or the ? operator with a flattening approach:

     async fn InitializationTime(&self) -> Result<u64, Error> {
-        match blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop).await {
-            Ok(Err(r)) => Err(r),
-            Err(r) => Err(r),
-            Ok(Ok(r)) => Ok(r),
-        }
+        blockdev_prop(&self.engine, self.parent_uuid, self.uuid, init_time_prop)
+            .await?
     }

This works because init_time_prop returns Result<u64, Error>, and blockdev_prop wraps it in another Result. The ? operator will propagate the outer error, and then the inner Result can be returned directly.

src/dbus/blockdev/blockdev_3_4/mod.rs (1)

64-169: Consider macro-based code generation for BlockdevR interfaces.*

BlockdevR4, R8, R9 (and likely R0-R7) share nearly identical implementations with only the interface name differing (org.storage.stratis3.blockdev.r4 vs .r8 vs .r9). This duplication is error-prone when changes need to be applied across all versions.

A declarative macro or build-time code generation could reduce maintenance burden:

// Example macro approach
blockdev_interface!(BlockdevR4, "org.storage.stratis3.blockdev.r4");
blockdev_interface!(BlockdevR8, "org.storage.stratis3.blockdev.r8");
// etc.

This is a low-priority refactor since the current approach works and provides explicit versioning.

src/dbus/blockdev/blockdev_3_7/mod.rs (1)

91-105: Track the FIXME for set_UserInfo implementation.

The commented-out set_UserInfo setter is marked with FIXME. If this functionality is planned for a future release, consider opening a tracking issue to ensure it doesn't get overlooked.

Would you like me to help draft an issue description for implementing the UserInfo property setter across the relevant BlockdevR* interfaces?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebc91de and 63400e4.

📒 Files selected for processing (17)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/blockdev/blockdev_3_0/mod.rs
  • src/dbus/pool/mod.rs
  • src/dbus/blockdev/shared.rs
  • src/dbus/blockdev/mod.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
🧬 Code graph analysis (10)
src/dbus/blockdev/blockdev_3_0/methods.rs (13)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (117-119)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • Uuid (113-115)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • Uuid (127-129)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • Uuid (124-126)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • Uuid (124-126)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • Uuid (125-127)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • Uuid (125-127)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • Uuid (124-126)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • Uuid (124-126)
src/engine/strat_engine/thinpool/filesystem.rs (1)
  • format (156-162)
src/dbus/pool/mod.rs (1)
  • pool (50-50)
src/dbus/blockdev/blockdev_3_0/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/mod.rs (7)
src/dbus/util.rs (12)
  • connection (87-89)
  • connection (100-102)
  • connection (129-131)
  • connection (138-140)
  • connection (153-155)
  • connection (162-164)
  • connection (171-173)
  • connection (180-182)
  • connection (189-191)
  • connection (198-200)
  • connection (207-209)
  • connection (216-218)
src/dbus/manager/mod.rs (1)
  • register_manager (123-144)
src/dbus/pool/mod.rs (1)
  • pool (50-50)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • new (38-50)
src/dbus/manager/manager_3_0/mod.rs (1)
  • new (39-51)
src/dbus/udev.rs (1)
  • new (25-39)
src/engine/structures/lock.rs (1)
  • new_shared (84-86)
src/dbus/blockdev/mod.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • register (52-64)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • register (48-60)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • register (48-60)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • register (52-64)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • register (50-62)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • register (50-62)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • register (49-61)
src/dbus/blockdev/blockdev_3_6/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_1/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_8/mod.rs (2)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_0/mod.rs (5)
  • new (38-50)
  • register (52-64)
  • Pool (111-113)
  • Uuid (117-119)
  • Tier (123-125)
src/dbus/blockdev/blockdev_3_0/props.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • new (38-50)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • new (34-46)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • new (34-46)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • new (38-50)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • new (36-48)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • new (36-48)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • new (35-47)
src/dbus/blockdev/blockdev_3_9/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
src/dbus/blockdev/blockdev_3_0/mod.rs (4)
  • new (38-50)
  • Pool (111-113)
  • Uuid (117-119)
  • Tier (123-125)
src/dbus/blockdev/blockdev_3_4/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (38-54)
src/dbus/blockdev/blockdev_3_3/props.rs (1)
  • new_physical_size_prop (10-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: python-based-tests
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: tests-with-testing-repo (master)
🔇 Additional comments (22)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)

13-53: LGTM!

The set_user_info_method implementation correctly handles all RenameAction variants and properly maps engine errors to D-Bus error responses. The use of tuple_to_option for converting D-Bus optional semantics is appropriate.

src/dbus/blockdev/blockdev_3_3/props.rs (1)

10-15: LGTM!

The property accessor correctly maps the optional new_size() to a D-Bus tuple representation using the option_to_tuple helper.

src/dbus/blockdev/shared.rs (1)

11-36: LGTM!

The set_blockdev_prop function properly handles both the pool lookup error and the block device lookup error with appropriate error chaining using map_err and and_then.

src/dbus/blockdev/blockdev_3_1/mod.rs (2)

135-145: Verify the emits_changed_signal annotation for TotalPhysicalSize.

This property uses #[zbus(property)] without an explicit emits_changed_signal attribute, while other properties in this interface explicitly specify "const" or "false". If TotalPhysicalSize can change (e.g., device resize), "false" would be appropriate; if it's immutable after initialization, "const" would be consistent with similar properties.


26-61: LGTM!

The BlockdevR1 struct and its register method follow the established pattern from BlockdevR0, correctly delegating to shared property helpers and the common set_user_info_method.

src/dbus/blockdev/mod.rs (1)

20-41: LGTM!

The module structure cleanly organizes the versioned blockdev interfaces (R0-R9) with appropriate public re-exports for external consumption.

src/dbus/mod.rs (2)

1-33: LGTM: Module structure and imports are well-organized.

The module declarations and public re-exports establish a clean API surface for the D-Bus subsystem.


34-55: Well-structured D-Bus handler initialization.

The function correctly:

  • Creates a shared counter for unique object path generation
  • Initializes the Manager with Lockable::new_shared
  • Builds the system D-Bus connection with the appropriate service name
  • Registers manager interfaces before constructing UdevHandler
  • Properly clones Arc references where needed

The use of ? for error propagation ensures that any failure during setup is properly bubbled up.

src/dbus/blockdev/blockdev_3_8/mod.rs (1)

27-62: LGTM: Struct and registration follow the established pattern.

The BlockdevR8 struct and its register method correctly mirror the pattern established in BlockdevR0 (as shown in the relevant snippets), maintaining consistency across interface versions.

src/dbus/blockdev/blockdev_3_4/mod.rs (1)

27-62: LGTM: Consistent implementation pattern.

The struct definition and registration logic correctly follow the established pattern for versioned blockdev interfaces.

src/dbus/pool/mod.rs (2)

26-65: LGTM: Pool registration flow is well-structured.

The implementation correctly:

  1. Checks pool existence before any D-Bus registration
  2. Generates a unique path using the atomic counter
  3. Registers the pool, then adds to manager tracking
  4. Gracefully handles blockdev registration failures with warnings

The approach of continuing despite individual blockdev failures maximizes availability while logging issues for debugging.


67-81: Manager state inconsistency if PoolR9::unregister fails.

If PoolR9::unregister returns an error (line 72), the function returns early without removing the pool from the manager's tracking map. This leaves the manager with a stale entry pointing to a UUID for a path that may be in an inconsistent state.

Consider whether the manager cleanup should happen regardless of unregister success:

 pub async fn unregister_pool(
     manager: &Lockable<Arc<RwLock<Manager>>>,
     connection: &Arc<Connection>,
     path: &ObjectPath<'_>,
 ) -> StratisResult<PoolUuid> {
-    PoolR9::unregister(connection, path.clone()).await?;
-
     let mut lock = manager.write().await;
     let uuid = lock
         .pool_get_uuid(path)
         .ok_or_else(|| StratisError::Msg(format!("No UUID associated with path {path}")))?;
     lock.remove_pool(path);
+    drop(lock);
+
+    PoolR9::unregister(connection, path.clone()).await?;

     Ok(uuid)
 }

Alternatively, if the current order is intentional (only remove from manager if D-Bus unregister succeeds), document this behavior.

src/dbus/blockdev/blockdev_3_9/mod.rs (2)

27-62: LGTM: BlockdevR9 struct and registration.

Implementation correctly follows the established pattern for the latest blockdev interface version.


64-169: LGTM: D-Bus interface properties are correctly exposed.

All property accessors properly delegate to shared helpers, and signal emission settings are appropriate:

  • const for immutable properties (Devnode, HardwareInfo, InitializationTime, Pool, Uuid, PhysicalPath)
  • false for Tier (can change but doesn't emit signals)
  • Default for mutable properties (UserInfo, TotalPhysicalSize, NewPhysicalSize)
src/dbus/blockdev/blockdev_3_3/mod.rs (2)

26-28: Good modular design for version-specific properties.

Separating new_physical_size_prop into a props module and publicly re-exporting it allows later versions (R4, R8, R9) to import and reuse this property without duplication.


30-65: LGTM: BlockdevR3 correctly establishes the pattern for NewPhysicalSize.

The struct and registration follow the established conventions, and this version appropriately introduces the NewPhysicalSize property that later versions inherit.

src/dbus/blockdev/blockdev_3_0/props.rs (1)

13-53: LGTM! Clean property accessor implementation.

The property accessor functions are well-structured and follow consistent patterns. The pool_prop function correctly retrieves the actual pool object path from the Manager, addressing previous review feedback. Error handling is appropriate throughout.

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

30-150: LGTM! BlockdevR0 interface is correctly implemented.

The D-Bus interface implementation is clean and follows the established pattern. Properties correctly delegate to the shared blockdev_prop helper and individual prop functions. The SetUserInfo method properly delegates to set_user_info_method.

src/dbus/blockdev/blockdev_3_7/mod.rs (1)

28-170: BlockdevR7 implementation follows established pattern.

The interface structure and property delegation are consistent with other BlockdevR* variants. The addition of NewPhysicalSize property correctly reuses the helper from blockdev_3_3.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

27-169: BlockdevR5 implementation is consistent.

The interface follows the established pattern and correctly integrates property helpers from blockdev_3_0 and blockdev_3_3.

src/dbus/blockdev/blockdev_3_2/mod.rs (1)

26-146: LGTM! BlockdevR2 implementation is correct.

The interface implementation is clean and consistent. The UserInfo property correctly specifies emits_changed_signal = "false", and the SetUserInfo method properly delegates to the shared method helper.

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

28-170: BlockdevR6 implementation follows the pattern.

The interface structure and property delegation are consistent with the established BlockdevR* pattern. The integration of shared property helpers is correct.

Comment on lines 85 to 101
#[zbus(property)]
#[allow(non_snake_case)]
async fn UserInfo(&self) -> Result<(bool, String), Error> {
blockdev_prop(&self.engine, self.parent_uuid, self.uuid, user_info_prop).await
}
Copy link

@coderabbitai coderabbitai bot Nov 25, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Align UserInfo property emission behavior across API versions.

The UserInfo property uses the default change signal emission (no explicit emits_changed_signal attribute), while R0 and R2 explicitly set emits_changed_signal = "false". Since UserInfo is mutable (though the setter is currently commented out), this inconsistency could lead to different D-Bus notification behavior across API versions.

Apply this diff to align with R0/R2:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn UserInfo(&self) -> Result<(bool, String), Error> {
📝 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
#[zbus(property)]
#[allow(non_snake_case)]
async fn UserInfo(&self) -> Result<(bool, String), Error> {
blockdev_prop(&self.engine, self.parent_uuid, self.uuid, user_info_prop).await
}
#[zbus(property(emits_changed_signal = "false"))]
#[allow(non_snake_case)]
async fn UserInfo(&self) -> Result<(bool, String), Error> {
blockdev_prop(&self.engine, self.parent_uuid, self.uuid, user_info_prop).await
}
🤖 Prompt for AI Agents
In src/dbus/blockdev/blockdev_3_7/mod.rs around lines 85 to 89, the UserInfo
property lacks the explicit emits_changed_signal attribute while R0 and R2 set
emits_changed_signal = "false"; update the zbus property attribute to include
emits_changed_signal = "false" (i.e., add #[zbus(property, emits_changed_signal
= "false")] above the UserInfo fn) so the property emission behavior matches
other API versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

The default is "true" not "false" as far as I understand.

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check UserInfo property definitions in blockdev R0, R2, and R7 to verify emission attributes

echo "=== Blockdev R0 (3_0) UserInfo property ==="
rg -A 3 "async fn UserInfo" src/dbus/blockdev/blockdev_3_0/

echo -e "\n=== Blockdev R2 (3_2) UserInfo property ==="
rg -A 3 "async fn UserInfo" src/dbus/blockdev/blockdev_3_2/

echo -e "\n=== Blockdev R7 (3_7) UserInfo property ==="
rg -A 3 "async fn UserInfo" src/dbus/blockdev/blockdev_3_7/

echo -e "\n=== Check all emits_changed_signal attributes in blockdev files ==="
rg "emits_changed_signal" src/dbus/blockdev/ -n

Length of output: 8114


#!/bin/bash
# Check context around the emits_changed_signal = "false" lines to see which properties they belong to

echo "=== R0 (blockdev_3_0) line 93 context ==="
sed -n '90,96p' src/dbus/blockdev/blockdev_3_0/mod.rs

echo -e "\n=== R0 (blockdev_3_0) line 119 context ==="
sed -n '116,122p' src/dbus/blockdev/blockdev_3_0/mod.rs

echo -e "\n=== R2 (blockdev_3_2) line 89 context ==="
sed -n '86,92p' src/dbus/blockdev/blockdev_3_2/mod.rs

echo -e "\n=== R2 (blockdev_3_2) line 115 context ==="
sed -n '112,118p' src/dbus/blockdev/blockdev_3_2/mod.rs

echo -e "\n=== R7 (blockdev_3_7) line 127 context ==="
sed -n '124,130p' src/dbus/blockdev/blockdev_3_7/mod.rs

echo -e "\n=== R7 (blockdev_3_7) UserInfo property with more context ==="
sed -n '84,89p' src/dbus/blockdev/blockdev_3_7/mod.rs

🧠 Learnings used
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

@mulkieran
Copy link
Member Author

I don't really think we should error rapidly if one interface fails during registration. We should try to register them all.

Copy link

@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: 0

♻️ Duplicate comments (1)
src/dbus/filesystem/mod.rs (1)

51-122: Early return on registration failure contradicts stated design intent.

Per the PR comment from @mulkieran: "I don't really think we should error rapidly if one interface fails during registration. We should try to register them all." The current implementation uses ? operators which fail fast on the first error.

Based on learnings, filesystem registration failures should log a warning and continue processing rather than failing the entire operation.

Consider collecting errors and logging warnings while attempting all registrations:

-    FilesystemR0::register(
+    if let Err(e) = FilesystemR0::register(
         engine.clone(),
         connection,
         manager,
         path.clone(),
         pool_uuid,
         uuid,
     )
-    .await?;
+    .await
+    {
+        warn!("Failed to register FilesystemR0 at {}: {}", path, e);
+    }
+    // ... similar pattern for R1-R9 ...
🧹 Nitpick comments (2)
src/dbus/filesystem/mod.rs (2)

46-49: Counter increment occurs before registration success is confirmed.

The counter is incremented via fetch_add before any registration is attempted. If all registrations fail, the counter value is still consumed, leading to gaps in ObjectPath numbering. This is a minor concern but worth noting if path uniqueness tracking matters.


129-150: Consider resilient unregistration to match registration pattern.

If registration adopts a "try all, log failures" pattern per the PR discussion, consider whether unregistration should follow the same approach. A failure to unregister one interface shouldn't necessarily prevent attempting to unregister others, as this could leave orphaned D-Bus objects.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 63b3b1d and 455fece.

📒 Files selected for processing (13)
  • src/dbus/filesystem/filesystem_3_0/methods.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_1/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_2/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_3/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_4/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_5/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_9/mod.rs (1 hunks)
  • src/dbus/filesystem/mod.rs (1 hunks)
  • src/dbus/filesystem/shared.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/dbus/filesystem/filesystem_3_0/props.rs
  • src/dbus/filesystem/filesystem_3_9/mod.rs
  • src/dbus/filesystem/filesystem_3_0/methods.rs
  • src/dbus/filesystem/filesystem_3_6/props.rs
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.526Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.
📚 Learning: 2025-12-01T22:14:23.526Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.526Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.

Applied to files:

  • src/dbus/filesystem/filesystem_3_6/mod.rs
  • src/dbus/filesystem/filesystem_3_4/mod.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/filesystem/filesystem_3_5/mod.rs
  • src/dbus/filesystem/filesystem_3_0/mod.rs
  • src/dbus/filesystem/filesystem_3_1/mod.rs
  • src/dbus/filesystem/mod.rs
  • src/dbus/filesystem/filesystem_3_3/mod.rs
  • src/dbus/filesystem/filesystem_3_2/mod.rs
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/filesystem/shared.rs
🧬 Code graph analysis (7)
src/dbus/filesystem/filesystem_3_6/mod.rs (7)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_0/mod.rs (11)
  • new (34-46)
  • register (48-60)
  • connection (66-68)
  • unregister (62-71)
  • SetName (81-83)
  • Created (87-89)
  • Devnode (93-95)
  • Pool (99-101)
  • Size (105-107)
  • Used (111-113)
  • Uuid (117-119)
src/dbus/filesystem/filesystem_3_1/mod.rs (11)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • unregister (65-74)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_2/mod.rs (11)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • unregister (65-74)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_3/mod.rs (11)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • unregister (65-74)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_4/mod.rs (11)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • unregister (65-74)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_5/mod.rs (11)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • unregister (65-74)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_4/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/shared.rs (2)
src/dbus/filesystem/filesystem_3_9/mod.rs (3)
  • Name (83-85)
  • Pool (89-91)
  • Uuid (95-97)
src/dbus/pool/pool_3_9/mod.rs (2)
  • Name (104-106)
  • Uuid (98-100)
src/dbus/filesystem/filesystem_3_0/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/mod.rs (8)
src/dbus/filesystem/filesystem_3_9/mod.rs (3)
  • connection (68-70)
  • register (50-62)
  • unregister (64-73)
src/dbus/filesystem/filesystem_3_0/mod.rs (2)
  • register (48-60)
  • unregister (62-71)
src/dbus/filesystem/filesystem_3_1/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_2/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_3/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_4/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_5/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_6/mod.rs (2)
  • register (54-66)
  • unregister (68-77)
src/dbus/filesystem/filesystem_3_3/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_2/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (32)
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile check-typos, 1.91.0, cargo)
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
🔇 Additional comments (15)
src/dbus/filesystem/shared.rs (2)

13-30: LGTM - Setter correctly returns zbus::Error.

The set_filesystem_prop helper correctly returns Result<(), zbus::Error> as required for D-Bus property setters, aligning with the PR comment that property setters must return zbus::Error instead of zbus::fdo::Error.


32-50: LGTM - Read-only property helper with proper error handling.

The filesystem_prop helper correctly returns Result<R, zbus::fdo::Error> for read-only property access, with appropriate error messages when pool or filesystem is not found.

src/dbus/filesystem/filesystem_3_5/mod.rs (2)

29-75: LGTM - FilesystemR5 struct and lifecycle methods.

The struct definition and register/unregister lifecycle methods follow the established pattern used across other filesystem versions (R0, R3, R6). The constructor is appropriately private while register/unregister are public.


77-123: LGTM - D-Bus interface implementation.

The interface implementation for org.storage.stratis3.filesystem.r5 correctly delegates to shared property helpers and the set_name_method. Property emission signals are appropriately configured for immutable vs mutable properties.

src/dbus/filesystem/filesystem_3_6/mod.rs (3)

32-78: LGTM - FilesystemR6 struct and lifecycle methods.

The struct definition and register/unregister lifecycle methods are consistent with the established patterns across filesystem versions.


121-132: LGTM - Property setter correctly returns zbus::Error.

The set_SizeLimit method correctly returns Result<(), zbus::Error> (not zbus::fdo::Error), which aligns with the PR comment requirement that property setters must return zbus::Error. This is properly wired through set_filesystem_prop which handles the error type correctly.


80-145: LGTM - D-Bus interface implementation for R6.

The interface implementation for org.storage.stratis3.filesystem.r6 correctly adds the SizeLimit property with both getter and setter, while maintaining consistency with the base properties from earlier versions.

src/dbus/filesystem/filesystem_3_0/mod.rs (3)

14-18: LGTM - Module structure and re-exports.

The module correctly declares and re-exports the methods and props submodules. The re-exported helpers (set_name_method, property accessors) enable code reuse across filesystem versions R1-R9.


26-72: LGTM - FilesystemR0 struct and lifecycle methods.

The struct definition and register/unregister lifecycle methods establish the baseline pattern that all subsequent filesystem versions (R1-R9) follow.


74-120: LGTM - Base D-Bus interface implementation.

The interface implementation for org.storage.stratis3.filesystem.r0 correctly implements the foundational filesystem properties with appropriate emission signals and error handling.

src/dbus/filesystem/filesystem_3_3/mod.rs (2)

77-123: AI summary is inconsistent with actual code.

The AI-generated summary claims FilesystemR3 includes properties like UserInfo, NewPhysicalSize, HardwareInfo, Tier, PhysicalPath, and TotalPhysicalSize, but the actual implementation only includes the base properties: SetName, Created, Devnode, Pool, Size, Used, and Uuid - identical to FilesystemR0.

The implementation itself is correct and follows the established pattern.


29-75: LGTM - FilesystemR3 struct and lifecycle methods.

The struct definition and register/unregister lifecycle methods are consistent with the established patterns across filesystem versions.

src/dbus/filesystem/filesystem_3_4/mod.rs (1)

29-123: LGTM! Implementation follows established patterns.

The FilesystemR4 struct and its D-Bus interface implementation correctly follow the patterns established in other filesystem versions (R0-R3). The interface name is correctly versioned, property annotations are appropriate, and the delegation to shared helpers (filesystem_prop, set_name_method, etc.) is consistent.

Note: The PR comment about property setters returning zbus::Error instead of zbus::fdo::Error does not apply here since this interface only defines property getters, not setters.

src/dbus/filesystem/filesystem_3_2/mod.rs (1)

29-123: LGTM! Implementation is consistent with other filesystem versions.

The FilesystemR2 implementation correctly mirrors the patterns in other filesystem versions. The interface is properly versioned as org.storage.stratis3.filesystem.r2, and the delegation to shared property/method helpers is consistent.

src/dbus/filesystem/filesystem_3_1/mod.rs (1)

29-123: LGTM! Implementation follows the established versioning pattern.

The FilesystemR1 implementation is consistent with the other filesystem versions (R0, R2, R4, etc.). The interface naming, property annotations, and helper delegations are all correctly applied.

Copy link

@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: 0

♻️ Duplicate comments (2)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)

7-11: Missing import for handle_action! macro.

The handle_action! macro is used at line 29, but it's not imported. This will cause a compilation error.

src/dbus/filesystem/mod.rs (1)

53-133: Registration still uses fail-fast error handling.

The current implementation uses ? operators which fail on the first registration error. Per the PR discussion and retrieved learnings, the registration process should attempt all interfaces and log warnings for failures rather than failing the entire operation.

The previous review comment already addressed this issue with a suggested fix pattern using if let Err(e) blocks with warning logs.

🧹 Nitpick comments (1)
src/dbus/filesystem/mod.rs (1)

140-162: Consider resilient error handling for unregistration as well.

The unregister_filesystem function also uses fail-fast ? operators. For cleanup operations, it may be preferable to attempt unregistering all interfaces even if one fails, to avoid leaving partial registrations. Consider applying a similar pattern as suggested for register_filesystem.

 pub async fn unregister_filesystem(
     connection: &Arc<Connection>,
     manager: &Lockable<Arc<RwLock<Manager>>>,
     path: &ObjectPath<'_>,
 ) -> StratisResult<FilesystemUuid> {
-    FilesystemR0::unregister(connection, path.clone()).await?;
-    FilesystemR1::unregister(connection, path.clone()).await?;
-    FilesystemR2::unregister(connection, path.clone()).await?;
-    FilesystemR3::unregister(connection, path.clone()).await?;
-    FilesystemR4::unregister(connection, path.clone()).await?;
-    FilesystemR5::unregister(connection, path.clone()).await?;
-    FilesystemR6::unregister(connection, path.clone()).await?;
-    FilesystemR7::unregister(connection, path.clone()).await?;
-    FilesystemR9::unregister(connection, path.clone()).await?;
+    if let Err(e) = FilesystemR0::unregister(connection, path.clone()).await {
+        warn!("Failed to unregister FilesystemR0 at {}: {}", path, e);
+    }
+    if let Err(e) = FilesystemR1::unregister(connection, path.clone()).await {
+        warn!("Failed to unregister FilesystemR1 at {}: {}", path, e);
+    }
+    // ... similar pattern for R2-R7, R9
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 455fece and 7eff06a.

📒 Files selected for processing (15)
  • src/dbus/filesystem/filesystem_3_0/methods.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_1/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_2/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_3/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_4/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_5/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_9/mod.rs (1 hunks)
  • src/dbus/filesystem/mod.rs (1 hunks)
  • src/dbus/filesystem/shared.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/dbus/filesystem/filesystem_3_5/mod.rs
  • src/dbus/filesystem/filesystem_3_9/mod.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-01T22:14:23.526Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.526Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.

Applied to files:

  • src/dbus/filesystem/filesystem_3_0/mod.rs
  • src/dbus/filesystem/filesystem_3_3/mod.rs
  • src/dbus/filesystem/filesystem_3_2/mod.rs
  • src/dbus/filesystem/filesystem_3_6/props.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/filesystem/mod.rs
  • src/dbus/filesystem/filesystem_3_1/mod.rs
  • src/dbus/filesystem/filesystem_3_4/mod.rs
  • src/dbus/filesystem/filesystem_3_7/props.rs
  • src/dbus/filesystem/filesystem_3_6/mod.rs
  • src/dbus/filesystem/filesystem_3_7/mod.rs
  • src/dbus/filesystem/filesystem_3_0/methods.rs
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/filesystem/shared.rs
🧬 Code graph analysis (7)
src/dbus/filesystem/filesystem_3_0/mod.rs (2)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_2/mod.rs (2)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/shared.rs (1)
src/dbus/filesystem/filesystem_3_9/mod.rs (3)
  • Name (83-85)
  • Pool (89-91)
  • Uuid (95-97)
src/dbus/filesystem/mod.rs (9)
src/dbus/filesystem/filesystem_3_9/mod.rs (3)
  • connection (68-70)
  • register (50-62)
  • unregister (64-73)
src/dbus/filesystem/filesystem_3_0/mod.rs (2)
  • register (48-60)
  • unregister (62-71)
src/dbus/filesystem/filesystem_3_1/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_2/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_3/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_4/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_5/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_6/mod.rs (2)
  • register (54-66)
  • unregister (68-77)
src/dbus/filesystem/filesystem_3_7/mod.rs (2)
  • register (56-68)
  • unregister (70-79)
src/dbus/filesystem/filesystem_3_7/props.rs (2)
src/dbus/filesystem/filesystem_3_9/mod.rs (2)
  • Name (83-85)
  • Pool (89-91)
src/dbus/filesystem/filesystem_3_7/mod.rs (1)
  • Pool (138-140)
src/dbus/filesystem/filesystem_3_6/mod.rs (2)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-42)
  • size_limit_prop (14-19)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_7/mod.rs (11)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-42)
  • size_limit_prop (14-19)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_0/mod.rs (10)
  • new (34-46)
  • register (48-60)
  • connection (66-68)
  • SetName (81-83)
  • Created (87-89)
  • Devnode (93-95)
  • Pool (99-101)
  • Size (105-107)
  • Used (111-113)
  • Uuid (117-119)
src/dbus/filesystem/filesystem_3_1/mod.rs (10)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_2/mod.rs (10)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_3/mod.rs (10)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_4/mod.rs (10)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_5/mod.rs (10)
  • new (37-49)
  • register (51-63)
  • connection (69-71)
  • SetName (84-86)
  • Created (90-92)
  • Devnode (96-98)
  • Pool (102-104)
  • Size (108-110)
  • Used (114-116)
  • Uuid (120-122)
src/dbus/filesystem/filesystem_3_9/mod.rs (5)
  • new (36-48)
  • register (50-62)
  • connection (68-70)
  • Pool (89-91)
  • Uuid (95-97)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (38)
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks-with-ci-repo
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: pylint
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: python-based-tests
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: stratis-cli-checks
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
🔇 Additional comments (16)
src/dbus/filesystem/filesystem_3_4/mod.rs (1)

1-123: LGTM!

The FilesystemR4 implementation follows the established pattern used by other filesystem revisions. The struct, registration/unregistration methods, and D-Bus interface properties are correctly implemented with appropriate emission semantics (const for immutable properties like Created, Pool, Uuid; invalidates for Devnode).

src/dbus/filesystem/filesystem_3_0/methods.rs (1)

13-50: LGTM!

The set_name_method function correctly handles all RenameAction variants and provides appropriate D-Bus response tuples. The error handling for missing pools and unknown filesystems is comprehensive.

src/dbus/filesystem/filesystem_3_6/props.rs (1)

1-42: LGTM!

The property helpers correctly implement the size limit getter and setter. The setter appropriately returns zbus::Error (per PR guidelines), and the error handling for parsing and pool operations is comprehensive.

src/dbus/filesystem/filesystem_3_7/props.rs (1)

1-41: LGTM!

The property helpers for origin and merge scheduling follow the established patterns. The setter correctly uses zbus::Error and handles both PropChangeAction::NewValue and PropChangeAction::Identity cases appropriately.

src/dbus/filesystem/filesystem_3_6/mod.rs (1)

1-145: LGTM!

The FilesystemR6 implementation correctly follows the established pattern. Notable that the property setter set_SizeLimit returns zbus::Error (line 123) while getters return zbus::fdo::Error, which aligns with the PR maintainer's guidance that property setters must return zbus::Error.

src/dbus/filesystem/filesystem_3_0/mod.rs (1)

1-120: Well-structured D-Bus interface implementation.

The FilesystemR0 struct and its D-Bus interface are implemented correctly. The property emission signals are appropriately configured (const for immutable properties like Created, Pool, and Uuid; invalidates for Devnode). The delegation to shared helper functions (filesystem_prop, pool_prop, set_name_method) promotes code reuse across revisions.

src/dbus/filesystem/shared.rs (2)

13-30: Correct error type for property setter.

The set_filesystem_prop function correctly returns Result<(), zbus::Error> rather than zbus::fdo::Error, aligning with the PR requirement that property setters must return zbus::Error. The callback signature also correctly uses zbus::Error.


32-49: Clean property getter helper.

The filesystem_prop function correctly uses zbus::fdo::Error for property getters (standard for D-Bus property access). The error messages are descriptive, and the callback pattern allows flexible property value extraction.

src/dbus/filesystem/filesystem_3_2/mod.rs (1)

1-123: Consistent implementation following R0 pattern.

FilesystemR2 follows the established pattern from FilesystemR0, reusing the shared property helpers from filesystem_3_0. The interface versioning (r2) is correctly applied. The code structure enables future revision-specific extensions while maintaining consistency.

src/dbus/filesystem/filesystem_3_7/mod.rs (3)

117-128: Correct error type for MergeScheduled setter.

The set_MergeScheduled property setter correctly returns Result<(), zbus::Error> as required by the PR specification, properly delegating to set_filesystem_prop which maintains the same error type.


154-165: Correct error type for SizeLimit setter.

The set_SizeLimit property setter also correctly returns Result<(), zbus::Error>, maintaining consistency with the error type requirements for property setters.


1-178: Well-implemented R7 revision with extended properties.

FilesystemR7 properly extends the base filesystem interface with MergeScheduled, Origin, and SizeLimit properties. The implementation correctly reuses shared helpers from filesystem_3_0 and filesystem_3_6, and the new props are appropriately re-exported for use by other modules.

src/dbus/filesystem/filesystem_3_1/mod.rs (1)

8-13: Verify the correct Error type for property returns.

Line 9 imports Error from zbus::fdo, which is then used in property return types throughout this file (lines 90, 96, 102, 108, 114). The PR comment states property setters should return zbus::Error instead of zbus::fdo::Error. Confirm whether this applies to property getters in this file and whether the import should be changed to zbus::Error for consistency with the D-Bus interface requirements.

src/dbus/filesystem/filesystem_3_3/mod.rs (3)

29-75: FilesystemR3 state and register/unregister helpers look correct and align with existing patterns

The struct layout, new constructor, and the async register/unregister helpers cleanly encapsulate the engine/manager/UUID context and simply propagate zbus errors via StratisResult<()>, which is what callers need to implement best-effort multi-interface registration (log and continue on individual failures). This matches the existing filesystem registration approach described for pool methods.

Based on learnings, this aligns with the intended best-effort registration behavior.


82-86: SetName delegation through shared helper is straightforward and consistent

SetName just forwards to set_name_method with the engine, parent UUID, filesystem UUID, and name, preserving the existing Stratis method contract ((bool, FilesystemUuid), u16, String) without introducing new error paths. The zbus attributes and out-arg names are also consistent with other D-Bus methods.


88-122: Property accessors correctly use shared helpers and appropriate D‑Bus metadata

The Created/Devnode/Size/Used/Pool/Uuid properties all delegate to shared helpers (filesystem_prop, pool_prop), return Result<_, zbus::fdo::Error> where needed, and use sensible emits_changed_signal annotations (const for immutable values, invalidates for Devnode, default for changing size/usage). This keeps the filesystem r3 surface aligned with earlier versions while centralizing logic in the shared helpers.

Copy link

@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: 0

♻️ Duplicate comments (2)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)

7-11: Missing import for handle_action! macro.

The handle_action! macro is used at line 29, but it's not imported. This will cause a compilation error.

src/dbus/filesystem/mod.rs (1)

55-144: Early return on registration failure contradicts stated design intent.

Per the PR comment from @mulkieran, registration should attempt all interfaces rather than failing fast. The current ? operators will abort on the first failure.

Based on learnings, filesystem registration failures should log a warning and continue processing.

🧹 Nitpick comments (2)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)

13-50: Implementation looks correct with proper error handling.

The function correctly handles all RenameAction outcomes and maps them to appropriate D-Bus return values. The FIXME at line 36 acknowledges the missing signal emission—consider tracking this as a follow-up task.

Would you like me to open an issue to track the signal emission TODO?

src/dbus/filesystem/filesystem_3_4/mod.rs (1)

29-75: Consider deduplicating the R2/R3/R4 filesystem interface boilerplate

FilesystemR2, FilesystemR3, and FilesystemR4 have identical struct fields, new, register/unregister, and property implementations, differing only in type/interface names. A small macro or generic helper could reduce duplication and the chance of future drift, especially if more revisions are added.

Also applies to: 77-123

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7eff06a and a54bfc5.

📒 Files selected for processing (16)
  • src/dbus/filesystem/filesystem_3_0/methods.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_1/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_2/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_3/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_4/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_5/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_8/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_9/mod.rs (1 hunks)
  • src/dbus/filesystem/mod.rs (1 hunks)
  • src/dbus/filesystem/shared.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/dbus/filesystem/filesystem_3_6/props.rs
  • src/dbus/filesystem/filesystem_3_7/props.rs
  • src/dbus/filesystem/filesystem_3_7/mod.rs
  • src/dbus/filesystem/filesystem_3_1/mod.rs
  • src/dbus/filesystem/filesystem_3_6/mod.rs
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-01T22:14:23.526Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.526Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.

Applied to files:

  • src/dbus/filesystem/filesystem_3_5/mod.rs
  • src/dbus/filesystem/filesystem_3_0/mod.rs
  • src/dbus/filesystem/filesystem_3_3/mod.rs
  • src/dbus/filesystem/filesystem_3_2/mod.rs
  • src/dbus/filesystem/filesystem_3_4/mod.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/filesystem/mod.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
  • src/dbus/filesystem/filesystem_3_9/mod.rs
  • src/dbus/filesystem/filesystem_3_0/methods.rs
  • src/dbus/filesystem/filesystem_3_8/mod.rs
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/filesystem/shared.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
🧬 Code graph analysis (8)
src/dbus/filesystem/filesystem_3_5/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_0/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_2/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_0/mod.rs (10)
  • new (34-46)
  • register (48-60)
  • unregister (62-71)
  • SetName (81-83)
  • Created (87-89)
  • Devnode (93-95)
  • Pool (99-101)
  • Size (105-107)
  • Used (111-113)
  • Uuid (117-119)
src/dbus/filesystem/filesystem_3_4/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/mod.rs (11)
src/dbus/filesystem/filesystem_3_9/mod.rs (3)
  • connection (71-73)
  • register (53-65)
  • unregister (67-76)
src/dbus/util.rs (14)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
src/dbus/filesystem/filesystem_3_0/mod.rs (2)
  • register (48-60)
  • unregister (62-71)
src/dbus/filesystem/filesystem_3_1/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_2/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_3/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_4/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_5/mod.rs (2)
  • register (51-63)
  • unregister (65-74)
src/dbus/filesystem/filesystem_3_6/mod.rs (2)
  • register (54-66)
  • unregister (68-77)
src/dbus/filesystem/filesystem_3_7/mod.rs (2)
  • register (56-68)
  • unregister (70-79)
src/dbus/filesystem/filesystem_3_8/mod.rs (2)
  • register (53-65)
  • unregister (67-76)
src/dbus/filesystem/filesystem_3_0/props.rs (2)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/filesystem/filesystem_3_0/mod.rs (1)
  • new (34-46)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
src/dbus/filesystem/filesystem_3_0/mod.rs (1)
  • Uuid (117-119)
src/dbus/filesystem/filesystem_3_8/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (5)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-42)
  • size_limit_prop (14-19)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_7/mod.rs (2)
  • Pool (138-140)
  • Uuid (175-177)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: python-based-tests
🔇 Additional comments (14)
src/dbus/filesystem/filesystem_3_5/mod.rs (2)

29-75: Struct and lifecycle methods are well-structured.

The FilesystemR5 struct and its register/unregister methods follow the established pattern used across other filesystem revisions, ensuring consistency.


77-123: D-Bus interface implementation is consistent with the established pattern.

The property accessors correctly delegate to shared helpers, and the SetName method properly uses the shared set_name_method. Property emission signals are appropriately configured.

src/dbus/filesystem/mod.rs (2)

151-174: Verify if unregister should also continue on failure.

The unregister_filesystem function uses ? operators similar to register_filesystem. If the design intent (attempt all operations rather than failing fast) applies here as well, consider logging warnings and continuing through all unregistrations to ensure cleanup is as complete as possible.


50-54: Path generation is thread-safe.

Using Ordering::AcqRel with fetch_add ensures the counter increment is properly synchronized across concurrent registrations.

src/dbus/filesystem/filesystem_3_0/mod.rs (2)

26-72: Struct and lifecycle methods follow the established pattern.

The FilesystemR0 struct and its register/unregister methods are consistent with other filesystem revisions, enabling proper D-Bus object lifecycle management.


74-120: D-Bus interface implementation is correct and consistent.

Properties and methods correctly delegate to shared helpers. The SetName method returns the standard tuple format for D-Bus method results.

src/dbus/filesystem/shared.rs (2)

13-30: Setter returns correct error type per PR requirements.

The set_filesystem_prop function correctly returns Result<(), zbus::Error> rather than zbus::fdo::Error, which aligns with the PR comment requiring property setters to return zbus::Error.


32-50: Helper function is well-designed with proper error handling.

The filesystem_prop function provides a clean abstraction for property access, handling missing pool/filesystem cases with descriptive error messages and delegating value extraction to the callback.

src/dbus/filesystem/filesystem_3_3/mod.rs (1)

29-75: FilesystemR3 D‑Bus surface mirrors existing pattern and looks correct

Struct layout, register/unregister, and the r3 interface all align with the shared helpers (filesystem_prop, pool_prop, set_name_method) and other revisions. Getters cleanly return Result<_, Error> without panics, and the lifecycle methods simply wrap object_server().at/remove, which is appropriate at this level.

Also applies to: 77-123

src/dbus/filesystem/filesystem_3_0/props.rs (1)

15-53: Filesystem property helpers are well‑behaved and non‑panicking

The props in this module now compute values directly (devnode_prop via path_to_mount_filesystem) and convert missing pool paths into Error::Failed rather than panicking. This is appropriate for D‑Bus property access and matches how these helpers are consumed by the R* filesystem interfaces.

src/dbus/filesystem/filesystem_3_9/mod.rs (2)

31-77: FilesystemR9 D‑Bus interface wiring looks consistent and correct

The R9 struct, lifecycle methods, and interface (including MergeScheduled/Origin/SizeLimit/Used) follow the same pattern as earlier revisions, delegating cleanly to filesystem_prop, set_filesystem_prop, and pool_prop. Property getters return Result<_, Error> as expected, and Uuid is exposed read‑only.

Also applies to: 79-113, 127-175


114-125: and

src/dbus/filesystem/filesystem_3_2/mod.rs (1)

29-75: FilesystemR2 implementation is sound; multi‑interface registration semantics belong at the caller

The R2 struct, register/unregister, and interface implementation match the shared pattern and correctly use the common helpers. These functions intentionally wrap a single object_server().at/remove call; the “don’t fail fast if one interface registration fails” behavior should be implemented in the code that invokes register for multiple revisions, not inside this per‑revision helper.

Also applies to: 77-123

src/dbus/filesystem/filesystem_3_8/mod.rs (1)

31-77: FilesystemR8 D‑Bus implementation is consistent with other revisions

The R8 struct, registration helpers, and interface (including MergeScheduled/SizeLimit setters and related getters) cleanly reuse filesystem_prop, set_filesystem_prop, and pool_prop, with setters returning Result<(), zbus::Error>. This stays consistent with the R9 pattern and the shared helper contracts.

Also applies to: 79-175

Copy link

@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: 0

♻️ Duplicate comments (2)
src/dbus/filesystem/mod.rs (1)

55-144: Registration still fails fast, contradicting stated design intent.

The current implementation continues to use the ? operator for each interface registration (R0 through R9), which causes the entire registration to abort if any single interface fails. This contradicts the PR comment from @mulkieran stating: "should not error rapidly if one interface fails during registration."

Per the existing review suggestion, consider collecting errors and logging warnings while attempting all registrations to ensure maximum D-Bus surface availability even if some interfaces fail.

src/dbus/filesystem/filesystem_3_8/mod.rs (1)

115-126: Verify return type compatibility for property setters.

Similar to FilesystemR7, these setters (set_MergeScheduled and set_SizeLimit) call prop functions that may return Result<(), zbus::fdo::Error> instead of the required Result<(), zbus::Error>. Ensure that set_merge_scheduled_prop (imported from filesystem_3_7) and set_size_limit_prop (from filesystem_3_6) have been updated to return zbus::Error per the PR objectives.

Also applies to: 158-169

🧹 Nitpick comments (1)
src/dbus/filesystem/mod.rs (1)

156-165: Consider non-failing unregistration pattern for consistency.

Similar to the registration flow, unregister_filesystem uses fail-fast error propagation. For consistency and to ensure maximum cleanup even if individual interface unregistrations fail, consider logging warnings and continuing through all interfaces.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a54bfc5 and 8bb0a20.

📒 Files selected for processing (16)
  • src/dbus/filesystem/filesystem_3_0/methods.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_1/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_2/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_3/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_4/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_5/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_8/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_9/mod.rs (1 hunks)
  • src/dbus/filesystem/mod.rs (1 hunks)
  • src/dbus/filesystem/shared.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/dbus/filesystem/filesystem_3_6/mod.rs
  • src/dbus/filesystem/filesystem_3_7/props.rs
  • src/dbus/filesystem/filesystem_3_3/mod.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
  • src/dbus/filesystem/filesystem_3_1/mod.rs
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-01T22:14:23.526Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.526Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.

Applied to files:

  • src/dbus/filesystem/filesystem_3_9/mod.rs
  • src/dbus/filesystem/filesystem_3_6/props.rs
  • src/dbus/filesystem/filesystem_3_0/mod.rs
  • src/dbus/filesystem/filesystem_3_5/mod.rs
  • src/dbus/filesystem/filesystem_3_2/mod.rs
  • src/dbus/filesystem/mod.rs
  • src/dbus/filesystem/filesystem_3_0/methods.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/filesystem/filesystem_3_7/mod.rs
  • src/dbus/filesystem/filesystem_3_4/mod.rs
  • src/dbus/filesystem/filesystem_3_8/mod.rs
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/filesystem/filesystem_3_6/props.rs
  • src/dbus/filesystem/shared.rs
🧬 Code graph analysis (9)
src/dbus/filesystem/filesystem_3_9/mod.rs (5)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-42)
  • size_limit_prop (14-19)
src/dbus/filesystem/filesystem_3_7/props.rs (3)
  • merge_scheduled_prop (23-25)
  • origin_prop (14-21)
  • set_merge_scheduled_prop (27-41)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_0/mod.rs (2)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_5/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_2/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_0/mod.rs (8)
  • Name (99-101)
  • SetName (81-83)
  • Created (87-89)
  • Devnode (93-95)
  • Pool (105-107)
  • Size (111-113)
  • Used (117-119)
  • Uuid (123-125)
src/dbus/filesystem/mod.rs (10)
src/dbus/filesystem/filesystem_3_9/mod.rs (3)
  • connection (72-74)
  • register (54-66)
  • unregister (68-77)
src/dbus/filesystem/filesystem_3_0/mod.rs (2)
  • register (48-60)
  • unregister (62-71)
src/dbus/filesystem/filesystem_3_1/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_2/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_3/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_4/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_5/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_6/mod.rs (2)
  • register (55-67)
  • unregister (69-78)
src/dbus/filesystem/filesystem_3_7/mod.rs (2)
  • register (57-69)
  • unregister (71-80)
src/dbus/filesystem/filesystem_3_8/mod.rs (2)
  • register (54-66)
  • unregister (68-77)
src/dbus/filesystem/filesystem_3_0/methods.rs (12)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/filesystem/filesystem_3_0/mod.rs (1)
  • Uuid (123-125)
src/dbus/filesystem/filesystem_3_1/mod.rs (1)
  • Uuid (127-129)
src/dbus/filesystem/filesystem_3_2/mod.rs (1)
  • Uuid (127-129)
src/dbus/filesystem/filesystem_3_3/mod.rs (1)
  • Uuid (126-128)
src/dbus/filesystem/filesystem_3_4/mod.rs (1)
  • Uuid (127-129)
src/dbus/filesystem/filesystem_3_5/mod.rs (1)
  • Uuid (127-129)
src/dbus/filesystem/filesystem_3_6/mod.rs (1)
  • Uuid (149-151)
src/dbus/filesystem/filesystem_3_7/mod.rs (1)
  • Uuid (182-184)
src/dbus/filesystem/filesystem_3_8/mod.rs (1)
  • Uuid (179-181)
src/dbus/filesystem/filesystem_3_9/mod.rs (1)
  • Uuid (179-181)
src/engine/strat_engine/thinpool/filesystem.rs (1)
  • format (156-162)
src/dbus/filesystem/shared.rs (11)
src/dbus/filesystem/filesystem_3_0/mod.rs (1)
  • Name (99-101)
src/dbus/filesystem/filesystem_3_1/mod.rs (1)
  • Name (103-105)
src/dbus/filesystem/filesystem_3_2/mod.rs (1)
  • Name (103-105)
src/dbus/filesystem/filesystem_3_3/mod.rs (1)
  • Name (103-105)
src/dbus/filesystem/filesystem_3_4/mod.rs (1)
  • Name (103-105)
src/dbus/filesystem/filesystem_3_5/mod.rs (1)
  • Name (103-105)
src/dbus/filesystem/filesystem_3_6/mod.rs (1)
  • Name (106-108)
src/dbus/filesystem/filesystem_3_7/mod.rs (1)
  • Name (133-135)
src/dbus/filesystem/filesystem_3_8/mod.rs (1)
  • Name (130-132)
src/dbus/filesystem/filesystem_3_9/mod.rs (1)
  • Name (130-132)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/filesystem/filesystem_3_7/mod.rs (5)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-42)
  • size_limit_prop (14-19)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_0/mod.rs (9)
  • Name (99-101)
  • new (34-46)
  • SetName (81-83)
  • Created (87-89)
  • Devnode (93-95)
  • Pool (105-107)
  • Size (111-113)
  • Used (117-119)
  • Uuid (123-125)
src/dbus/filesystem/filesystem_3_7/props.rs (2)
  • merge_scheduled_prop (23-25)
  • origin_prop (14-21)
src/dbus/filesystem/filesystem_3_8/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-42)
  • size_limit_prop (14-19)
src/dbus/filesystem/filesystem_3_7/props.rs (3)
  • merge_scheduled_prop (23-25)
  • origin_prop (14-21)
  • set_merge_scheduled_prop (27-41)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: python-based-tests
🔇 Additional comments (12)
src/dbus/filesystem/filesystem_3_6/props.rs (2)

14-19: Filesystem size_limit getter matches existing D‑Bus prop pattern

The getter follows the established (bool, String) pattern via option_to_tuple, and the mapping from Option<Bytes> to decimal string looks consistent with other props. No issues from a correctness or API-shape standpoint.


21-41: Verify Bytes type definition and set_fs_size_limit signature before proceeding

The implementation correctly returns Result<(), zbus::Error> and uses Error::Failure(...) for error cases. However, verification needed:

  • Confirm devicemapper::Bytes inner type compatibility with the u128 parse operation
  • Verify set_fs_size_limit parameter type expectations match what's being passed
  • The optional refactor using Option::map(...).transpose() is stylistic; current match pattern is acceptable
  • Ensure D-Bus signals are implemented elsewhere before resolving the FIXME comment
src/dbus/filesystem/filesystem_3_5/mod.rs (1)

30-130: LGTM! FilesystemR5 implementation follows established pattern.

The implementation is consistent with other filesystem revision modules (R0, R1, R2, etc.), properly wiring the D-Bus interface with standard property helpers and lifecycle management.

src/dbus/filesystem/filesystem_3_0/mod.rs (1)

26-126: LGTM! FilesystemR0 establishes solid foundation pattern.

The implementation correctly establishes the baseline D-Bus filesystem interface pattern that other revisions (R1-R9) follow, with proper lifecycle management and property delegation to shared helpers.

src/dbus/filesystem/shared.rs (1)

13-50: LGTM! Error types correctly match zbus property conventions.

The implementation correctly uses zbus::Error for the property setter (set_filesystem_prop) and zbus::fdo::Error for the property getter (filesystem_prop), aligning with the PR requirement that "property setter must return zbus::Error instead of zbus::fdo::Error."

src/dbus/filesystem/filesystem_3_4/mod.rs (1)

30-130: LGTM! FilesystemR4 implementation is consistent.

The implementation correctly follows the established pattern for filesystem revision interfaces with proper structure and delegation to shared helpers.

src/dbus/filesystem/filesystem_3_9/mod.rs (1)

32-182: LGTM! FilesystemR9 provides the most complete D-Bus interface.

The implementation correctly extends the base pattern with additional properties for snapshot management (Origin, MergeScheduled) and size control (SizeLimit), properly delegating to helpers from earlier revisions and using the correct error types for property setters.

src/dbus/filesystem/filesystem_3_2/mod.rs (1)

30-130: LGTM! FilesystemR2 implementation is consistent.

The implementation correctly follows the established pattern for filesystem revision interfaces with proper structure and delegation to shared helpers.

src/dbus/filesystem/filesystem_3_7/mod.rs (3)

57-69: LGTM: Registration implementation is clean.

The async registration pattern correctly instantiates the interface and attaches it to the D-Bus object server. Error propagation using ? is appropriate here for individual interface registration.


161-172: Verify return type compatibility for set_SizeLimit.

Similar to set_MergeScheduled, this setter calls set_size_limit_prop which may return Result<(), zbus::fdo::Error> instead of the required Result<(), zbus::Error>. Ensure set_size_limit_prop has been updated to return zbus::Error per the PR objectives.


118-129: Unable to verify this review comment due to repository access limitations. However, based on zbus library documentation, the stated requirement appears potentially incorrect: D-Bus property setters should return Result<(), zbus::fdo::Error> (the Freedesktop D-Bus method error enum), not zbus::Error (which is for transport/encoding-level failures). The review comment claims property setters "must return zbus::Error instead of zbus::fdo::Error," but zbus documentation indicates the opposite — D-Bus method and property error replies should use zbus::fdo::Error which implements the DBusError trait for D-Bus error handling. Verify the PR objectives and actual function implementations in the props module to clarify the correct error type.

src/dbus/filesystem/filesystem_3_8/mod.rs (1)

32-78: LGTM: Clean implementation following established patterns.

FilesystemR8 correctly reuses property helpers from filesystem_3_7 and follows the same registration lifecycle as other filesystem revisions. The structure is consistent and maintainable.

Copy link

@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: 6

♻️ Duplicate comments (7)
src/dbus/pool/pool_3_0/methods.rs (1)

132-167: Clarify destroy semantics: engine vs DBus UUIDs and unregister failures

Two things to straighten out in destroy_filesystems_method:

  1. Collected uuids vector is unused in the return value

    After a successful engine destroy you build a local uuids: Vec<FilesystemUuid> from unregister_filesystem, but then return v from the engine result instead:

    let mut uuids = Vec::new();
    match changed.changed() {
        Some((v, _)) => {
            for op in filesystems.iter() {
                match unregister_filesystem(connection, manager, op).await {
                    Ok(uuid) => {
                        uuids.push(uuid);
                    }
                    // ...
                }
            }
            ((true, v), DbusErrorEnum::OK as u16, OK_STRING.to_string())
        }
        // ...
    }

    Either the intention is to return the UUIDs that were actually unregistered (uuids), or v from the engine result is authoritative and the local vector can be dropped. As written, the extra collection is dead weight and obscures the true semantics. This was already raised on a previous commit; it’s still unresolved here.

  2. Unregister failures short-circuit the entire operation

    Any unregister_filesystem error immediately returns a DBus error and stops processing remaining filesystems. That conflicts with the documented behavior for similar pool methods (3_6) where DBus registration/unregistration failures after a successful engine change are logged and the method still returns success. Based on learnings, the expectation is:

    • Engine destroy succeeds → operation should generally be reported as success.
    • Individual DBus unregister failures should be logged and not abort the whole call.

Concrete direction:

  • Decide whether the return payload should be v or uuids and delete the other path accordingly.
  • Replace the early return on unregister error with a warn!(...) and continue, mirroring the create‑path semantics.
src/dbus/blockdev/blockdev_3_0/methods.rs (1)

7-11: Missing import for handle_action! macro.

The handle_action! macro is used at line 29, but it's not imported. This will cause a compilation error.

Apply this diff to add the missing import:

 use crate::{
     dbus::{consts::OK_STRING, types::DbusErrorEnum, util::tuple_to_option},
     engine::{DevUuid, Engine, PoolIdentifier, PoolUuid, RenameAction},
+    handle_action,
     stratis::StratisError,
 };
src/dbus/filesystem/mod.rs (1)

58-147: Registration still fails fast, contradicting PR design intent.

Per the PR comment: "I don't really think we should error rapidly if one interface fails during registration. We should try to register them all." The current implementation continues to use ? operators which abort on the first error, preventing subsequent interface registrations.

Based on learnings, filesystem registration failures should log a warning and continue processing rather than failing the entire operation. Additionally, see src/dbus/manager/mod.rs lines 190-233 for the correct resilient pattern using if let Err(e) with warn!.

src/dbus/manager/manager_3_8/methods.rs (1)

194-237: Guard held across await points and filesystem registration still fails fast.

Same issues as flagged in the past review:

  1. The guard from line 195 is held across multiple .await calls (lines 212-223, 226-232). Extract needed data and drop the guard before awaiting.

  2. Filesystem registration failure (lines 217-221) returns an error and aborts. Per codebase patterns and learnings, this should log a warning and continue processing remaining filesystems.

Refer to src/dbus/pool/mod.rs lines 26-85 for the correct pattern where filesystem registration errors are logged with warn! while continuing to process remaining items.

Based on learnings, similar D-Bus methods should continue processing when individual registrations fail.

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

102-119: Align UserInfo property’s emits_changed_signal with other versions

set_UserInfo correctly returns Result<(), zbus::Error>, but the UserInfo property itself still uses the default #[zbus(property)], which implies emits_changed_signal = "true". BlockdevR2 (and related versions) explicitly set this to "false".

For consistency across blockdev interface versions, consider:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn UserInfo(&self) -> Result<(bool, String), Error> {
src/dbus/blockdev/blockdev_3_6/mod.rs (1)

100-117: Make UserInfo’s emits_changed_signal explicit to match other blockdev versions

In BlockdevR6, set_UserInfo is correctly typed as Result<(), zbus::Error>, but the UserInfo property itself omits emits_changed_signal, so it defaults to "true". R0/R2 set this to "false".

To keep behavior consistent across versions:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn UserInfo(&self) -> Result<(bool, String), Error> {
src/dbus/manager/manager_3_0/methods.rs (1)

167-205: Still holding manager write lock across destroy_pool/unregister_pool awaits (possible deadlock)

destroy_pool_method keeps manager_lock in scope while:

  • Awaiting engine.destroy_pool(uuid), and
  • Calling unregister_pool(connection, manager, &pool).await.

If either of those needs to acquire the same manager lock (very likely for unregister_pool), the future can deadlock, which matches the earlier review concern. Please drop/scope the write guard immediately after extracting the UUID.

For example:

-    let manager_lock = manager.write().await;
-    let uuid = match manager_lock.pool_get_uuid(&pool) {
-        Some(u) => u,
-        None => {
-            return (
-                default_return,
-                DbusErrorEnum::ERROR as u16,
-                format!("Object path {pool} not associated with pool"),
-            );
-        }
-    };
+    let uuid = {
+        let manager_lock = manager.write().await;
+        match manager_lock.pool_get_uuid(&pool) {
+            Some(u) => u,
+            None => {
+                return (
+                    default_return,
+                    DbusErrorEnum::ERROR as u16,
+                    format!("Object path {pool} not associated with pool"),
+                );
+            }
+        }
+    };
🧹 Nitpick comments (7)
src/dbus/pool/pool_3_0/methods.rs (1)

289-302: Minor: consider using the returned uuid for clarity in set_name_method

In the RenameAction::Renamed(uuid) arm you ignore the uuid value except in the warning message and always return pool_uuid:

Ok(RenameAction::Renamed(uuid)) => {
    match manager.read().await.pool_get_path(&pool_uuid) { /* ... */ }
    (
        (true, pool_uuid),
        DbusErrorEnum::OK as u16,
        OK_STRING.to_string(),
    )
}

If RenameAction::Renamed ever carried a different identifier in the future, this would be confusing. Even if UUIDs are guaranteed to be stable across renames today, using the uuid from the action consistently (both in the lookup and the return tuple) would make intent clearer:

-        Ok(RenameAction::Renamed(uuid)) => {
-            match manager.read().await.pool_get_path(&pool_uuid) {
+        Ok(RenameAction::Renamed(uuid)) => {
+            match manager.read().await.pool_get_path(&uuid) {
                 // ...
             };
             (
-                (true, pool_uuid),
+                (true, uuid),
                 DbusErrorEnum::OK as u16,
                 OK_STRING.to_string(),
             )
         }

Not critical, but it tightens up the API and avoids potential confusion between pool_uuid and uuid.

src/dbus/manager/manager_3_9/methods.rs (1)

86-129: Drop the pool guard before async DBus registration to avoid holding locks across .await

In StartAction::Started you obtain a pool guard and then keep it alive across all the async registration work and signal emission:

let guard = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await { /* ... */ };

let mut fs_paths = Vec::default();
for fs_uuid in guard
    .filesystems()
    .into_iter()
    .map(|(_, fs_uuid, _)| fs_uuid)
    .collect::<Vec<_>>()
{
    let fs_path = register_filesystem(..., fs_uuid).await?;
    fs_paths.push(fs_path);
}

let (pool_path, dev_paths) = register_pool(...).await?;
if guard.is_encrypted() {
    send_locked_pools_signals(connection).await;
}
send_stopped_pools_signals(connection).await;

You only need data derived from the guard (filesystems() and is_encrypted()), not the guard itself, during the async registration. Holding it across .await points:

  • Extends the lifetime of whatever internal lock get_pool uses, and
  • Increases the chance of contention or deadlocks if registration helpers ever need their own engine locks.

Safer pattern:

  1. Extract the filesystem UUIDs and is_encrypted into local values.
  2. Drop the guard (e.g., by limiting its scope or calling drop(guard)).
  3. Perform DBus registration and signal emission using only those values.

For example:

let guard = /* get_pool */;
let fs_uuids: Vec<_> = guard
    .filesystems()
    .into_iter()
    .map(|(_, fs_uuid, _)| fs_uuid)
    .collect();
let encrypted = guard.is_encrypted();
drop(guard);

// Now do register_filesystem / register_pool / send_*_signals using fs_uuids + encrypted

This reduces lock hold time and keeps async boundaries cleaner without changing external behavior.

src/dbus/manager/manager_3_4/methods.rs (1)

84-103: Consider non-fail-fast behavior for filesystem registration.

The current implementation returns immediately on the first filesystem registration error (lines 97-100), preventing subsequent filesystems from being registered. Based on learnings, when filesystem registration fails after successful pool start, the code should log a warning and continue processing remaining filesystems rather than failing the entire operation.

Based on learnings, apply this pattern:

             for fs_uuid in guard
                 .filesystems()
                 .into_iter()
                 .map(|(_, fs_uuid, _)| fs_uuid)
                 .collect::<Vec<_>>()
             {
-                let fs_path = match register_filesystem(
+                match register_filesystem(
                     engine, connection, manager, counter, pool_uuid, fs_uuid,
                 )
                 .await
                 {
-                    Ok(fp) => fp,
+                    Ok(fp) => fs_paths.push(fp),
                     Err(e) => {
-                        let (rc, rs) = engine_to_dbus_err_tuple(&e);
-                        return (default_return, rc, rs);
+                        warn!("Unable to register object path for filesystem with UUID {fs_uuid} belonging to pool {pool_uuid} on the D-Bus: {e}");
                     }
-                };
-                fs_paths.push(fs_path);
+                }
             }
src/dbus/blockdev/blockdev_3_9/mod.rs (1)

16-29: Consider consolidating import statements.

The imports from crate:: are split across three separate blocks (lines 16-19, 20-27, 29). While functionally correct, consolidating these into a single use crate:: block would improve readability and align with the import style in other files.

-use crate::dbus::blockdev::blockdev_3_0::{
-    devnode_prop, hardware_info_prop, init_time_prop, physical_path_prop, pool_prop, tier_prop,
-    total_physical_size_prop, user_info_prop,
-};
-use crate::{
+use crate::dbus::blockdev::{
+    blockdev_3_0::{
+        devnode_prop, hardware_info_prop, init_time_prop, physical_path_prop, pool_prop,
+        tier_prop, total_physical_size_prop, user_info_prop,
+    },
+    blockdev_3_3::{new_physical_size_prop, set_user_info_prop},
+    shared::{blockdev_prop, set_blockdev_prop},
+};
+use crate::{
     dbus::{
-        blockdev::shared::{blockdev_prop, set_blockdev_prop},
         manager::Manager,
     },
     engine::{DevUuid, Engine, Lockable, PoolUuid},
     stratis::StratisResult,
 };
-
-use crate::dbus::blockdev::blockdev_3_3::{new_physical_size_prop, set_user_info_prop};
src/dbus/util.rs (1)

183-189: Consider documenting or implementing filesystem background signals

send_fs_background_signals is currently a no‑op, but it’s called from the timer path with the diffs returned by engine.fs_evented(). If dropping all FS diffs is intentional for now, a brief comment/TODO would help avoid confusion; otherwise, wiring FS signals similar to pools would complete the background signal story.

src/dbus/pool/pool_3_0/mod.rs (1)

82-98: Re-check CreateFilesystems behavior on partial registration failures

CreateFilesystems forwards directly to create_filesystems_method, which (per src/dbus/pool/pool_3_0/methods.rs snippet) currently returns an error on the first failed register_filesystem call inside the loop. That is a fail-fast behavior: if one filesystem fails to register on D-Bus, the whole CreateFilesystems call errors even though prior filesystems may have been created successfully.

Given the prior pattern in pool_3_6/methods.rs—where filesystem registration failures after successful creation are logged and the method continues processing remaining filesystems—this might be stricter than intended for the r0 interface as well. It would be more consistent with that behavior (and with the PR objective about not erroring rapidly on registration) to log the failure and continue registering subsequent filesystems, returning success plus only the successfully registered object paths.

If r0 is also expected to tolerate partial registration failures, consider updating create_filesystems_method accordingly (e.g., warn and continue in the error branch instead of return), mirroring the 3.6 implementation.

Based on learnings, this would align r0 with the documented behavior where registration failures don’t cause the entire operation to fail.

src/dbus/filesystem/filesystem_3_7/mod.rs (1)

35-80: FilesystemR7 registration helpers are straightforward; consider consistency with other modules

FilesystemR7::register and FilesystemR7::unregister correctly wrap object_server().at / .remove and return StratisResult<()>. The struct holds only what it needs (no connection field), which keeps it lean.

For consistency with ManagerR0 and PoolR0, you might optionally take &Arc<dyn Engine> in register and clone internally rather than taking Arc<dyn Engine> by value, but this is stylistic and not a correctness issue.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8bb0a20 and 1e98b5c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (65)
  • Cargo.toml (2 hunks)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/methods.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_1/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_2/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_3/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_4/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_5/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_8/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_9/mod.rs (1 hunks)
  • src/dbus/filesystem/mod.rs (1 hunks)
  • src/dbus/filesystem/shared.rs (1 hunks)
  • src/dbus/manager/manager_3_0/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_0/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_0/props.rs (1 hunks)
  • src/dbus/manager/manager_3_1/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_2/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_2/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_2/props.rs (1 hunks)
  • src/dbus/manager/manager_3_3/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_4/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_4/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_5/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_6/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_6/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_7/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_8/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_8/mod.rs (1 hunks)
  • src/dbus/manager/manager_3_8/props.rs (1 hunks)
  • src/dbus/manager/manager_3_9/methods.rs (1 hunks)
  • src/dbus/manager/manager_3_9/mod.rs (1 hunks)
  • src/dbus/manager/mod.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
  • src/dbus/pool/pool_3_0/methods.rs (1 hunks)
  • src/dbus/pool/pool_3_0/mod.rs (1 hunks)
  • src/dbus/pool/pool_3_0/props.rs (1 hunks)
  • src/dbus/pool/pool_3_9/mod.rs (1 hunks)
  • src/dbus/types.rs (1 hunks)
  • src/dbus/util.rs (1 hunks)
  • src/engine/mod.rs (1 hunks)
  • src/engine/types/keys.rs (4 hunks)
  • src/engine/types/mod.rs (4 hunks)
  • src/stratis/dm.rs (4 hunks)
  • src/stratis/timer.rs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (24)
  • src/dbus/manager/manager_3_8/props.rs
  • src/dbus/mod.rs
  • src/dbus/manager/manager_3_2/props.rs
  • src/engine/mod.rs
  • src/dbus/manager/manager_3_2/methods.rs
  • src/engine/types/mod.rs
  • src/dbus/blockdev/blockdev_3_3/props.rs
  • src/dbus/types.rs
  • src/dbus/filesystem/filesystem_3_6/props.rs
  • src/dbus/blockdev/mod.rs
  • src/dbus/filesystem/filesystem_3_0/methods.rs
  • src/dbus/blockdev/shared.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
  • src/dbus/filesystem/filesystem_3_6/mod.rs
  • src/dbus/manager/manager_3_1/mod.rs
  • src/dbus/filesystem/filesystem_3_5/mod.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/blockdev/blockdev_3_1/mod.rs
  • src/dbus/pool/pool_3_9/mod.rs
  • src/dbus/blockdev/blockdev_3_2/mod.rs
  • src/dbus/blockdev/blockdev_3_5/mod.rs
  • src/dbus/manager/manager_3_6/mod.rs
  • src/stratis/dm.rs
  • src/dbus/manager/manager_3_0/props.rs
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.526Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.
📚 Learning: 2025-12-01T22:14:23.526Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.526Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.

Applied to files:

  • src/dbus/pool/mod.rs
  • src/dbus/manager/manager_3_9/methods.rs
  • src/dbus/manager/manager_3_6/methods.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
  • src/dbus/manager/manager_3_3/mod.rs
  • src/dbus/manager/manager_3_4/methods.rs
  • src/dbus/manager/mod.rs
  • src/dbus/filesystem/filesystem_3_3/mod.rs
  • src/dbus/manager/manager_3_5/mod.rs
  • src/dbus/filesystem/filesystem_3_0/mod.rs
  • src/dbus/filesystem/filesystem_3_1/mod.rs
  • src/dbus/manager/manager_3_8/mod.rs
  • src/dbus/manager/manager_3_4/mod.rs
  • src/dbus/blockdev/blockdev_3_3/mod.rs
  • src/dbus/filesystem/filesystem_3_7/props.rs
  • src/dbus/filesystem/filesystem_3_4/mod.rs
  • src/dbus/blockdev/blockdev_3_0/methods.rs
  • src/dbus/pool/pool_3_0/methods.rs
  • src/dbus/manager/manager_3_9/mod.rs
  • src/dbus/util.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
  • src/dbus/manager/manager_3_0/methods.rs
  • src/dbus/manager/manager_3_8/methods.rs
  • src/stratis/timer.rs
  • src/dbus/filesystem/filesystem_3_9/mod.rs
  • src/dbus/manager/manager_3_7/mod.rs
  • src/dbus/filesystem/filesystem_3_7/mod.rs
  • src/dbus/manager/manager_3_2/mod.rs
  • src/dbus/blockdev/blockdev_3_7/mod.rs
  • src/dbus/filesystem/filesystem_3_8/mod.rs
  • src/dbus/filesystem/filesystem_3_2/mod.rs
  • src/dbus/filesystem/mod.rs
  • src/dbus/manager/manager_3_0/mod.rs
  • src/dbus/pool/pool_3_0/mod.rs
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/pool/mod.rs
  • src/dbus/manager/manager_3_9/methods.rs
  • src/dbus/manager/manager_3_6/methods.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
  • src/dbus/manager/manager_3_3/mod.rs
  • src/dbus/manager/manager_3_4/methods.rs
  • src/dbus/manager/manager_3_5/mod.rs
  • src/engine/types/keys.rs
  • src/dbus/pool/pool_3_0/props.rs
  • src/dbus/manager/manager_3_8/mod.rs
  • src/dbus/manager/manager_3_4/mod.rs
  • src/dbus/blockdev/blockdev_3_3/mod.rs
  • src/dbus/pool/pool_3_0/methods.rs
  • src/dbus/manager/manager_3_9/mod.rs
  • src/dbus/util.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
  • src/dbus/manager/manager_3_0/methods.rs
  • src/dbus/manager/manager_3_8/methods.rs
  • src/stratis/timer.rs
  • src/dbus/manager/manager_3_7/mod.rs
  • src/dbus/manager/manager_3_2/mod.rs
  • src/dbus/blockdev/blockdev_3_7/mod.rs
  • src/dbus/manager/manager_3_0/mod.rs
  • src/dbus/pool/pool_3_0/mod.rs
📚 Learning: 2025-09-05T14:32:42.528Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3898
File: src/engine/sim_engine/pool.rs:934-948
Timestamp: 2025-09-05T14:32:42.528Z
Learning: In src/engine/sim_engine/pool.rs, the start_encrypt_pool method intentionally creates a SizedKeyMemory with 1 byte allocated but 0 length reported - this is to avoid NULL pointer issues while simulating an empty key slice in the sim engine.

Applied to files:

  • src/dbus/manager/manager_3_9/methods.rs
  • src/dbus/manager/manager_3_4/methods.rs
  • src/dbus/pool/pool_3_0/props.rs
  • src/dbus/manager/manager_3_8/methods.rs
  • src/dbus/pool/pool_3_0/mod.rs
🧬 Code graph analysis (33)
src/dbus/pool/mod.rs (3)
src/dbus/blockdev/mod.rs (1)
  • register_blockdev (43-148)
src/dbus/util.rs (15)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/dbus/pool/pool_3_0/mod.rs (4)
  • Uuid (164-166)
  • register (53-71)
  • new (37-51)
  • unregister (73-79)
src/dbus/manager/manager_3_6/methods.rs (3)
src/dbus/pool/mod.rs (1)
  • unregister_pool (88-112)
src/dbus/util.rs (18)
  • engine_to_dbus_err_tuple (70-76)
  • send_locked_pools_signals (191-237)
  • send_stopped_pools_signals (239-399)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/dbus/manager/manager_3_2/methods.rs (1)
  • stop_pool_method (123-185)
src/dbus/filesystem/filesystem_3_0/props.rs (2)
src/dbus/filesystem/filesystem_3_0/mod.rs (1)
  • Name (99-101)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/manager/manager_3_3/mod.rs (3)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/util.rs (15)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/dbus/manager/manager_3_4/methods.rs (7)
src/dbus/filesystem/mod.rs (1)
  • register_filesystem (42-150)
src/dbus/util.rs (17)
  • engine_to_dbus_err_tuple (70-76)
  • tuple_to_option (30-36)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/manager/manager_3_2/methods.rs (1)
  • start_pool_method (28-121)
src/dbus/manager/manager_3_8/methods.rs (1)
  • start_pool_method (141-255)
src/dbus/manager/manager_3_9/methods.rs (1)
  • start_pool_method (32-147)
src/dbus/manager/manager_3_4/mod.rs (1)
  • new (45-57)
src/dbus/manager/mod.rs (10)
src/dbus/manager/manager_3_8/mod.rs (1)
  • register (62-79)
src/dbus/manager/manager_3_9/mod.rs (1)
  • register (61-78)
src/dbus/manager/manager_3_7/mod.rs (1)
  • register (57-74)
src/dbus/manager/manager_3_6/mod.rs (1)
  • register (60-77)
src/dbus/manager/manager_3_5/mod.rs (1)
  • register (56-73)
src/dbus/manager/manager_3_4/mod.rs (1)
  • register (59-76)
src/dbus/manager/manager_3_3/mod.rs (1)
  • register (57-74)
src/dbus/manager/manager_3_2/mod.rs (1)
  • register (58-75)
src/dbus/manager/manager_3_1/mod.rs (1)
  • register (51-68)
src/dbus/manager/manager_3_0/mod.rs (1)
  • register (53-70)
src/dbus/manager/manager_3_5/mod.rs (2)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/util.rs (15)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/dbus/filesystem/filesystem_3_0/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_1/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/pool/pool_3_0/props.rs (3)
src/dbus/util.rs (1)
  • option_to_tuple (39-44)
src/dbus/pool/pool_3_0/mod.rs (1)
  • Name (170-172)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/manager/manager_3_8/mod.rs (3)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_8/methods.rs (4)
  • create_pool_method (40-138)
  • key_desc (56-59)
  • devs (55-55)
  • clevis_info (60-60)
src/dbus/manager/manager_3_8/props.rs (1)
  • stopped_pools_prop (12-16)
src/dbus/manager/manager_3_4/mod.rs (3)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_4/methods.rs (1)
  • start_pool_method (28-134)
src/dbus/util.rs (15)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/dbus/blockdev/blockdev_3_3/mod.rs (2)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/filesystem/filesystem_3_4/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/blockdev/blockdev_3_0/methods.rs (13)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/blockdev/blockdev_3_0/mod.rs (1)
  • Uuid (126-128)
src/dbus/blockdev/blockdev_3_1/mod.rs (1)
  • Uuid (122-124)
src/dbus/blockdev/blockdev_3_2/mod.rs (1)
  • Uuid (122-124)
src/dbus/blockdev/blockdev_3_3/mod.rs (1)
  • Uuid (137-139)
src/dbus/blockdev/blockdev_3_4/mod.rs (1)
  • Uuid (134-136)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)
  • Uuid (134-136)
src/dbus/blockdev/blockdev_3_6/mod.rs (1)
  • Uuid (135-137)
src/dbus/blockdev/blockdev_3_7/mod.rs (1)
  • Uuid (135-137)
src/dbus/blockdev/blockdev_3_8/mod.rs (1)
  • Uuid (134-136)
src/dbus/blockdev/blockdev_3_9/mod.rs (1)
  • Uuid (134-136)
src/engine/strat_engine/thinpool/filesystem.rs (1)
  • format (156-162)
src/dbus/pool/mod.rs (1)
  • pool (71-71)
src/dbus/pool/pool_3_0/methods.rs (2)
src/dbus/filesystem/mod.rs (2)
  • register_filesystem (42-150)
  • unregister_filesystem (152-178)
src/dbus/util.rs (16)
  • engine_to_dbus_err_tuple (70-76)
  • send_pool_name_signal (401-417)
  • tuple_to_option (30-36)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
src/dbus/blockdev/blockdev_3_4/mod.rs (9)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/blockdev/blockdev_3_0/mod.rs (12)
  • new (38-50)
  • register (52-64)
  • unregister (66-75)
  • Devnode (88-90)
  • HardwareInfo (94-102)
  • UserInfo (106-108)
  • InitializationTime (112-116)
  • Pool (120-122)
  • Uuid (126-128)
  • Tier (132-134)
  • PhysicalPath (138-146)
  • TotalPhysicalSize (150-158)
src/dbus/blockdev/blockdev_3_1/mod.rs (12)
  • new (34-46)
  • register (48-60)
  • unregister (62-71)
  • Devnode (84-86)
  • HardwareInfo (90-98)
  • UserInfo (102-104)
  • InitializationTime (108-112)
  • Pool (116-118)
  • Uuid (122-124)
  • Tier (128-130)
  • PhysicalPath (134-142)
  • TotalPhysicalSize (146-154)
src/dbus/blockdev/blockdev_3_2/mod.rs (12)
  • new (34-46)
  • register (48-60)
  • unregister (62-71)
  • Devnode (84-86)
  • HardwareInfo (90-98)
  • UserInfo (102-104)
  • InitializationTime (108-112)
  • Pool (116-118)
  • Uuid (122-124)
  • Tier (128-130)
  • PhysicalPath (134-142)
  • TotalPhysicalSize (146-154)
src/dbus/blockdev/blockdev_3_7/mod.rs (13)
  • new (40-52)
  • register (54-66)
  • unregister (68-77)
  • Devnode (84-86)
  • HardwareInfo (90-98)
  • UserInfo (102-104)
  • set_UserInfo (108-117)
  • InitializationTime (121-125)
  • Pool (129-131)
  • Uuid (135-137)
  • Tier (141-143)
  • PhysicalPath (147-155)
  • TotalPhysicalSize (159-167)
src/dbus/blockdev/blockdev_3_8/mod.rs (13)
  • new (39-51)
  • register (53-65)
  • unregister (67-76)
  • Devnode (83-85)
  • HardwareInfo (89-97)
  • UserInfo (101-103)
  • set_UserInfo (107-116)
  • InitializationTime (120-124)
  • Pool (128-130)
  • Uuid (134-136)
  • Tier (140-142)
  • PhysicalPath (146-154)
  • TotalPhysicalSize (158-166)
src/dbus/blockdev/blockdev_3_9/mod.rs (13)
  • new (39-51)
  • register (53-65)
  • unregister (67-76)
  • Devnode (83-85)
  • HardwareInfo (89-97)
  • UserInfo (101-103)
  • set_UserInfo (107-116)
  • InitializationTime (120-124)
  • Pool (128-130)
  • Uuid (134-136)
  • Tier (140-142)
  • PhysicalPath (146-154)
  • TotalPhysicalSize (158-166)
src/dbus/manager/manager_3_9/mod.rs (4)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_9/methods.rs (1)
  • start_pool_method (32-147)
src/dbus/manager/manager_3_8/mod.rs (10)
  • new (48-60)
  • register (62-79)
  • Version (87-89)
  • StoppedPools (93-95)
  • ListKeys (98-100)
  • SetKey (103-109)
  • UnsetKey (112-114)
  • CreatePool (118-142)
  • DestroyPool (145-147)
  • StartPool (150-175)
src/dbus/manager/manager_3_0/mod.rs (8)
  • new (39-51)
  • register (53-70)
  • Version (78-80)
  • ListKeys (89-91)
  • SetKey (94-100)
  • UnsetKey (103-105)
  • CreatePool (109-128)
  • DestroyPool (131-133)
src/dbus/blockdev/blockdev_3_9/mod.rs (10)
src/dbus/blockdev/blockdev_3_0/props.rs (6)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/blockdev/blockdev_3_0/mod.rs (11)
  • new (38-50)
  • register (52-64)
  • connection (70-72)
  • unregister (66-75)
  • Devnode (88-90)
  • HardwareInfo (94-102)
  • UserInfo (106-108)
  • InitializationTime (112-116)
  • Pool (120-122)
  • Uuid (126-128)
  • Tier (132-134)
src/dbus/blockdev/blockdev_3_3/mod.rs (12)
  • new (42-54)
  • register (56-68)
  • connection (74-76)
  • unregister (70-79)
  • Devnode (86-88)
  • HardwareInfo (92-100)
  • UserInfo (104-106)
  • set_UserInfo (110-119)
  • InitializationTime (123-127)
  • Pool (131-133)
  • Uuid (137-139)
  • Tier (143-145)
src/dbus/blockdev/blockdev_3_4/mod.rs (12)
  • new (39-51)
  • register (53-65)
  • connection (71-73)
  • unregister (67-76)
  • Devnode (83-85)
  • HardwareInfo (89-97)
  • UserInfo (101-103)
  • set_UserInfo (107-116)
  • InitializationTime (120-124)
  • Pool (128-130)
  • Uuid (134-136)
  • Tier (140-142)
src/dbus/blockdev/blockdev_3_5/mod.rs (12)
  • new (39-51)
  • register (53-65)
  • connection (71-73)
  • unregister (67-76)
  • Devnode (83-85)
  • HardwareInfo (89-97)
  • UserInfo (101-103)
  • set_UserInfo (107-116)
  • InitializationTime (120-124)
  • Pool (128-130)
  • Uuid (134-136)
  • Tier (140-142)
src/dbus/blockdev/blockdev_3_6/mod.rs (12)
  • new (40-52)
  • register (54-66)
  • connection (72-74)
  • unregister (68-77)
  • Devnode (84-86)
  • HardwareInfo (90-98)
  • UserInfo (102-104)
  • set_UserInfo (108-117)
  • InitializationTime (121-125)
  • Pool (129-131)
  • Uuid (135-137)
  • Tier (141-143)
src/dbus/blockdev/blockdev_3_7/mod.rs (12)
  • new (40-52)
  • register (54-66)
  • connection (72-74)
  • unregister (68-77)
  • Devnode (84-86)
  • HardwareInfo (90-98)
  • UserInfo (102-104)
  • set_UserInfo (108-117)
  • InitializationTime (121-125)
  • Pool (129-131)
  • Uuid (135-137)
  • Tier (141-143)
src/dbus/blockdev/blockdev_3_8/mod.rs (12)
  • new (39-51)
  • register (53-65)
  • connection (71-73)
  • unregister (67-76)
  • Devnode (83-85)
  • HardwareInfo (89-97)
  • UserInfo (101-103)
  • set_UserInfo (107-116)
  • InitializationTime (120-124)
  • Pool (128-130)
  • Uuid (134-136)
  • Tier (140-142)
src/dbus/util.rs (1)
src/dbus/types.rs (3)
  • from (52-115)
  • from (241-247)
  • from (269-275)
src/dbus/blockdev/blockdev_3_0/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (28-44)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/mod.rs (5)
  • new (42-54)
  • Devnode (86-88)
  • Pool (131-133)
  • Uuid (137-139)
  • Tier (143-145)
src/dbus/manager/manager_3_8/methods.rs (5)
src/dbus/filesystem/mod.rs (1)
  • register_filesystem (42-150)
src/dbus/pool/mod.rs (2)
  • pool (71-71)
  • register_pool (27-86)
src/dbus/util.rs (19)
  • engine_to_dbus_err_tuple (70-76)
  • send_locked_pools_signals (191-237)
  • send_stopped_pools_signals (239-399)
  • tuple_to_option (30-36)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/dbus/manager/manager_3_0/methods.rs (2)
  • create_pool_method (99-157)
  • devs (111-111)
src/dbus/manager/manager_3_2/methods.rs (2)
  • start_pool_method (28-121)
  • guard (72-76)
src/stratis/timer.rs (1)
src/dbus/util.rs (17)
  • send_fs_background_signals (184-189)
  • send_pool_background_signals (79-181)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/dbus/filesystem/filesystem_3_9/mod.rs (5)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/pool/pool_3_0/props.rs (3)
  • name_prop (12-15)
  • size_prop (17-19)
  • used_prop (21-27)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/engine/types/actions.rs (3)
  • new (235-237)
  • new (311-313)
  • new (586-589)
src/dbus/manager/manager_3_7/mod.rs (2)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/util.rs (15)
  • connection (94-96)
  • connection (114-116)
  • connection (141-143)
  • connection (161-163)
  • connection (200-202)
  • connection (219-221)
  • connection (248-250)
  • connection (267-269)
  • connection (286-288)
  • connection (305-307)
  • connection (324-326)
  • connection (343-345)
  • connection (362-364)
  • connection (381-383)
  • connection (402-404)
src/dbus/filesystem/filesystem_3_7/mod.rs (5)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-42)
  • size_limit_prop (14-19)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_7/props.rs (3)
  • merge_scheduled_prop (23-25)
  • origin_prop (14-21)
  • set_merge_scheduled_prop (27-41)
src/dbus/manager/manager_3_2/mod.rs (3)
src/dbus/manager/manager_3_0/props.rs (1)
  • version_prop (12-14)
src/dbus/manager/manager_3_2/methods.rs (1)
  • refresh_state_method (187-192)
src/dbus/manager/manager_3_2/props.rs (1)
  • stopped_pools_prop (12-16)
src/dbus/blockdev/blockdev_3_8/mod.rs (4)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/blockdev/blockdev_3_0/mod.rs (7)
  • new (38-50)
  • register (52-64)
  • connection (70-72)
  • unregister (66-75)
  • Pool (120-122)
  • Uuid (126-128)
  • Tier (132-134)
src/dbus/blockdev/blockdev_3_6/mod.rs (4)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/blockdev/blockdev_3_0/mod.rs (4)
  • new (38-50)
  • Pool (120-122)
  • Uuid (126-128)
  • Tier (132-134)
src/dbus/filesystem/filesystem_3_2/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_0/mod.rs (4)
  • Name (99-101)
  • new (34-46)
  • Pool (105-107)
  • Uuid (123-125)
src/dbus/filesystem/mod.rs (10)
src/dbus/filesystem/filesystem_3_9/mod.rs (2)
  • register (54-66)
  • unregister (68-77)
src/dbus/filesystem/filesystem_3_0/mod.rs (2)
  • register (48-60)
  • unregister (62-71)
src/dbus/filesystem/filesystem_3_1/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_2/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_3/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_4/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_5/mod.rs (2)
  • register (52-64)
  • unregister (66-75)
src/dbus/filesystem/filesystem_3_6/mod.rs (2)
  • register (55-67)
  • unregister (69-78)
src/dbus/filesystem/filesystem_3_7/mod.rs (2)
  • register (57-69)
  • unregister (71-80)
src/dbus/filesystem/filesystem_3_8/mod.rs (2)
  • register (54-66)
  • unregister (68-77)
src/dbus/manager/manager_3_0/mod.rs (2)
src/dbus/manager/manager_3_0/methods.rs (2)
  • create_pool_method (99-157)
  • devs (111-111)
src/dbus/manager/manager_3_0/props.rs (2)
  • locked_pools_prop (16-18)
  • version_prop (12-14)
src/dbus/pool/pool_3_0/mod.rs (3)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/pool/pool_3_0/methods.rs (3)
  • create_filesystems_method (30-121)
  • filesystems (40-52)
  • filesystems (134-137)
src/dbus/pool/pool_3_0/props.rs (5)
  • allocated_prop (29-31)
  • encrypted_prop (33-35)
  • name_prop (12-15)
  • size_prop (17-19)
  • used_prop (21-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: python-based-tests
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)

Comment on lines +8 to +12
use zbus::{
fdo::Error,
interface,
zvariant::{ObjectPath, OwnedObjectPath},
Connection,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Incorrect error type: should use zbus::Error not zbus::fdo::Error.

Line 9 imports zbus::fdo::Error, but per PR objectives, property setters must return zbus::Error instead of zbus::fdo::Error. This affects all property methods in the interface (lines 87, 93, 99, 105, 111, 117).

Apply this diff:

 use zbus::{
-    fdo::Error,
+    Error,
     interface,
     zvariant::{ObjectPath, OwnedObjectPath},
     Connection,
 };
📝 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
use zbus::{
fdo::Error,
interface,
zvariant::{ObjectPath, OwnedObjectPath},
Connection,
use zbus::{
Error,
interface,
zvariant::{ObjectPath, OwnedObjectPath},
Connection,
};

Comment on lines +55 to +71
let id = match id_type {
"uuid" => match PoolUuid::parse_str(id) {
Ok(u) => PoolIdentifier::Uuid(u),
Err(e) => {
let (rc, rs) = engine_to_dbus_err_tuple(&e);
return (default_return, rc, rs);
}
},
"name" => PoolIdentifier::Name(Name::new(id.to_string())),
_ => {
return (
default_return,
DbusErrorEnum::ERROR as u16,
format!("ID type {id_type} not recognized"),
);
}
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Search for PoolUuid::parse_str definition
rg "fn parse_str" --type rust -A 3 | head -30

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

# Search for engine_to_dbus_err_tuple definition
rg "fn engine_to_dbus_err_tuple" --type rust -A 5

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

# Look for PoolUuid type and error handling
rg "type PoolUuid|struct PoolUuid" --type rust -A 2

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

# Search for error trait implementations involving UUID or parse errors
rg "impl.*From.*uuid" --type rust -A 3

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

# Find similar error handling patterns in manager methods
rg "parse_str.*Err\(" --type rust -B 2 -A 5

Repository: stratis-storage/stratisd

Length of output: 192


🌐 Web query:

PoolUuid stratisd uuid parse error handling

💡 Result:

Short answer: that error comes from Rust's UUID parsing (uuid::Uuid::parse_str / FromStr) when stratisd tries to convert a pool UUID string into its PoolUuid/Uuid type. Handle it by validating/normalizing the input, using Uuid::parse_str (or FromStr) and mapping the crate ParseError into a clear, user-facing Stratis error (or DBus error) rather than panicking — e.g. return an Err with a helpful message or a specific error variant you can surface to the caller. See stratisd source for where pool UUIDs are used and the uuid crate docs for parsing behavior and error type.

References:

  • stratisd repository (project location / source). [1]
  • uuid crate parse_str / FromStr documentation (ParseError returned by parsing). [2]

Fix PoolUuid::parse_str error handling: wrong error type for engine_to_dbus_err_tuple

In the "uuid" branch, passing the parse error directly to engine_to_dbus_err_tuple causes a type mismatch. The uuid::Uuid::parse_str returns a ParseError from the uuid crate, not a StratisError, and these need explicit conversion.

Suggested approaches:

  1. Return an explicit DBus error for invalid UUID input:
"uuid" => match PoolUuid::parse_str(id) {
    Ok(u) => PoolIdentifier::Uuid(u),
    Err(e) => {
        return (
            default_return,
            DbusErrorEnum::ERROR as u16,
            format!("Invalid pool UUID {id}: {e}"),
        );
    }
},
  1. Or wrap the error into StratisError if that conversion is available:
"uuid" => PoolIdentifier::Uuid(
    PoolUuid::parse_str(id)
        .map_err(|e| StratisError::Msg(format!("Invalid pool UUID: {e}")))
        .and_then(|u| ...)?
),
🤖 Prompt for AI Agents
In src/dbus/manager/manager_3_9/methods.rs around lines 55 to 71, the "uuid"
branch passes the ParseError from PoolUuid::parse_str into
engine_to_dbus_err_tuple which expects a StratisError; change the error handling
so the parse error is not forwarded directly — either return an explicit DBus
error for invalid UUID input (returning default_return, DbusErrorEnum::ERROR as
u16, and a formatted message that includes the pool id and parse error) or
convert/wrap the uuid::ParseError into a StratisError before calling
engine_to_dbus_err_tuple so the function receives the expected error type.

Comment on lines +86 to +135
Ok(StartAction::Started(pool_uuid)) => {
let guard = match engine.get_pool(PoolIdentifier::Uuid(pool_uuid)).await {
Some(g) => g,
None => {
return (
default_return,
DbusErrorEnum::ERROR as u16,
format!("No pool found for newly started pool with UUID {pool_uuid}"),
);
}
};
let mut fs_paths = Vec::default();
for fs_uuid in guard
.filesystems()
.into_iter()
.map(|(_, fs_uuid, _)| fs_uuid)
.collect::<Vec<_>>()
{
let fs_path = match register_filesystem(
engine, connection, manager, counter, pool_uuid, fs_uuid,
)
.await
{
Ok(fp) => fp,
Err(e) => {
let (rc, rs) = engine_to_dbus_err_tuple(&e);
return (default_return, rc, rs);
}
};
fs_paths.push(fs_path);
}
let (pool_path, dev_paths) =
match register_pool(engine, connection, manager, counter, pool_uuid).await {
Ok(pp) => pp,
Err(e) => {
let (rc, rs) = engine_to_dbus_err_tuple(&e);
return (default_return, rc, rs);
}
};

if guard.is_encrypted() {
send_locked_pools_signals(connection).await;
}
send_stopped_pools_signals(connection).await;

(
(true, (pool_path, dev_paths, fs_paths)),
DbusErrorEnum::OK as u16,
OK_STRING.to_string(),
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's understand the directory structure and find relevant files
git ls-files src/dbus/ | grep -E "(manager|pool)" | head -20

Repository: stratis-storage/stratisd

Length of output: 192


Align start_pool error handling with pool create/destroy pattern: use best-effort registration instead of failing fast

The StartAction::Started branch currently returns errors immediately on any register_filesystem or register_pool failure. This contradicts the established pattern in pool create/destroy methods (e.g., pool_3_6), which intentionally log registration failures and continue after successful engine operations, returning success with whatever was successfully registered on D-Bus.

Replace the early return statements on registration errors with warn! logs instead:

  • When register_filesystem fails for a filesystem, log the error and skip that filesystem rather than aborting the entire operation
  • When register_pool fails, log the error but still return ((true, (pool_path, dev_paths, fs_paths)), OK, "OK") with what was successfully registered

This aligns start_pool with the codebase's "don't fail fast on D-Bus registration" design goal and allows the operation to report success when the engine pool start succeeds, even if some D-Bus objects fail to register.

🤖 Prompt for AI Agents
In src/dbus/manager/manager_3_9/methods.rs around lines 86 to 135, the
StartAction::Started branch currently returns immediately on any
register_filesystem or register_pool error; change this to the
pool-create/destroy pattern: when register_filesystem fails, log a warn! with
the error and skip that filesystem (do not return), and when register_pool
fails, log a warn! with the error but do not abort—still construct and return
the success tuple ((true, (pool_path, dev_paths, fs_paths)), OK, "OK") using
whatever pool_path/dev_paths/fs_paths were successfully registered; ensure no
early returns for registration errors and preserve sending the locked/stopped
signals as before.

Comment on lines +80 to +103
Ok(Ok(changed)) => {
let mut object_paths = Vec::new();
match changed.changed() {
Some(v) => {
for (_, uuid, _) in v {
match register_filesystem(
engine, connection, manager, counter, pool_uuid, uuid,
)
.await
{
Ok(path) => {
object_paths.push(path);
}
Err(e) => {
let (rc, rs) = engine_to_dbus_err_tuple(&e);
return (default_return, rc, rs);
}
}
}
(
(true, object_paths),
DbusErrorEnum::OK as u16,
OK_STRING.to_string(),
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find the pool methods files to understand the repository structure
fd -t f "pool_3_0" --max-results 5

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

fd -t f "pool.*methods.rs" --max-results 20

Repository: stratis-storage/stratisd

Length of output: 192


Align filesystem registration error handling with pool_3_6 pattern

The create_filesystems_method in pool_3_0 currently fails the entire operation on the first filesystem registration error, but pool_3_6 intentionally logs a warning and continues processing remaining filesystems. This allows the method to succeed while returning only the successfully registered filesystems, avoiding treating D-Bus wiring failures as engine-level failures.

Update the error handling to log and continue instead of returning early:

for (_, uuid, _) in v {
    match register_filesystem(..., uuid).await {
        Ok(path) => object_paths.push(path),
        Err(e) => {
            let (rc, rs) = engine_to_dbus_err_tuple(&e);
            warn!("Failed to register filesystem: {}", e);
            continue;
        }
    }
}

Then return ((true, object_paths), OK, "OK") with the successfully registered subset.

🤖 Prompt for AI Agents
In src/dbus/pool/pool_3_0/methods.rs around lines 80 to 103, the loop currently
returns early on the first register_filesystem error which aborts the whole
operation; instead, change the error-handling to log a warning and continue so
remaining filesystems are attempted and only successfully registered paths are
returned. Specifically, inside the for (_, uuid, _) in v { ... } match arm,
replace the Err(e) branch so it converts the error if needed
(engine_to_dbus_err_tuple(&e) can still be called for context), emits a warn!
with the error message, then continue the loop rather than returning; leave the
final return as ((true, object_paths), DbusErrorEnum::OK as u16,
OK_STRING.to_string()) so the method succeeds with the subset of successfully
registered filesystems.

Comment on lines +208 to +243
let guard_res = engine
.get_mut_pool(PoolIdentifier::Uuid(pool_uuid))
.await
.ok_or_else(|| StratisError::Msg(format!("No pool associated with uuid {pool_uuid}")));
match tokio::task::spawn_blocking(move || {
let mut guard = guard_res?;
let (name, _, pool) = guard.as_mut_tuple();
handle_action!(pool.snapshot_filesystem(
name.to_string().as_str(),
pool_uuid,
fs_uuid,
snapshot_name.as_str()
))
.map(|act| match act {
CreateAction::Created((uuid, _)) => CreateAction::Created(uuid),
CreateAction::Identity => CreateAction::Identity,
})
})
.await
{
Ok(Ok(CreateAction::Created(snapshot_uuid))) => {
let path = match register_filesystem(
engine,
connection,
manager,
counter,
pool_uuid,
snapshot_uuid,
)
.await
{
Ok(p) => p,
Err(e) => {
let (rc, rs) = engine_to_dbus_err_tuple(&e);
return (default_return, rc, rs);
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd /tmp && find . -name "pool_3_0" -type d 2>/dev/null | head -5

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

fd "pool_3_0" --type d

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

fd "methods.rs" | grep pool

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

fd "pool" --type d src/dbus | head -10

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

git ls-files "src/dbus/pool*" | grep methods

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

git ls-files "src/dbus/pool/" | head -20

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

ls -la src/dbus/pool/

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

cat -n src/dbus/pool/pool_3_0/methods.rs | sed -n '208,243p'

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

cat -n src/dbus/pool/pool_3_6/methods.rs | sed -n '88,120p'

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -A 30 "create_filesystems" src/dbus/pool/pool_3_6/methods.rs | head -60

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -A 30 "create_filesystems" src/dbus/pool/pool_3_0/methods.rs | head -80

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -B 5 -A 15 "register_filesystem.*await" src/dbus/pool/pool_3_0/methods.rs | head -50

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -B 5 -A 20 "warn!" src/dbus/pool/pool_3_6/methods.rs | grep -A 10 register_filesystem

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -B 20 "snapshot_filesystem_method" src/dbus/pool/pool_3_0/methods.rs | grep -A 5 "let default_return"

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

cat -n src/dbus/pool/pool_3_0/methods.rs | sed -n '180,210p'

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

cat -n src/dbus/pool/pool_3_0/methods.rs | sed -n '170,250p'

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg "snapshot_filesystem_method" src/dbus/pool/pool_3_6/methods.rs

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

git ls-files "src/dbus/pool/pool_*" | sort

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

fd "pool_" src/dbus/pool --type d | sort

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg "snapshot_filesystem" src/dbus/pool --type rust -l

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -B 5 "snapshot_filesystem_method" src/dbus/pool/pool_3_1/methods.rs | head -40

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -A 40 "snapshot_filesystem_method" src/dbus/pool/pool_3_1/methods.rs | head -60

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -A 30 "create_filesystems" src/dbus/pool/pool_3_1/methods.rs | head -50

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

cat -n src/dbus/pool/pool_3_6/methods.rs | sed -n '85,115p'

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

cat -n src/dbus/pool/pool_3_0/methods.rs | sed -n '210,250p'

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

rg -B 50 "fn snapshot_filesystem_method" src/dbus/pool/pool_3_0/methods.rs | grep -A 2 "-> Rc"

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

cat -n src/dbus/pool/pool_3_0/methods.rs | sed -n '145,180p'

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

cat -n src/dbus/pool/pool_3_0/methods.rs | sed -n '200,250p'

Repository: stratis-storage/stratisd

Length of output: 192


Align snapshot registration error handling with best-effort semantics

In snapshot_filesystem_method, a failure in register_filesystem after a successful engine snapshot currently causes the whole method to error. However, pool_3_6's create_filesystems and other pool methods intentionally warn and continue when registration fails, allowing the operation to succeed while logging that the object may not be visible to clients.

Update the error handling to match this best-effort approach:

let path = match register_filesystem(...).await {
    Ok(p) => p,
    Err(e) => {
        warn!("register_filesystem failed: snapshot may not be visible to clients: {}", e);
        ObjectPath::default()
    }
};
// Return ((true, path), OK, "OK") to indicate successful snapshot creation
return ((true, path), OK, "OK".to_string());

This keeps snapshot semantics consistent with create_filesystems behavior across API versions while still surfacing operational issues via logs.

🤖 Prompt for AI Agents
In src/dbus/pool/pool_3_0/methods.rs around lines 208 to 243, the code currently
returns an error when register_filesystem fails after a successful engine
snapshot; change this to best-effort semantics: if
register_filesystem(...).await returns Ok(p) use p, but if it returns Err(e) log
a warning like "register_filesystem failed: snapshot may not be visible to
clients: {e}" and set path to ObjectPath::default(); then return ((true, path),
OK, "OK".to_string()) to indicate the snapshot succeeded even though
registration failed.

Comment on lines +21 to +27
pub fn used_prop(guard: SomeLockReadGuard<PoolUuid, dyn Pool>) -> (bool, String) {
let (b, used) = option_to_tuple(
guard.total_physical_used().map(|s| s.bytes()),
Bytes::from(0u64),
);
(b, (*used).to_string())
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix type/logic in used_prop to follow the String-based option pattern

used_prop currently mixes total_physical_used().map(|s| s.bytes()) with a Bytes::from(0u64) default, then stringifies via (*used).to_string(). This is both hard to read and likely type-incorrect compared to the established pattern used elsewhere (e.g., blockdev new_physical_size_prop, which maps to String directly and uses String::new() as the default).

Consider simplifying to something along these lines so the option type is consistently Option<String> and the default is a String:

-pub fn used_prop(guard: SomeLockReadGuard<PoolUuid, dyn Pool>) -> (bool, String) {
-    let (b, used) = option_to_tuple(
-        guard.total_physical_used().map(|s| s.bytes()),
-        Bytes::from(0u64),
-    );
-    (b, (*used).to_string())
-}
+pub fn used_prop(guard: SomeLockReadGuard<PoolUuid, dyn Pool>) -> (bool, String) {
+    option_to_tuple(
+        guard
+            .total_physical_used()
+            .map(|s| (*s.bytes()).to_string()),
+        String::new(),
+    )
+}

This matches the rest of the D‑Bus property helpers that expose optional numeric values as (bool, String) and avoids potential type mismatches between the mapped value and the default.

📝 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
pub fn used_prop(guard: SomeLockReadGuard<PoolUuid, dyn Pool>) -> (bool, String) {
let (b, used) = option_to_tuple(
guard.total_physical_used().map(|s| s.bytes()),
Bytes::from(0u64),
);
(b, (*used).to_string())
}
pub fn used_prop(guard: SomeLockReadGuard<PoolUuid, dyn Pool>) -> (bool, String) {
option_to_tuple(
guard
.total_physical_used()
.map(|s| (*s.bytes()).to_string()),
String::new(),
)
}
🤖 Prompt for AI Agents
In src/dbus/pool/pool_3_0/props.rs around lines 21 to 27, change used_prop to
operate on Option<String> instead of mixing numeric Bytes with a
Bytes::from(0u64) default: map total_physical_used() to a String (e.g.
guard.total_physical_used().map(|s| s.bytes().to_string())), call
option_to_tuple with that Option<String> and use String::new() as the default,
and return the resulting (bool, String); this keeps the option type consistent
with other property helpers and avoids type mismatches.

Copy link

@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: 1

♻️ Duplicate comments (4)
src/dbus/filesystem/mod.rs (1)

42-150: Avoid fail‑fast filesystem interface registration; attempt all and log failures.

register_filesystem uses ? on each FilesystemR0..R9::register(...) call, so a single failing revision aborts the function, contradicting the stated requirement that registration “should not error rapidly if one interface fails” and that we should attempt to register all interfaces.

Consider following the pool/filesystem creation pattern: invoke each FilesystemR*::register in turn, log any individual errors, and still return Ok(path) if at least one interface successfully registers (optionally erroring only if all registrations fail).

src/dbus/blockdev/mod.rs (1)

43-148: Blockdev registration should not fail fast and must avoid leaving orphaned interfaces.

register_blockdev short‑circuits on the first failed BlockdevR*::register via ?, which both:

  • Conflicts with the requirement to keep registering remaining interfaces when one fails.
  • Can leave already registered interfaces (R0..Rk−1) pinned in the object server without a corresponding manager mapping, since add_blockdev only runs after all ? succeed.

Consider:

  • Registering each BlockdevR* in if let Err(e) = ... blocks, logging individual failures, and tracking whether at least one succeeded.
  • Ensuring manager.add_blockdev(&path, dev_uuid) is called whenever there is at least one successful registration, so the manager mapping is consistent with the object server.
  • Optionally returning an error only if all interface registrations fail.

This would align blockdev behavior with the filesystem/pool registration pattern and the PR objective.

src/dbus/blockdev/blockdev_3_6/mod.rs (1)

100-104: Add explicit emits_changed_signal for consistency across revisions.

The user_info property is missing an explicit emits_changed_signal attribute (defaulting to "true"), while BlockdevR0 and BlockdevR2 explicitly set it to "false". For consistency across interface versions, the emission behavior should align.

Apply this diff:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn user_info(&self) -> Result<(bool, String), Error> {

Based on past review comments and consistency with other blockdev revisions.

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

102-106: Add explicit emits_changed_signal for consistency across revisions.

The user_info property lacks an explicit emits_changed_signal setting (defaulting to "true"), while BlockdevR0, BlockdevR2, and BlockdevR9 explicitly set it to "false". Since R3 provides a setter (set_UserInfo), the emission behavior should align with other revisions.

Apply this diff:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     #[allow(non_snake_case)]
     async fn user_info(&self) -> Result<(bool, String), Error> {

Based on past review comments and consistency with other blockdev revisions.

🧹 Nitpick comments (5)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)

13-50: set_name_method correctly wraps rename_filesystem results

The method’s use of get_mut_pool, RenameAction, and DbusErrorEnum mirrors the established pattern from other D-Bus methods: it distinguishes missing pool/filesystem, successful renames, identity renames, and errors, with a sensible changed flag and message. The FIXME: send signal note clearly marks the future enhancement without affecting current correctness.

src/dbus/filesystem/mod.rs (1)

152-178: Unregister path could also avoid fail‑fast behavior (optional).

unregister_filesystem fails immediately on the first FilesystemR*::unregister error, which can leave some interfaces registered while the manager mapping has already been removed. As a follow‑up, you might want to attempt all unregister calls, log individual failures, and only then decide whether to return an error.

src/dbus/blockdev/mod.rs (1)

150-175: Unregister path may want to tolerate individual interface removal failures.

unregister_blockdev fails on the first unsuccessful BlockdevR*::unregister before cleaning up later revisions or the manager mapping. As you start using this function, it may be safer to attempt all unregisters, log any failures, and only then decide whether to propagate an error.

src/dbus/filesystem/filesystem_3_7/mod.rs (2)

137-141: Consider marking origin property as const.

The origin property represents the source filesystem UUID for snapshots, which is set at creation time and never changes. Consider adding emits_changed_signal = "const" to match other immutable properties like created, pool, and uuid.

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "const"))]
     #[allow(non_snake_case)]
     async fn origin(&self) -> Result<(bool, FilesystemUuid), Error> {

131-135: Consider adding emits_changed_signal for the name property.

Since the SetName method can modify the filesystem name, the name property should likely emit a change signal. Consider emits_changed_signal = "true" or "invalidates" to notify D-Bus clients when the name changes.

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "invalidates"))]
     #[allow(non_snake_case)]
     async fn name(&self) -> Result<Name, Error> {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e98b5c and d8b6907.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (35)
  • Cargo.toml (2 hunks)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/methods.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_1/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_2/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_3/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_4/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_5/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_8/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_9/mod.rs (1 hunks)
  • src/dbus/filesystem/mod.rs (1 hunks)
  • src/dbus/filesystem/shared.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
  • src/engine/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
  • src/dbus/blockdev/blockdev_3_0/methods.rs
  • src/dbus/blockdev/blockdev_3_3/props.rs
  • src/dbus/filesystem/filesystem_3_6/props.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
  • src/dbus/filesystem/filesystem_3_7/props.rs
  • src/dbus/mod.rs
  • src/dbus/blockdev/blockdev_3_5/mod.rs
  • src/dbus/pool/mod.rs
  • src/dbus/filesystem/filesystem_3_2/mod.rs
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-01T22:14:23.564Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.564Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.

Applied to files:

  • src/dbus/filesystem/filesystem_3_6/mod.rs
  • src/dbus/filesystem/filesystem_3_0/methods.rs
  • src/dbus/filesystem/filesystem_3_1/mod.rs
  • src/dbus/filesystem/filesystem_3_0/mod.rs
  • src/dbus/blockdev/mod.rs
  • src/dbus/filesystem/filesystem_3_5/mod.rs
  • src/dbus/filesystem/mod.rs
  • src/dbus/filesystem/filesystem_3_4/mod.rs
  • src/dbus/filesystem/filesystem_3_3/mod.rs
  • src/dbus/filesystem/filesystem_3_9/mod.rs
  • src/dbus/blockdev/blockdev_3_7/mod.rs
  • src/dbus/filesystem/filesystem_3_8/mod.rs
  • src/dbus/filesystem/filesystem_3_7/mod.rs
  • src/dbus/blockdev/shared.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/blockdev/mod.rs
  • src/dbus/blockdev/blockdev_3_3/mod.rs
  • src/dbus/blockdev/blockdev_3_7/mod.rs
  • src/dbus/blockdev/shared.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
🧬 Code graph analysis (16)
src/dbus/filesystem/filesystem_3_6/mod.rs (3)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-39)
  • size_limit_prop (14-19)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/blockdev/blockdev_3_1/mod.rs (11)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (28-44)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_2/mod.rs (14)
  • new (34-46)
  • uuid (122-124)
  • register (48-60)
  • connection (66-68)
  • unregister (62-71)
  • set_user_info (78-80)
  • devnode (84-86)
  • hardware_info (90-98)
  • user_info (102-104)
  • initialization_time (108-112)
  • pool (116-118)
  • tier (128-130)
  • physical_path (134-142)
  • total_physical_size (146-154)
src/dbus/blockdev/blockdev_3_3/mod.rs (13)
  • new (42-54)
  • uuid (137-139)
  • register (56-68)
  • connection (74-76)
  • unregister (70-79)
  • devnode (86-88)
  • hardware_info (92-100)
  • user_info (104-106)
  • initialization_time (123-127)
  • pool (131-133)
  • tier (143-145)
  • physical_path (149-157)
  • total_physical_size (161-169)
src/dbus/blockdev/blockdev_3_4/mod.rs (13)
  • new (39-51)
  • uuid (134-136)
  • register (53-65)
  • connection (71-73)
  • unregister (67-76)
  • devnode (83-85)
  • hardware_info (89-97)
  • user_info (101-103)
  • initialization_time (120-124)
  • pool (128-130)
  • tier (140-142)
  • physical_path (146-154)
  • total_physical_size (158-166)
src/dbus/blockdev/blockdev_3_5/mod.rs (13)
  • new (39-51)
  • uuid (134-136)
  • register (53-65)
  • connection (71-73)
  • unregister (67-76)
  • devnode (83-85)
  • hardware_info (89-97)
  • user_info (101-103)
  • initialization_time (120-124)
  • pool (128-130)
  • tier (140-142)
  • physical_path (146-154)
  • total_physical_size (158-166)
src/dbus/blockdev/blockdev_3_6/mod.rs (13)
  • new (40-52)
  • uuid (135-137)
  • register (54-66)
  • connection (72-74)
  • unregister (68-77)
  • devnode (84-86)
  • hardware_info (90-98)
  • user_info (102-104)
  • initialization_time (121-125)
  • pool (129-131)
  • tier (141-143)
  • physical_path (147-155)
  • total_physical_size (159-167)
src/dbus/blockdev/blockdev_3_7/mod.rs (13)
  • new (40-52)
  • uuid (135-137)
  • register (54-66)
  • connection (72-74)
  • unregister (68-77)
  • devnode (84-86)
  • hardware_info (90-98)
  • user_info (102-104)
  • initialization_time (121-125)
  • pool (129-131)
  • tier (141-143)
  • physical_path (147-155)
  • total_physical_size (159-167)
src/dbus/blockdev/blockdev_3_8/mod.rs (13)
  • new (39-51)
  • uuid (134-136)
  • register (53-65)
  • connection (71-73)
  • unregister (67-76)
  • devnode (83-85)
  • hardware_info (89-97)
  • user_info (101-103)
  • initialization_time (120-124)
  • pool (128-130)
  • tier (140-142)
  • physical_path (146-154)
  • total_physical_size (158-166)
src/dbus/blockdev/blockdev_3_9/mod.rs (13)
  • new (39-51)
  • uuid (134-136)
  • register (53-65)
  • connection (71-73)
  • unregister (67-76)
  • devnode (83-85)
  • hardware_info (89-97)
  • user_info (101-103)
  • initialization_time (120-124)
  • pool (128-130)
  • tier (140-142)
  • physical_path (146-154)
  • total_physical_size (158-166)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
src/engine/strat_engine/thinpool/filesystem.rs (1)
  • format (156-162)
src/dbus/filesystem/filesystem_3_1/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_0/mod.rs (11)
  • new (34-46)
  • uuid (123-125)
  • register (48-60)
  • unregister (62-71)
  • name (99-101)
  • set_name (81-83)
  • created (87-89)
  • devnode (93-95)
  • pool (105-107)
  • size (111-113)
  • used (117-119)
src/dbus/filesystem/filesystem_3_5/mod.rs (12)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_0/mod.rs (12)
  • new (34-46)
  • uuid (123-125)
  • register (48-60)
  • connection (66-68)
  • unregister (62-71)
  • name (99-101)
  • set_name (81-83)
  • created (87-89)
  • devnode (93-95)
  • pool (105-107)
  • size (111-113)
  • used (117-119)
src/dbus/filesystem/filesystem_3_1/mod.rs (12)
  • new (38-50)
  • uuid (127-129)
  • register (52-64)
  • connection (70-72)
  • unregister (66-75)
  • name (103-105)
  • set_name (85-87)
  • created (91-93)
  • devnode (97-99)
  • pool (109-111)
  • size (115-117)
  • used (121-123)
src/dbus/filesystem/filesystem_3_2/mod.rs (12)
  • new (38-50)
  • uuid (127-129)
  • register (52-64)
  • connection (70-72)
  • unregister (66-75)
  • name (103-105)
  • set_name (85-87)
  • created (91-93)
  • devnode (97-99)
  • pool (109-111)
  • size (115-117)
  • used (121-123)
src/dbus/filesystem/filesystem_3_3/mod.rs (12)
  • new (38-50)
  • uuid (126-128)
  • register (52-64)
  • connection (70-72)
  • unregister (66-75)
  • name (103-105)
  • set_name (85-87)
  • created (91-93)
  • devnode (97-99)
  • pool (108-110)
  • size (114-116)
  • used (120-122)
src/dbus/filesystem/filesystem_3_4/mod.rs (12)
  • new (38-50)
  • uuid (127-129)
  • register (52-64)
  • connection (70-72)
  • unregister (66-75)
  • name (103-105)
  • set_name (85-87)
  • created (91-93)
  • devnode (97-99)
  • pool (109-111)
  • size (115-117)
  • used (121-123)
src/dbus/filesystem/filesystem_3_6/mod.rs (12)
  • new (41-53)
  • uuid (149-151)
  • register (55-67)
  • connection (73-75)
  • unregister (69-78)
  • name (106-108)
  • set_name (88-90)
  • created (94-96)
  • devnode (100-102)
  • pool (112-114)
  • size (118-120)
  • used (143-145)
src/dbus/filesystem/filesystem_3_7/mod.rs (12)
  • new (43-55)
  • uuid (182-184)
  • register (57-69)
  • connection (75-77)
  • unregister (71-80)
  • name (133-135)
  • set_name (90-92)
  • created (96-98)
  • devnode (102-104)
  • pool (145-147)
  • size (151-153)
  • used (176-178)
src/dbus/filesystem/filesystem_3_8/mod.rs (12)
  • new (40-52)
  • uuid (179-181)
  • register (54-66)
  • connection (72-74)
  • unregister (68-77)
  • name (130-132)
  • set_name (87-89)
  • created (93-95)
  • devnode (99-101)
  • pool (142-144)
  • size (148-150)
  • used (173-175)
src/dbus/filesystem/filesystem_3_9/mod.rs (12)
  • new (40-52)
  • uuid (179-181)
  • register (54-66)
  • connection (72-74)
  • unregister (68-77)
  • name (130-132)
  • set_name (87-89)
  • created (93-95)
  • devnode (99-101)
  • pool (142-144)
  • size (148-150)
  • used (173-175)
src/dbus/blockdev/blockdev_3_8/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/blockdev/blockdev_3_2/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/pool/mod.rs (1)
  • pool (71-71)
src/dbus/filesystem/filesystem_3_3/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_0/mod.rs (9)
  • new (34-46)
  • uuid (123-125)
  • name (99-101)
  • set_name (81-83)
  • created (87-89)
  • devnode (93-95)
  • pool (105-107)
  • size (111-113)
  • used (117-119)
src/dbus/blockdev/blockdev_3_6/mod.rs (3)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/blockdev/blockdev_3_9/mod.rs (4)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_0/mod.rs (13)
  • new (38-50)
  • uuid (126-128)
  • register (52-64)
  • connection (70-72)
  • unregister (66-75)
  • devnode (88-90)
  • hardware_info (94-102)
  • user_info (106-108)
  • initialization_time (112-116)
  • pool (120-122)
  • tier (132-134)
  • physical_path (138-146)
  • total_physical_size (150-158)
src/dbus/blockdev/blockdev_3_3/mod.rs (15)
  • new (42-54)
  • uuid (137-139)
  • register (56-68)
  • connection (74-76)
  • unregister (70-79)
  • devnode (86-88)
  • hardware_info (92-100)
  • user_info (104-106)
  • set_UserInfo (110-119)
  • initialization_time (123-127)
  • pool (131-133)
  • tier (143-145)
  • physical_path (149-157)
  • total_physical_size (161-169)
  • new_physical_size (173-181)
src/dbus/blockdev/blockdev_3_7/mod.rs (3)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/filesystem/filesystem_3_8/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-39)
  • size_limit_prop (14-19)
src/dbus/filesystem/filesystem_3_7/props.rs (3)
  • merge_scheduled_prop (23-25)
  • origin_prop (14-21)
  • set_merge_scheduled_prop (27-38)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_7/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-39)
  • size_limit_prop (14-19)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_7/props.rs (3)
  • merge_scheduled_prop (23-25)
  • origin_prop (14-21)
  • set_merge_scheduled_prop (27-38)
src/dbus/blockdev/shared.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (2)
  • uuid (126-128)
  • tier (132-134)
src/dbus/blockdev/blockdev_3_1/mod.rs (2)
  • uuid (122-124)
  • tier (128-130)
src/dbus/blockdev/blockdev_3_2/mod.rs (2)
  • uuid (122-124)
  • tier (128-130)
src/dbus/blockdev/blockdev_3_3/mod.rs (2)
  • uuid (137-139)
  • tier (143-145)
src/dbus/blockdev/blockdev_3_4/mod.rs (2)
  • uuid (134-136)
  • tier (140-142)
src/dbus/blockdev/blockdev_3_5/mod.rs (2)
  • uuid (134-136)
  • tier (140-142)
src/dbus/blockdev/blockdev_3_6/mod.rs (2)
  • uuid (135-137)
  • tier (141-143)
src/dbus/blockdev/blockdev_3_7/mod.rs (2)
  • uuid (135-137)
  • tier (141-143)
src/dbus/blockdev/blockdev_3_8/mod.rs (2)
  • uuid (134-136)
  • tier (140-142)
src/dbus/blockdev/blockdev_3_9/mod.rs (2)
  • uuid (134-136)
  • tier (140-142)
src/dbus/filesystem/shared.rs (11)
src/dbus/pool/pool_3_9/mod.rs (1)
  • Name (104-106)
src/dbus/filesystem/filesystem_3_0/mod.rs (2)
  • uuid (123-125)
  • name (99-101)
src/dbus/filesystem/filesystem_3_1/mod.rs (2)
  • uuid (127-129)
  • name (103-105)
src/dbus/filesystem/filesystem_3_2/mod.rs (2)
  • uuid (127-129)
  • name (103-105)
src/dbus/filesystem/filesystem_3_3/mod.rs (2)
  • uuid (126-128)
  • name (103-105)
src/dbus/filesystem/filesystem_3_4/mod.rs (2)
  • uuid (127-129)
  • name (103-105)
src/dbus/filesystem/filesystem_3_5/mod.rs (2)
  • uuid (127-129)
  • name (103-105)
src/dbus/filesystem/filesystem_3_6/mod.rs (2)
  • uuid (149-151)
  • name (106-108)
src/dbus/filesystem/filesystem_3_7/mod.rs (2)
  • uuid (182-184)
  • name (133-135)
src/dbus/filesystem/filesystem_3_8/mod.rs (2)
  • uuid (179-181)
  • name (130-132)
src/dbus/filesystem/filesystem_3_9/mod.rs (2)
  • uuid (179-181)
  • name (130-132)
src/dbus/blockdev/blockdev_3_0/mod.rs (4)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (28-44)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (7)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • user_info_prop (51-53)
src/dbus/pool/mod.rs (1)
  • pool (71-71)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: python-based-tests
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile stratisd-tools, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
🔇 Additional comments (30)
src/engine/mod.rs (1)

18-20: Re-exporting lock guards is appropriate

Making SomeLockReadGuard and SomeLockWriteGuard public alongside the other guard types matches their new usage in shared helpers and keeps the engine surface coherent.

Cargo.toml (1)

233-243: Double‑check git-based zbus/zvariant setup and zvariant gating

The zbus/zvariant dependencies are pinned to a personal git repo/branch and zvariant is now always enabled (non‑optional), while dbus_enabled only toggles dep:zbus. That’s fine short‑term, but for long‑term maintenance you may want to:

  • Confirm this fork/branch is the intended source for master, and plan how you'll track upstream updates.
  • Consider making zvariant optional and adding "dep:zvariant" to dbus_enabled if it’s only used in the D-Bus path, so non‑D-Bus builds avoid pulling it in.

Also applies to: 298-299

src/dbus/blockdev/blockdev_3_1/mod.rs (2)

26-72: BlockdevR1 struct and lifecycle helpers match existing pattern

The BlockdevR1 fields and new/register/unregister functions mirror the other blockdev revisions, correctly cloning the manager and using object_server().at/remove for binding, so the lifecycle integration looks sound.


74-155: BlockdevR1 interface correctly reuses shared blockdev helpers

All properties and set_user_info delegate through blockdev_prop, pool_prop, and set_user_info_method, matching the patterns in R2–R9 and centralizing pool/blockdev lookup and error handling. This should give consistent behavior across blockdev interface versions.

src/dbus/filesystem/shared.rs (1)

13-30: Filesystem shared helpers are well-factored and symmetric with blockdev

set_filesystem_prop and filesystem_prop cleanly centralize pool lookup, missing‑pool/filesystem error reporting, and guard handling, mirroring the existing blockdev shared helpers. This reduces duplication in the per‑revision filesystem modules and keeps behavior consistent.

Also applies to: 32-50

src/dbus/blockdev/blockdev_3_8/mod.rs (2)

31-77: BlockdevR8 struct and registration/unregistration are consistent

The BlockdevR8 struct fields and its register/unregister functions follow the same pattern as the other blockdev revisions, so the Manager wiring and D-Bus object lifecycle look consistent.


79-179: UserInfo/NewPhysicalSize wiring correctly reuses shared helpers

The interface delegates all getters through blockdev_prop and the R0/R3 prop functions, while set_UserInfo uses set_blockdev_prop with set_user_info_prop, and new_physical_size uses new_physical_size_prop. This keeps R8’s behavior aligned with the existing blockdev versions while exposing the additional properties.

src/dbus/blockdev/blockdev_3_2/mod.rs (2)

26-72: BlockdevR2 struct and lifecycle helper pattern look good

The BlockdevR2 state (engine, manager, parent_uuid, uuid) and its new/register/unregister methods are consistent with the other blockdev revisions and provide the expected D-Bus object lifecycle hooks.


74-155: BlockdevR2 interface cleanly reuses shared methods and props

set_user_info forwards to set_user_info_method, and all properties use blockdev_prop/pool_prop plus the R0 prop helpers, so behavior and error handling should match R0/R3–R9 for the shared pieces.

src/dbus/blockdev/blockdev_3_7/mod.rs (2)

32-78: BlockdevR7 struct and D-Bus lifecycle match other revisions

The BlockdevR7 struct makeup and its register/unregister methods follow the same pattern as the surrounding blockdev versions, so the engine/manager wiring and object lifetime are consistent.


80-179: BlockdevR7 interface wiring is consistent and introduces mutable UserInfo cleanly

The getters all go through blockdev_prop and the shared prop functions, while set_UserInfo uses set_blockdev_prop with set_user_info_prop, mirroring the R8 design and providing a straightforward mutable UserInfo property alongside new_physical_size.

src/dbus/blockdev/shared.rs (1)

13-26: Shared blockdev helpers correctly separate setter/getter error types.

set_blockdev_prop uses zbus::Error for the setter path while blockdev_prop uses zbus::fdo::Error for read‑only properties, matching the pattern in filesystem helpers and the PR requirement for setters. Error messages and UUID usage look correct.

Also applies to: 28-44

src/dbus/filesystem/filesystem_3_0/mod.rs (1)

26-31: FilesystemR0 interface is consistent with shared helpers and other revisions.

Registration/unregistration and all properties use the expected helpers and zbus::fdo::Error for getters, with no setters in this revision, so this module aligns with the intended pattern.

Also applies to: 48-72, 74-125

src/dbus/filesystem/filesystem_3_5/mod.rs (1)

30-35: FilesystemR5 mirrors R0 correctly.

Structure, registration, and property wiring match FilesystemR0, with getters using fdo::Error and no property setters, which is consistent with the overall design.

Also applies to: 37-76, 78-129

src/dbus/filesystem/filesystem_3_6/mod.rs (1)

122-139: SizeLimit setter correctly returns zbus::Error.

set_SizeLimit uses Result<(), zbus::Error> and delegates to set_filesystem_prop/set_size_limit_prop, which also return zbus::Error, matching the PR requirement while keeping getters on fdo::Error.

src/dbus/blockdev/blockdev_3_4/mod.rs (1)

79-117: BlockdevR4 user‑info setter uses the correct error type.

set_UserInfo returns Result<(), zbus::Error> and routes through set_blockdev_prop/set_user_info_prop, keeping getters on fdo::Error while satisfying the requirement that property setters use zbus::Error. The rest of the properties are wired consistently with other blockdev revisions.

src/dbus/filesystem/filesystem_3_1/mod.rs (1)

30-130: LGTM! Clean implementation following established patterns.

The FilesystemR1 interface implementation correctly delegates to shared helpers, uses appropriate error types, and follows the architectural pattern established by FilesystemR0 and other revisions.

src/dbus/filesystem/filesystem_3_4/mod.rs (1)

30-130: LGTM! Consistent implementation for R4 interface.

FilesystemR4 follows the same pattern as R1, which is appropriate for API versioning. The interface exposes org.storage.stratis3.filesystem.r4 with standard filesystem properties and delegates correctly to shared helpers.

src/dbus/filesystem/filesystem_3_9/mod.rs (1)

32-182: LGTM! Property setters correctly return zbus::Error.

The FilesystemR9 implementation properly handles mutable properties (MergeScheduled and SizeLimit) with setters that return zbus::Error, aligning with the PR objective mentioned in comments. The delegation to shared helpers from filesystem_3_0, filesystem_3_6, and filesystem_3_7 is appropriate.

src/dbus/blockdev/blockdev_3_9/mod.rs (1)

31-179: LGTM! Correctly implements BlockdevR9 interface.

The implementation properly delegates to shared blockdev properties and the set_UserInfo setter returns zbus::Error as required. Property emission signals are appropriately configured for the block device semantics.

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

30-159: LGTM! BlockdevR0 implementation is solid.

The R0 interface correctly exposes block device properties and the SetUserInfo method. Past review comments about pool property and error messages have been addressed. The implementation properly delegates to shared helpers and uses appropriate emission signals.

src/dbus/filesystem/filesystem_3_8/mod.rs (1)

32-182: LGTM! FilesystemR8 properly implements mutable properties.

The implementation correctly handles property setters (set_MergeScheduled and set_SizeLimit) with the required zbus::Error return type, and appropriately delegates to shared filesystem property helpers.

src/dbus/filesystem/filesystem_3_7/mod.rs (8)

1-29: Imports and license header look correct.

The imports appropriately distinguish between zbus::fdo::Error (aliased as Error for property getters) and zbus::Error (used explicitly for property setters), aligning with the PR requirement that property setters must return zbus::Error.


31-33: Module structure follows established pattern.

The re-exports align with other filesystem revision modules, providing a clean public API for the prop helpers.


35-55: Struct definition and private constructor are well-designed.

The private constructor pattern with public register method enforces proper D-Bus lifecycle management.


57-81: Lifecycle methods follow established pattern.

The register and unregister methods properly propagate errors via StratisResult. Based on learnings, the orchestration layer (e.g., register_filesystem) handles these errors gracefully by logging warnings and continuing with remaining interfaces rather than failing the entire operation.


83-92: D-Bus interface definition looks correct.

The interface name follows the versioning convention, and set_name properly delegates to the shared method helper.


118-129: Property setter correctly returns zbus::Error.

The set_MergeScheduled setter returns Result<(), zbus::Error> as required, matching the PR comment requirement that property setters must return zbus::Error instead of zbus::fdo::Error.


161-172: Property setter correctly returns zbus::Error.

The set_SizeLimit setter returns Result<(), zbus::Error>, consistent with set_MergeScheduled and the PR requirements.


180-184: LGTM - uuid property is correctly synchronous.

The uuid property appropriately uses a synchronous function since it simply returns the stored value without any async operations.

Copy link

@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

♻️ Duplicate comments (4)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)

7-11: Missing import for handle_action! macro.

The handle_action! macro is used at line 29 but not imported. This will cause a compilation error.

 use crate::{
     dbus::{consts::OK_STRING, types::DbusErrorEnum},
     engine::{Engine, FilesystemUuid, PoolIdentifier, PoolUuid, RenameAction},
+    handle_action,
     stratis::StratisError,
 };
src/dbus/filesystem/mod.rs (1)

58-147: Fail-fast registration contradicts PR design intent.

Per PR objectives, "the registration process should not error rapidly if one interface fails during registration." The current implementation uses ? operators that fail-fast, preventing subsequent interface registrations and leaving previously registered interfaces orphaned on the D-Bus object server.

Based on learnings, registration failures should log warnings and continue processing rather than failing the entire operation.

src/dbus/blockdev/mod.rs (1)

56-145: Fail-fast registration contradicts PR design intent.

Per PR objectives, "the registration process should not error rapidly if one interface fails during registration." The current implementation uses ? operators that fail-fast on the first error, preventing subsequent interface registrations and leaving previously registered interfaces (e.g., BlockdevR0-R4 if R5 fails) orphaned on the D-Bus object server.

Based on learnings, registration failures should log warnings and continue processing rather than failing the entire operation.

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

100-105: UserInfo emits_changed_signal remains inconsistent across blockdev revisions

BlockdevR2.user_info is explicitly marked emits_changed_signal = "false", while BlockdevR3 (here) and the newer BlockdevR4/BlockdevR9 rely on the default, leading to different notification behavior for the same conceptual property. If this wasn’t an intentional behavioral change, consider aligning user_info with R2 by adding emits_changed_signal = "false" (and adjusting R4/R9 similarly), or documenting the divergence.

Example for Line 100:

-    #[zbus(property)]
+    #[zbus(property(emits_changed_signal = "false"))]
     async fn user_info(&self) -> Result<(bool, String), Error> {
🧹 Nitpick comments (1)
src/dbus/blockdev/blockdev_3_5/mod.rs (1)

79-168: R5 properties and setter wiring are consistent; consider deduplicating with R7.

The property getters and set_user_info are wired identically to R7, with appropriate use of shared helpers and zbus::Error for the setter, so behavior and error typing look correct. Since the R5 and R7 interface implementations are effectively the same apart from type/interface names, you might eventually factor the common logic into a generic helper or macro to reduce duplication and ease future maintenance, though this is optional and can be deferred.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8b6907 and b8c7cbb.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (35)
  • Cargo.toml (2 hunks)
  • src/dbus/blockdev/blockdev_3_0/methods.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_0/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_1/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_2/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_3/props.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_4/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_5/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_6/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_7/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_8/mod.rs (1 hunks)
  • src/dbus/blockdev/blockdev_3_9/mod.rs (1 hunks)
  • src/dbus/blockdev/mod.rs (1 hunks)
  • src/dbus/blockdev/shared.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/methods.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_0/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_1/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_2/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_3/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_4/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_5/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_6/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_7/props.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_8/mod.rs (1 hunks)
  • src/dbus/filesystem/filesystem_3_9/mod.rs (1 hunks)
  • src/dbus/filesystem/mod.rs (1 hunks)
  • src/dbus/filesystem/shared.rs (1 hunks)
  • src/dbus/mod.rs (1 hunks)
  • src/dbus/pool/mod.rs (1 hunks)
  • src/engine/mod.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
  • src/dbus/blockdev/blockdev_3_0/methods.rs
  • src/dbus/blockdev/shared.rs
  • src/dbus/pool/mod.rs
  • src/dbus/blockdev/blockdev_3_0/props.rs
  • src/dbus/filesystem/filesystem_3_4/mod.rs
  • src/dbus/blockdev/blockdev_3_1/mod.rs
  • src/dbus/blockdev/blockdev_3_6/mod.rs
  • src/dbus/mod.rs
  • src/dbus/filesystem/filesystem_3_6/props.rs
  • src/dbus/filesystem/filesystem_3_7/mod.rs
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-01T22:14:23.564Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3927
File: src/dbus/pool/pool_3_6/methods.rs:88-100
Timestamp: 2025-12-01T22:14:23.564Z
Learning: In src/dbus/pool/pool_3_6/methods.rs and similar D-Bus pool methods, when filesystem registration fails after successful creation, the code intentionally logs a warning and continues processing remaining filesystems rather than failing the entire operation. This allows the method to return success even if some filesystems aren't visible on D-Bus, which is the desired behavior.

Applied to files:

  • src/dbus/filesystem/mod.rs
  • src/dbus/filesystem/filesystem_3_7/props.rs
  • src/dbus/filesystem/filesystem_3_3/mod.rs
  • src/dbus/filesystem/filesystem_3_5/mod.rs
  • src/dbus/blockdev/mod.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
  • src/dbus/filesystem/filesystem_3_6/mod.rs
  • src/dbus/filesystem/filesystem_3_9/mod.rs
  • src/dbus/filesystem/filesystem_3_8/mod.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
  • src/dbus/filesystem/filesystem_3_0/methods.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/blockdev/blockdev_3_7/mod.rs
  • src/dbus/filesystem/filesystem_3_0/mod.rs
  • src/dbus/filesystem/filesystem_3_2/mod.rs
  • src/dbus/filesystem/filesystem_3_1/mod.rs
📚 Learning: 2025-08-20T02:37:22.477Z
Learnt from: jbaublitz
Repo: stratis-storage/stratisd PR: 3651
File: src/dbus_api/pool/pool_3_9/methods.rs:173-176
Timestamp: 2025-08-20T02:37:22.477Z
Learning: The encrypt_pool, reencrypt_pool, and decrypt_pool methods in src/dbus_api/pool/pool_3_9/methods.rs have intentionally different lock handling patterns due to different workflow requirements, and this is not an inconsistency that needs to be fixed.

Applied to files:

  • src/dbus/filesystem/filesystem_3_3/mod.rs
  • src/dbus/blockdev/mod.rs
  • src/dbus/filesystem/filesystem_3_0/props.rs
  • src/dbus/blockdev/blockdev_3_0/mod.rs
  • src/dbus/filesystem/shared.rs
  • src/dbus/blockdev/blockdev_3_7/mod.rs
🧬 Code graph analysis (18)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
src/dbus/blockdev/blockdev_3_0/mod.rs (2)
  • user_info (102-104)
  • pool (114-116)
src/dbus/pool/mod.rs (1)
  • pool (71-71)
src/dbus/blockdev/blockdev_3_3/mod.rs (6)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_0/mod.rs (14)
  • new (38-50)
  • uuid (119-121)
  • register (52-64)
  • connection (70-72)
  • unregister (66-75)
  • devnode (86-88)
  • hardware_info (91-99)
  • user_info (102-104)
  • set_user_info (81-83)
  • initialization_time (107-111)
  • pool (114-116)
  • tier (124-126)
  • physical_path (129-137)
  • total_physical_size (140-148)
src/dbus/blockdev/blockdev_3_2/mod.rs (14)
  • new (34-46)
  • uuid (115-117)
  • register (48-60)
  • connection (66-68)
  • unregister (62-71)
  • devnode (82-84)
  • hardware_info (87-95)
  • user_info (98-100)
  • set_user_info (77-79)
  • initialization_time (103-107)
  • pool (110-112)
  • tier (120-122)
  • physical_path (125-133)
  • total_physical_size (136-144)
src/dbus/pool/mod.rs (1)
  • pool (71-71)
src/dbus/filesystem/filesystem_3_3/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/filesystem/filesystem_3_5/mod.rs (1)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/blockdev/mod.rs (10)
src/dbus/blockdev/blockdev_3_0/mod.rs (4)
  • connection (70-72)
  • register (52-64)
  • unregister (66-75)
  • uuid (119-121)
src/dbus/blockdev/blockdev_3_1/mod.rs (4)
  • connection (66-68)
  • register (48-60)
  • unregister (62-71)
  • uuid (115-117)
src/dbus/blockdev/blockdev_3_2/mod.rs (4)
  • connection (66-68)
  • register (48-60)
  • unregister (62-71)
  • uuid (115-117)
src/dbus/blockdev/blockdev_3_3/mod.rs (4)
  • connection (74-76)
  • register (56-68)
  • unregister (70-79)
  • uuid (130-132)
src/dbus/blockdev/blockdev_3_4/mod.rs (4)
  • connection (71-73)
  • register (53-65)
  • unregister (67-76)
  • uuid (127-129)
src/dbus/blockdev/blockdev_3_5/mod.rs (4)
  • connection (71-73)
  • register (53-65)
  • unregister (67-76)
  • uuid (127-129)
src/dbus/blockdev/blockdev_3_6/mod.rs (4)
  • connection (72-74)
  • register (54-66)
  • unregister (68-77)
  • uuid (129-131)
src/dbus/blockdev/blockdev_3_7/mod.rs (4)
  • connection (72-74)
  • register (54-66)
  • unregister (68-77)
  • uuid (128-130)
src/dbus/blockdev/blockdev_3_8/mod.rs (4)
  • connection (71-73)
  • register (53-65)
  • unregister (67-76)
  • uuid (127-129)
src/dbus/blockdev/blockdev_3_9/mod.rs (4)
  • connection (71-73)
  • register (53-65)
  • unregister (67-76)
  • uuid (127-129)
src/dbus/filesystem/filesystem_3_0/props.rs (1)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/filesystem/filesystem_3_6/mod.rs (2)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_9/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/pool/pool_3_0/props.rs (3)
  • name_prop (12-15)
  • size_prop (17-19)
  • used_prop (21-27)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/blockdev/blockdev_3_4/mod.rs (4)
src/dbus/blockdev/blockdev_3_0/props.rs (6)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/blockdev/blockdev_3_0/mod.rs (10)
  • new (38-50)
  • uuid (119-121)
  • devnode (86-88)
  • hardware_info (91-99)
  • user_info (102-104)
  • set_user_info (81-83)
  • initialization_time (107-111)
  • pool (114-116)
  • tier (124-126)
  • physical_path (129-137)
src/dbus/filesystem/filesystem_3_8/mod.rs (5)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_6/props.rs (2)
  • set_size_limit_prop (21-39)
  • size_limit_prop (14-19)
src/dbus/filesystem/shared.rs (2)
  • filesystem_prop (32-50)
  • set_filesystem_prop (13-30)
src/dbus/filesystem/filesystem_3_7/mod.rs (13)
  • new (43-55)
  • uuid (169-171)
  • register (57-69)
  • connection (75-77)
  • unregister (71-80)
  • name (127-129)
  • created (94-96)
  • devnode (99-101)
  • pool (137-139)
  • size (142-144)
  • size_limit (147-149)
  • set_size_limit (152-161)
  • used (164-166)
src/dbus/filesystem/filesystem_3_9/mod.rs (13)
  • new (40-52)
  • uuid (166-168)
  • register (54-66)
  • connection (72-74)
  • unregister (68-77)
  • name (124-126)
  • created (91-93)
  • devnode (96-98)
  • pool (134-136)
  • size (139-141)
  • size_limit (144-146)
  • set_size_limit (149-158)
  • used (161-163)
src/dbus/blockdev/blockdev_3_0/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (28-44)
src/dbus/blockdev/blockdev_3_0/methods.rs (1)
  • set_user_info_method (13-53)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
src/dbus/filesystem/filesystem_3_0/mod.rs (3)
  • uuid (115-117)
  • name (95-97)
  • pool (100-102)
src/dbus/blockdev/blockdev_3_7/mod.rs (3)
src/dbus/blockdev/shared.rs (1)
  • blockdev_prop (28-44)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/filesystem/filesystem_3_0/mod.rs (4)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/pool/shared.rs (1)
  • pool_prop (21-29)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/engine/engine.rs (6)
  • created (84-84)
  • devnode (81-81)
  • devnode (106-106)
  • size (93-93)
  • size (122-122)
  • used (90-90)
src/dbus/filesystem/filesystem_3_2/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/blockdev/blockdev_3_9/mod.rs (3)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/dbus/blockdev/blockdev_3_3/props.rs (2)
  • new_physical_size_prop (12-17)
  • set_user_info_prop (19-40)
src/dbus/filesystem/filesystem_3_1/mod.rs (3)
src/dbus/filesystem/filesystem_3_0/props.rs (6)
  • created_prop (15-17)
  • devnode_prop (19-28)
  • name_prop (30-32)
  • pool_prop (34-46)
  • size_prop (48-50)
  • used_prop (52-54)
src/dbus/filesystem/filesystem_3_0/methods.rs (1)
  • set_name_method (13-50)
src/dbus/filesystem/shared.rs (1)
  • filesystem_prop (32-50)
src/dbus/blockdev/blockdev_3_8/mod.rs (4)
src/dbus/blockdev/blockdev_3_0/props.rs (8)
  • devnode_prop (13-15)
  • hardware_info_prop (17-19)
  • init_time_prop (21-23)
  • physical_path_prop (25-27)
  • pool_prop (29-41)
  • tier_prop (47-49)
  • total_physical_size_prop (43-45)
  • user_info_prop (51-53)
src/dbus/blockdev/shared.rs (2)
  • blockdev_prop (28-44)
  • set_blockdev_prop (13-26)
src/stratis/keys.rs (1)
  • engine (28-46)
src/dbus/pool/mod.rs (1)
  • pool (71-71)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (32)
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:cockpit
  • GitHub Check: testing-farm:fedora-rawhide-x86_64:local
  • GitHub Check: testing-farm:fedora-42-x86_64:local
  • GitHub Check: testing-farm:fedora-41-x86_64:local
  • GitHub Check: testing-farm:fedora-43-x86_64:local
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile docs-ci, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min-no-systemd, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-utils, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: tests-with-testing-repo (master)
  • GitHub Check: python-based-tests
  • GitHub Check: stratis-min-cli-checks
  • GitHub Check: checks (make -f Makefile build-min, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile test, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile build-no-ipc, 1.91.0, cargo)
  • GitHub Check: checks (PROFILEDIR=debug make -f Makefile build, 1.91.0, cargo)
  • GitHub Check: checks (make -f Makefile clippy, 1.91.0, clippy)
  • GitHub Check: checks_with_udev (RUST_LOG=stratisd=debug make -f Makefile test-loop-root, 1.91.0, cargo)
  • GitHub Check: checks_with_tang_should_fail (TANG_URL=localhost make -f Makefile test-clevis-loop-should-fail-ro...
🔇 Additional comments (21)
Cargo.toml (1)

298-298: Feature flag migration looks correct.

The dbus_enabled feature now correctly depends on dep:zbus, aligning with the dependency migration.

src/engine/mod.rs (1)

18-20: LGTM!

The addition of SomeLockReadGuard and SomeLockWriteGuard to the public exports correctly supports the new guard-based access patterns used in the D-Bus property setters and shared utilities across the PR.

src/dbus/filesystem/filesystem_3_7/props.rs (1)

1-37: LGTM!

The property handlers are well-structured:

  • origin_prop and merge_scheduled_prop follow established patterns for read-only props.
  • set_merge_scheduled_prop correctly returns zbus::Error (not zbus::fdo::Error) per PR requirements, and properly maps both NewValue and Identity outcomes to Ok(()).
src/dbus/filesystem/shared.rs (2)

13-30: LGTM!

The set_filesystem_prop helper correctly uses zbus::Error (not zbus::fdo::Error) for the return type, aligning with the PR requirement that property setters must return zbus::Error.


32-49: LGTM!

The filesystem_prop read helper appropriately uses zbus::fdo::Error for property getters, which is the standard D-Bus FDO error type for read operations. The implementation correctly handles both missing pool and missing filesystem cases.

src/dbus/filesystem/filesystem_3_0/methods.rs (1)

13-49: Implementation follows established patterns.

The set_name_method function correctly handles all RenameAction variants and follows the codebase's D-Bus method return tuple convention ((result), error_code, message). The FIXME comment at line 36 for signal emission is noted as intentional deferred work.

src/dbus/blockdev/blockdev_3_3/props.rs (2)

12-17: LGTM!

The new_physical_size_prop correctly uses option_to_tuple to handle the optional size value, converting bytes to string representation.


19-39: LGTM!

The set_user_info_prop implementation:

  • Correctly returns zbus::Error per PR requirements for property setters.
  • Implements an identity check optimization to avoid unnecessary pool mutations when the value is unchanged.
  • Properly handles the error cases for missing blockdev and pool operation failures.
src/dbus/filesystem/filesystem_3_5/mod.rs (2)

30-75: LGTM!

The FilesystemR5 struct and its lifecycle methods (register/unregister) follow the established pattern for D-Bus interface registration. The registration returning an error is appropriate at this level—the "don't fail rapidly" concern from PR comments applies to higher-level orchestration that calls multiple interface registrations.


78-121: LGTM!

The D-Bus interface implementation correctly:

  • Exposes the org.storage.stratis3.filesystem.r5 interface.
  • Delegates property accessors to shared helpers from filesystem_3_0.
  • Uses appropriate emits_changed_signal annotations for properties (const for immutable, invalidates for devnode, default for mutable).
  • Returns zbus::fdo::Error for property getters, which is the correct error type for read operations.
src/dbus/blockdev/blockdev_3_4/mod.rs (1)

31-77: BlockdevR4 D-Bus surface and helpers look consistent and correct

Struct layout, register/unregister, and all properties cleanly delegate via blockdev_prop/set_blockdev_prop and shared props; error types and emits_changed_signal flags match the patterns used in neighboring revisions.

Also applies to: 79-168

src/dbus/filesystem/filesystem_3_9/mod.rs (1)

32-77: FilesystemR9 wiring matches prior revisions and uses the correct error types

Constructor, register/unregister, and all properties/mutators follow the established filesystem patterns; delegation through filesystem_prop/set_filesystem_prop and use of Result<(), zbus::Error> for setters look correct.

Also applies to: 80-169

src/dbus/blockdev/blockdev_3_9/mod.rs (1)

31-77: BlockdevR9 implementation is consistent with other blockdev revisions

Struct fields, registration helpers, and property/setter wiring mirror R0/R2/R3/R4 and correctly reuse blockdev_prop, set_blockdev_prop, and the shared prop functions; no issues stand out.

Also applies to: 79-168

src/dbus/blockdev/blockdev_3_0/mod.rs (1)

21-76: BlockdevR0 base interface and helpers look solid

Exports, constructor, register/unregister, and property implementations are coherent and form a good base for the higher blockdev revisions; usage of blockdev_prop and pool_prop is consistent and correct.

Also applies to: 78-149

src/dbus/filesystem/filesystem_3_8/mod.rs (1)

32-77: FilesystemR8 D-Bus interface aligns with existing patterns

FilesystemR8’s struct, lifecycle helpers, and properties/mutators all delegate via filesystem_prop/set_filesystem_prop and shared props; signal semantics and error types match those used in other filesystem revisions.

Also applies to: 80-169

src/dbus/blockdev/blockdev_3_3/mod.rs (1)

34-80: BlockdevR3 registration and property wiring look correct

The struct, constructor, register/unregister, and all properties (including new_physical_size) correctly reuse blockdev_prop/set_blockdev_prop and the shared prop helpers; setter error typing via zbus::Error is appropriate.

Also applies to: 82-171

src/dbus/blockdev/blockdev_3_2/mod.rs (1)

26-72: BlockdevR2 is well-aligned with the R0 baseline and UserInfo semantics

Register/unregister and all properties look correct and consistent with BlockdevR0; notably, user_info is explicitly marked emits_changed_signal = "false", which provides a clear baseline for later revisions.

Also applies to: 74-145

src/dbus/filesystem/filesystem_3_2/mod.rs (1)

30-76: FilesystemR2 interface is minimal but correctly wired

FilesystemR2’s constructor, lifecycle helpers, and properties correctly reuse filesystem_prop/pool_prop and shared props; signal semantics and types are consistent with later filesystem revisions.

Also applies to: 78-122

src/dbus/blockdev/blockdev_3_7/mod.rs (2)

80-169: BlockdevR7 D‑Bus surface and error types look consistent.

Property getters cleanly delegate to the shared blockdev_prop/*_prop helpers using zbus::fdo::Error, and set_user_info uses Result<(), zbus::Error> as required. Attributes (emits_changed_signal values, constant vs mutable props) align with existing blockdev revisions, so this interface wiring looks good.


32-77: Verify that blockdev registration orchestration continues on individual interface failures.

BlockdevR7::register and unregister correctly wrap the zbus object server calls and surface StratisResult<()>. However, whether registration continues when one interface fails depends on the callers. Review the higher-level registration code to confirm that it logs individual failures from these methods and proceeds with other blockdevices, rather than stopping on the first error via chained ? operators.

Similar filesystem registration logic in pool methods intentionally logs warnings and continues processing remaining filesystems when individual registrations fail, allowing the overall operation to succeed even if some interfaces aren't visible on D-Bus. Blockdev registration should follow the same pattern.

src/dbus/blockdev/blockdev_3_5/mod.rs (1)

31-77: Registration wrapper matches other revisions; confirm that call sites handle errors per-interface.

BlockdevR5::register and unregister correctly return StratisResult<()>, allowing the orchestrator to decide error handling. Please verify that their call sites log registration failures and continue processing remaining devices rather than aborting the entire registration sequence.

Comment on lines +233 to +242
[dependencies.zbus]
version = "5.12.0"
optional = true
git = "https://github.com/mulkieran/zbus.git"
branch = "sort-introspect-by-interface-name"
features = ["tokio"]

[dependencies.zvariant]
git = "https://github.com/mulkieran/zbus.git"
branch = "sort-introspect-by-interface-name"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n Cargo.toml | sed -n '230,245p'

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

# Search for any comments or documentation about the git branch
rg "sort-introspect-by-interface-name" --type toml -B2 -A2

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

# Check if there are any issues or PRs mentioned related to zbus/introspection
rg -i "introspect|zbus.*branch|custom.*git" --type md --type txt

Repository: stratis-storage/stratisd

Length of output: 192


🏁 Script executed:

# Look for ADRs or documentation files
fd -e md -e txt | grep -iE "(adr|decision|doc|readme)" | head -20

Repository: stratis-storage/stratisd

Length of output: 192


🌐 Web query:

zbus "sort-introspect-by-interface-name" branch

💡 Result:

Do you mean a specific Git branch named "sort-introspect-by-interface-name" in the zbus repo? If so, which remote (dbus2/zbus, dbus2/zbus fork, or your fork) — or would you like me to search public GitHub repos for that branch and return any matches?


🌐 Web query:

zbus 5.12.0 release introspection sorting

💡 Result:

I couldn't find any explicit note about an "introspection sorting" change in the zbus 5.12.0 release notes or changelog. I did confirm zbus 5.12.0 is published (docs.rs/crates and packaging). Would you like me to:

  • search the zbus GitHub issues/PRs for introspection/sorting changes (I can dig deeper there), or
  • look through the crate source (introspection code) for any sorting-related commits included in 5.12.0?

References: docs.rs listing for zbus 5.12.0 [1], Debian package entry for rust-zbus 5.12.0 [2].

[1] https://docs.rs/crate/zbus/5.12.0
[2] https://launchpad.net/debian/+source/rust-zbus/+changelog


🌐 Web query:

zbus mulkieran fork introspection

💡 Result:

I couldn't find a public "mulkieran" fork of zbus or anything linking that username with "introspection." Do you mean a GitHub user/org (e.g., "mulkieran") or a different spelling? If you want, I can search GitHub and web for that fork and whether it adds/changes zbus introspection — should I proceed (and do you have the exact repo/user name)?


Use released crate versions instead of custom git branches for production code.

The zbus and zvariant dependencies are sourced from a custom git branch (sort-introspect-by-interface-name) instead of stable released versions. zbus 5.12.0 is available as an official release, but the code uses a custom fork instead. This approach:

  • Reduces reproducibility and build determinism
  • Increases maintenance burden and risk if the branch becomes unavailable
  • Complicates dependency auditing and security updates
  • Creates divergence from the upstream project without documented justification

Additionally, zvariant is missing an explicit version constraint.

Please address:

  1. Why is a custom git branch necessary when zbus 5.12.0 is publicly available? If specific functionality is needed, upstream the changes to zbus or document the justification in the repository.
  2. Specify an explicit version for zvariant (e.g., version = "4.x.y").
🤖 Prompt for AI Agents
In Cargo.toml around lines 233 to 242, the zbus and zvariant dependencies point
to a custom git branch which reduces reproducibility and lacks an explicit
zvariant version; replace the git/branch entries with released crate versions
(use version = "5.12.0" for zbus and set an explicit compatible version for
zvariant, e.g., version = "4.x.y"), remove the git and branch keys, and if the
custom branch is truly required either upstream the changes or add a clear
justification and migration plan in the repository docs explaining why the git
branch is necessary and how long it will be maintained.

counter.fetch_add(1, Ordering::AcqRel),
))?;

manager.write().await.add_filesystem(&path, uuid)?;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Manager state update before registrations creates inconsistent state on failure.

Line 56 updates the Manager (adding the filesystem) before attempting any interface registrations. If any subsequent registration fails (e.g., FilesystemR5 on line 103), the function returns an error via ?, leaving the Manager with a filesystem entry that has only partially registered D-Bus interfaces. This creates an inconsistent state where the Manager believes the filesystem is fully registered, but the D-Bus object server has incomplete interface coverage.

In contrast, blockdev/mod.rs updates the Manager after all registrations succeed (line 146), which is safer.

Move the Manager update to occur after all registrations:

     let path = ObjectPath::try_from(format!(
         "{}/{}",
         consts::STRATIS_BASE_PATH,
         counter.fetch_add(1, Ordering::AcqRel),
     ))?;
 
-    manager.write().await.add_filesystem(&path, uuid)?;
-
     FilesystemR0::register(
         engine.clone(),
         connection,
         manager,
         path.clone(),
         pool_uuid,
         uuid,
     )
     .await?;
     // ... (remaining registrations)
     FilesystemR9::register(
         engine.clone(),
         connection,
         manager,
         path.clone(),
         pool_uuid,
         uuid,
     )
     .await?;
+
+    manager.write().await.add_filesystem(&path, uuid)?;
 
     Ok(path)

Committable suggestion skipped: line range outside the PR's diff.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants