@@ -3109,6 +3109,7 @@ spa_load(spa_t *spa, spa_load_state_t state, spa_import_type_t type)
3109
3109
spa -> spa_load_state = state ;
3110
3110
(void ) spa_import_progress_set_state (spa_guid (spa ),
3111
3111
spa_load_state (spa ));
3112
+ spa_import_progress_set_notes (spa_guid (spa ), "spa_load()" );
3112
3113
3113
3114
gethrestime (& spa -> spa_loaded_ts );
3114
3115
error = spa_load_impl (spa , type , & ereport );
@@ -4995,6 +4996,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
4995
4996
/*
4996
4997
* Retrieve the checkpoint txg if the pool has a checkpoint.
4997
4998
*/
4999
+ spa_import_progress_set_notes (spa_guid (spa ), "Loading checkpoint txg" );
4998
5000
error = spa_ld_read_checkpoint_txg (spa );
4999
5001
if (error != 0 )
5000
5002
return (error );
@@ -5007,6 +5009,8 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5007
5009
* initiated. Otherwise we could be reading from indirect vdevs before
5008
5010
* we have loaded their mappings.
5009
5011
*/
5012
+ spa_import_progress_set_notes (spa_guid (spa ),
5013
+ "Loading indirect vdev metadata" );
5010
5014
error = spa_ld_open_indirect_vdev_metadata (spa );
5011
5015
if (error != 0 )
5012
5016
return (error );
@@ -5015,6 +5019,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5015
5019
* Retrieve the full list of active features from the MOS and check if
5016
5020
* they are all supported.
5017
5021
*/
5022
+ spa_import_progress_set_notes (spa_guid (spa ), "Checking feature flags" );
5018
5023
error = spa_ld_check_features (spa , & missing_feat_write );
5019
5024
if (error != 0 )
5020
5025
return (error );
@@ -5023,13 +5028,16 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5023
5028
* Load several special directories from the MOS needed by the dsl_pool
5024
5029
* layer.
5025
5030
*/
5031
+ spa_import_progress_set_notes (spa_guid (spa ),
5032
+ "Loading special MOS directories" );
5026
5033
error = spa_ld_load_special_directories (spa );
5027
5034
if (error != 0 )
5028
5035
return (error );
5029
5036
5030
5037
/*
5031
5038
* Retrieve pool properties from the MOS.
5032
5039
*/
5040
+ spa_import_progress_set_notes (spa_guid (spa ), "Loading properties" );
5033
5041
error = spa_ld_get_props (spa );
5034
5042
if (error != 0 )
5035
5043
return (error );
@@ -5038,6 +5046,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5038
5046
* Retrieve the list of auxiliary devices - cache devices and spares -
5039
5047
* and open them.
5040
5048
*/
5049
+ spa_import_progress_set_notes (spa_guid (spa ), "Loading AUX vdevs" );
5041
5050
error = spa_ld_open_aux_vdevs (spa , type );
5042
5051
if (error != 0 )
5043
5052
return (error );
@@ -5046,14 +5055,17 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5046
5055
* Load the metadata for all vdevs. Also check if unopenable devices
5047
5056
* should be autoreplaced.
5048
5057
*/
5058
+ spa_import_progress_set_notes (spa_guid (spa ), "Loading vdev metadata" );
5049
5059
error = spa_ld_load_vdev_metadata (spa );
5050
5060
if (error != 0 )
5051
5061
return (error );
5052
5062
5063
+ spa_import_progress_set_notes (spa_guid (spa ), "Loading dedup tables" );
5053
5064
error = spa_ld_load_dedup_tables (spa );
5054
5065
if (error != 0 )
5055
5066
return (error );
5056
5067
5068
+ spa_import_progress_set_notes (spa_guid (spa ), "Loading BRT" );
5057
5069
error = spa_ld_load_brt (spa );
5058
5070
if (error != 0 )
5059
5071
return (error );
@@ -5062,6 +5074,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5062
5074
* Verify the logs now to make sure we don't have any unexpected errors
5063
5075
* when we claim log blocks later.
5064
5076
*/
5077
+ spa_import_progress_set_notes (spa_guid (spa ), "Verifying Log Devices" );
5065
5078
error = spa_ld_verify_logs (spa , type , ereport );
5066
5079
if (error != 0 )
5067
5080
return (error );
@@ -5083,6 +5096,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5083
5096
* state. When performing an extreme rewind, we verify the whole pool,
5084
5097
* which can take a very long time.
5085
5098
*/
5099
+ spa_import_progress_set_notes (spa_guid (spa ), "Verifying pool data" );
5086
5100
error = spa_ld_verify_pool_data (spa );
5087
5101
if (error != 0 )
5088
5102
return (error );
@@ -5092,13 +5106,16 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5092
5106
* we write anything to the pool because we'd need to update the space
5093
5107
* accounting using the deflated sizes.
5094
5108
*/
5109
+ spa_import_progress_set_notes (spa_guid (spa ),
5110
+ "Calculating deflated space" );
5095
5111
spa_update_dspace (spa );
5096
5112
5097
5113
/*
5098
5114
* We have now retrieved all the information we needed to open the
5099
5115
* pool. If we are importing the pool in read-write mode, a few
5100
5116
* additional steps must be performed to finish the import.
5101
5117
*/
5118
+ spa_import_progress_set_notes (spa_guid (spa ), "Starting import" );
5102
5119
if (spa_writeable (spa ) && (spa -> spa_load_state == SPA_LOAD_RECOVER ||
5103
5120
spa -> spa_load_max_txg == UINT64_MAX )) {
5104
5121
uint64_t config_cache_txg = spa -> spa_config_txg ;
@@ -5122,6 +5139,8 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5122
5139
(u_longlong_t )spa -> spa_uberblock .ub_checkpoint_txg );
5123
5140
}
5124
5141
5142
+ spa_import_progress_set_notes (spa_guid (spa ),
5143
+ "Claiming ZIL blocks" );
5125
5144
/*
5126
5145
* Traverse the ZIL and claim all blocks.
5127
5146
*/
@@ -5141,13 +5160,17 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5141
5160
* will have been set for us by ZIL traversal operations
5142
5161
* performed above.
5143
5162
*/
5163
+ spa_import_progress_set_notes (spa_guid (spa ),
5164
+ "Syncing ZIL claims" );
5144
5165
txg_wait_synced (spa -> spa_dsl_pool , spa -> spa_claim_max_txg );
5145
5166
5146
5167
/*
5147
5168
* Check if we need to request an update of the config. On the
5148
5169
* next sync, we would update the config stored in vdev labels
5149
5170
* and the cachefile (by default /etc/zfs/zpool.cache).
5150
5171
*/
5172
+ spa_import_progress_set_notes (spa_guid (spa ),
5173
+ "Updating configs" );
5151
5174
spa_ld_check_for_config_update (spa , config_cache_txg ,
5152
5175
update_config_cache );
5153
5176
@@ -5156,6 +5179,8 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5156
5179
* Then check all DTLs to see if anything needs resilvering.
5157
5180
* The resilver will be deferred if a rebuild was started.
5158
5181
*/
5182
+ spa_import_progress_set_notes (spa_guid (spa ),
5183
+ "Starting resilvers" );
5159
5184
if (vdev_rebuild_active (spa -> spa_root_vdev )) {
5160
5185
vdev_rebuild_restart (spa );
5161
5186
} else if (!dsl_scan_resilvering (spa -> spa_dsl_pool ) &&
@@ -5169,6 +5194,8 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5169
5194
*/
5170
5195
spa_history_log_version (spa , "open" , NULL );
5171
5196
5197
+ spa_import_progress_set_notes (spa_guid (spa ),
5198
+ "Restarting device removals" );
5172
5199
spa_restart_removal (spa );
5173
5200
spa_spawn_aux_threads (spa );
5174
5201
@@ -5181,19 +5208,29 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5181
5208
* auxiliary threads above (from which the livelist
5182
5209
* deletion zthr is part of).
5183
5210
*/
5211
+ spa_import_progress_set_notes (spa_guid (spa ),
5212
+ "Cleaning up inconsistent objsets" );
5184
5213
(void ) dmu_objset_find (spa_name (spa ),
5185
5214
dsl_destroy_inconsistent , NULL , DS_FIND_CHILDREN );
5186
5215
5187
5216
/*
5188
5217
* Clean up any stale temporary dataset userrefs.
5189
5218
*/
5219
+ spa_import_progress_set_notes (spa_guid (spa ),
5220
+ "Cleaning up temporary uerrefs" );
5190
5221
dsl_pool_clean_tmp_userrefs (spa -> spa_dsl_pool );
5191
5222
5192
5223
spa_config_enter (spa , SCL_CONFIG , FTAG , RW_READER );
5224
+ spa_import_progress_set_notes (spa_guid (spa ),
5225
+ "Restarting Initialize" );
5193
5226
vdev_initialize_restart (spa -> spa_root_vdev );
5227
+ spa_import_progress_set_notes (spa_guid (spa ),
5228
+ "Restarting TRIM" );
5194
5229
vdev_trim_restart (spa -> spa_root_vdev );
5195
5230
vdev_autotrim_restart (spa );
5196
5231
spa_config_exit (spa , SCL_CONFIG , FTAG );
5232
+ spa_import_progress_set_notes (spa_guid (spa ),
5233
+ "Finished importing" );
5197
5234
}
5198
5235
5199
5236
spa_import_progress_remove (spa_guid (spa ));
0 commit comments