coreos / coreos/ignition

Report errno from libblkid code

Open
#906 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
974
Forks
296
Avg merge
6d 14h
Merged PRs (30d)
9

Description

Right now, we're translating libblkid errors into generic codes like RESULT_OPEN_FAILED. But this doesn't capture why the operation failed. We should report the actual errno value too to make debugging easier.

Looking at the code, we're just translating that into an error string anyway, so it doesn't seem like we actually need to handle specific failure types differently. Because one cannot reliably access errno from Golang, one suggestion is to just do the error prefixing on the C side (this is what https://github.com/coreos/ignition/pull/846 did when it used the SELinux API directly before switching to setfiles: https://github.com/coreos/ignition/compare/d8772fbc6a61a4ddf9b47ff90feeaa12d0d38e34..af996492e367bebc0ddf0bc4e5f8d5cbf9749623#diff-e4e61a4b3c86fbfe43c406733947227dL77).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in internal/exec/util/blkid.go around the linked translation at line 80, then review the linked SELinux-related change for the suggested C-side error prefixing approach. Confirm how libblkid failures are converted to error strings and define done as preserving the generic result while including the actual errno in the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, go
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.