Skip to content

zed: Print return code on failed zpool_prepare_disk #17124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

tonyhutter
Copy link
Contributor

Motivation and Context

Better zed error logging

Description

We had a case where we were autoreplacing a disk and zpool_prepare_disk failed for some reason, and ZED didn't log the return code. This commit logs the code.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

We had a case where we were autoreplacing a disk and
zpool_prepare_disk failed for some reason, and ZED
didn't log the return code.  This commit logs the code.

Signed-off-by: Tony Hutter <[email protected]>
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

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

Seeing that in some cases we return errno codes there I was thinking if we could report strings there, as done in some other messages. But at least libzfs_run_process_get_stdout() seem to return all kinds of a mess.

@amotin amotin added the Status: Accepted Ready to integrate (reviewed, tested) label Mar 10, 2025
@amotin amotin merged commit 62a9d37 into openzfs:master Mar 12, 2025
34 of 41 checks passed
tonyhutter added a commit to tonyhutter/zfs that referenced this pull request Apr 3, 2025
We had a case where we were autoreplacing a disk and
zpool_prepare_disk failed for some reason, and ZED
didn't log the return code.  This commit logs the code.

Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes openzfs#17124
fuporovvStack pushed a commit to fuporovvStack/zfs that referenced this pull request Apr 11, 2025
We had a case where we were autoreplacing a disk and
zpool_prepare_disk failed for some reason, and ZED
didn't log the return code.  This commit logs the code.

Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes openzfs#17124
fuporovvStack pushed a commit to fuporovvStack/zfs that referenced this pull request Apr 11, 2025
We had a case where we were autoreplacing a disk and
zpool_prepare_disk failed for some reason, and ZED
didn't log the return code.  This commit logs the code.

Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes openzfs#17124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants