Skip to content

compat (errno): Adds cross-platform compatibility for errno values.#3311

Closed
bgoing-micron-oss wants to merge 2 commits into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/errno-compatibility
Closed

compat (errno): Adds cross-platform compatibility for errno values.#3311
bgoing-micron-oss wants to merge 2 commits into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/errno-compatibility

Conversation

@bgoing-micron-oss
Copy link
Copy Markdown
Contributor

Some errno values used in the code are only available on Linux. Adds compatible handling of errno values not available on all platforms.

  • Substitutes good equivalent errno value for unsupported values used by nvme/util.c when converting status to errno.
  • Replaces ENAVAIL usage in nvme.c with a local error code. It is only used internally within nvme.c to signal that an "invalid field" error was returned and should be ignored.

Comment thread nvme.c Outdated
* Since the error returned by drives unsupported.
*/
return -ENAVAIL;
return ERR_IGNORE_INVALID_FIELD;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not returning NVME_SC_INVALID_FIELD. This avoids introducing a new define and matches the existing return pattern. Negative values for internal errors (userland/kernel) and positive values for the protocol level status info.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea.

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented May 13, 2026

Could you also split these two changes into two patches? Thanks!

Some errno values used in the code are only available on Linux.
Substitutes good equivalent errno value for unsupported values used
by nvme/util.c when converting status to errno.

Signed-off-by: Broc Going <bgoing@micron.com>
Replaces non-portable ENAVAIL usage in nvme.c with
NVME_SC_INVALID_FIELD.

Signed-off-by: Broc Going <bgoing@micron.com>
@bgoing-micron-oss bgoing-micron-oss force-pushed the bgoing/errno-compatibility branch from 35f293b to c03da86 Compare May 13, 2026 16:36
@bgoing-micron-oss
Copy link
Copy Markdown
Contributor Author

bgoing-micron-oss commented May 13, 2026

Could you also split these two changes into two patches? Thanks!

@igaw I have split the changes. Would you like them in separate pull requests, or will this work?

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented May 13, 2026

No need for separate PRs. Just a sec

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented May 13, 2026

i've tweaked the commit message slightly. The subject prefix is used to 'point' to the file which is edited. I know this is different to the usage in different context but let's stick to what we have so far. Since I can't push these changes back to this branch I merged them directly.

@igaw igaw closed this May 13, 2026
@igaw
Copy link
Copy Markdown
Collaborator

igaw commented May 13, 2026

Thanks!

@bgoing-micron-oss bgoing-micron-oss deleted the bgoing/errno-compatibility branch May 13, 2026 17:39
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