Fix possible pool hold leak in dmu_send_impl()

Problem reported to vendor:
  https://www.illumos.org/issues/3645

Reported by:	Andriy Gapon <avg@FreeBSD.org>
MFC after:	15 days
This commit is contained in:
Martin Matuska 2013-04-03 09:52:30 +00:00
parent c1ebf400c3
commit 03863a70e1

View File

@ -500,14 +500,14 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *ds,
list_insert_head(&ds->ds_sendstreams, dsp);
mutex_exit(&ds->ds_sendstream_lock);
dsl_dataset_long_hold(ds, FTAG);
dsl_pool_rele(dp, tag);
if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0) {
err = dsp->dsa_err;
goto out;
}
dsl_dataset_long_hold(ds, FTAG);
dsl_pool_rele(dp, tag);
err = traverse_dataset(ds, fromtxg, TRAVERSE_PRE | TRAVERSE_PREFETCH,
backup_cb, dsp);