Skip to content
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

logapi: cat output file instead of printing #11515

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -6236,6 +6236,7 @@ static int
spa_export_common(const char *pool, int new_state, nvlist_t **oldconfig,
boolean_t force, boolean_t hardforce)
{
int error;
spa_t *spa;

if (oldconfig)
Expand Down Expand Up @@ -6288,13 +6289,9 @@ spa_export_common(const char *pool, int new_state, nvlist_t **oldconfig,
* references. If we are resetting a pool, allow references by
* fault injection handlers.
*/
if (!spa_refcount_zero(spa) ||
(spa->spa_inject_ref != 0 &&
new_state != POOL_STATE_UNINITIALIZED)) {
spa_async_resume(spa);
spa->spa_is_exporting = B_FALSE;
mutex_exit(&spa_namespace_lock);
return (SET_ERROR(EBUSY));
if (!spa_refcount_zero(spa) || (spa->spa_inject_ref != 0)) {
error = SET_ERROR(EBUSY);
goto fail;
}

if (spa->spa_sync_on) {
Expand All @@ -6306,10 +6303,8 @@ spa_export_common(const char *pool, int new_state, nvlist_t **oldconfig,
*/
if (!force && new_state == POOL_STATE_EXPORTED &&
spa_has_active_shared_spare(spa)) {
spa_async_resume(spa);
spa->spa_is_exporting = B_FALSE;
mutex_exit(&spa_namespace_lock);
return (SET_ERROR(EXDEV));
error = SET_ERROR(EXDEV);
goto fail;
}

/*
Expand Down Expand Up @@ -6371,6 +6366,12 @@ spa_export_common(const char *pool, int new_state, nvlist_t **oldconfig,

mutex_exit(&spa_namespace_lock);
return (0);

fail:
spa->spa_is_exporting = B_FALSE;
spa_async_resume(spa);
mutex_exit(&spa_namespace_lock);
return (error);
}

/*
Expand Down
6 changes: 3 additions & 3 deletions tests/test-runner/include/logapi.shlib
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function log_must_retry
" assertion failure exited $status"
status=1
else
[[ -n $LOGAPI_DEBUG ]] && print $($out)
[[ -n $LOGAPI_DEBUG ]] && cat $logfile
_printsuccess "$@"
fi
break
Expand Down Expand Up @@ -244,7 +244,7 @@ function log_neg_expect
fi

if (( $ret == 0 )); then
[[ -n $LOGAPI_DEBUG ]] && print $($out)
[[ -n $LOGAPI_DEBUG ]] && cat $logfile
_printsuccess "$@" "exited $status"
fi
fi
Expand Down Expand Up @@ -284,7 +284,7 @@ function log_pos
" exited $status"
status=1
else
[[ -n $LOGAPI_DEBUG ]] && print $($out)
[[ -n $LOGAPI_DEBUG ]] && cat $logfile
_printsuccess "$@"
fi
fi
Expand Down