summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-03-22 18:08:55 -0700
committerGitHub <[email protected]>2017-03-22 18:08:55 -0700
commit56a6054d553fd7f1cf7d7c86bf4b33951e1d009f (patch)
tree33b2b34135d17657627af099793c520c86756283 /cmd
parent6a9d6359982cbff298dd17f68c3103d1269602fa (diff)
Fix `zpool status -v` error message
When a pool is suspended it's impossible to read the list of damaged files from disk. This would result in a generic misleading "insufficient permissions" error message. Update zpool_get_errlog() to use the standard zpool error logging functions to generate a useful error message. In this case: errors: List of errors unavailable: pool I/O is currently suspended This patch does not address the related issue of potentially not being able to resume a suspend pool when the underlying device names have changed. Additionally, remove the error handling from zfs_alloc() in zpool_get_errlog() for readability since this function can never fail. Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4031 Closes #5731 Closes #5907
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zpool/zpool_main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index da6744b76..b984f5583 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -5603,11 +5603,8 @@ print_error_log(zpool_handle_t *zhp)
char *pathname;
size_t len = MAXPATHLEN * 2;
- if (zpool_get_errlog(zhp, &nverrlist) != 0) {
- (void) printf("errors: List of errors unavailable "
- "(insufficient privileges)\n");
+ if (zpool_get_errlog(zhp, &nverrlist) != 0)
return;
- }
(void) printf("errors: Permanent errors have been "
"detected in the following files:\n\n");