diff --git a/include/sys/dsl_dir.h b/include/sys/dsl_dir.h index 384f98e8f..f7c0d9acd 100644 --- a/include/sys/dsl_dir.h +++ b/include/sys/dsl_dir.h @@ -116,7 +116,7 @@ struct dsl_dir { /* gross estimate of space used by in-flight tx's */ uint64_t dd_tempreserved[TXG_SIZE]; /* amount of space we expect to write; == amount of dirty data */ - int64_t dd_space_towrite[TXG_SIZE]; + uint64_t dd_space_towrite[TXG_SIZE]; dsl_deadlist_t dd_livelist; bplist_t dd_pending_frees; diff --git a/module/zfs/dsl_dir.c b/module/zfs/dsl_dir.c index c1afaa6aa..18142cef9 100644 --- a/module/zfs/dsl_dir.c +++ b/module/zfs/dsl_dir.c @@ -1186,10 +1186,9 @@ dsl_dir_space_towrite(dsl_dir_t *dd) ASSERT(MUTEX_HELD(&dd->dd_lock)); - for (int i = 0; i < TXG_SIZE; i++) { + for (int i = 0; i < TXG_SIZE; i++) space += dd->dd_space_towrite[i & TXG_MASK]; - ASSERT3U(dd->dd_space_towrite[i & TXG_MASK], >=, 0); - } + return (space); }