Skip to content

dm: Check dm_task_run return value in bd_dm_map_exists - #1214

Merged
vojtechtrefny merged 1 commit into
storaged-project:masterfrom
vojtechtrefny:master_dm-map-exists-segfault
Oct 15, 2026
Merged

vojtechtrefny merged 1 commit into
storaged-project:masterfrom
vojtechtrefny:master_dm-map-exists-segfault

Conversation

@vojtechtrefny

@vojtechtrefny vojtechtrefny commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Map availability checks now report an error when the underlying lookup fails, rather than continuing with incomplete results. This makes failed checks behave more reliably and prevents them from being mistaken for successful lookups.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: storaged-project/libblockdev/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7cf2e08-d15d-4554-bcdd-6240a7cd428f
📥 Commits

Reviewing files that changed from the base of the PR and between fc8cfc5 and d6ae21e.

📒 Files selected for processing: 1
  • src/plugins/dm.c

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

bd_dm_map_exists now checks whether the map-list task ran successfully. On failure, it sets a task error, destroys the task, and returns FALSE.

Changes: Device Mapper map check

Layer / File(s) Summary
Handle map-list task failure
src/plugins/dm.c
bd_dm_map_exists now handles a failed dm_task_run call before retrieving map names. It sets a task error, destroys the task, and returns FALSE.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Merge Risk: ⚪ Minimal · up to d6ae2

The map check now reports a failed Device Mapper task instead of continuing as though the task succeeded. No actionable merge risk is established; the change is ready for normal checks.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: checking the return value of dm_task_run in bd_dm_map_exists.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@tbzatek tbzatek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

heh

@vojtechtrefny
vojtechtrefny merged commit 3c5433a into storaged-project:master Oct 15, 2026
54 checks passed
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