Skip to content

Commit

Permalink
Apply a few spa_writeable() changes that were made to Illumos in
Browse files Browse the repository at this point in the history
illumos/illumos-gate.git@cd1c8b8 as part of the 3112, 3113,
3114 and 3115 fixes.

Add a missing call to fnvlist_free(nvl) in log_internal() that
was added in Illumos to fix issue 3085 but couldn't be ported
to ZoL at the time (openzfs/zfs@9e11c73) because it depended
on future work.
  • Loading branch information
dweeezil committed Jul 19, 2013
1 parent fb11dc1 commit aa2bc8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions module/zfs/dsl_synctask.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ dsl_sync_task_do_nowait(dsl_pool_t *dp,
{
dsl_sync_task_group_t *dstg;

if (!spa_writeable(dp->dp_spa))
return;

dstg = dsl_sync_task_group_create(dp);
dsl_sync_task_create(dstg, checkfunc, syncfunc,
arg1, arg2, blocks_modified);
Expand Down
7 changes: 5 additions & 2 deletions module/zfs/spa_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ spa_history_log_nvl(spa_t *spa, nvlist_t *nvl)
dmu_tx_t *tx;
nvlist_t *nvarg;

if (spa_version(spa) < SPA_VERSION_ZPOOL_HISTORY)
if (spa_version(spa) < SPA_VERSION_ZPOOL_HISTORY || !spa_writeable(spa))
return (EINVAL);

tx = dmu_tx_create_dd(spa_get_dsl(spa)->dp_mos_dir);
Expand Down Expand Up @@ -442,9 +442,12 @@ log_internal(nvlist_t *nvl, const char *operation, spa_t *spa,
/*
* If this is part of creating a pool, not everything is
* initialized yet, so don't bother logging the internal events.
* Likewise if the pool is not writeable.
*/
if (tx->tx_txg == TXG_INITIAL)
if (tx->tx_txg == TXG_INITIAL || !spa_writeable(spa)) {
fnvlist_free(nvl);
return;
}

va_copy(adx1, adx);
msg = kmem_alloc(vsnprintf(NULL, 0, fmt, adx1) + 1, KM_PUSHPAGE);
Expand Down

0 comments on commit aa2bc8c

Please sign in to comment.