87e6ffb752
rf_DecrAccessesCountState wasn't in the correct spot in RF_AccessState_e. Following up on that has resulted in one other correction. Changing orderings of these states is tricky, and shouldn't be attempted without some thorough analysis. For the changes committed, the following analysis is offerred: 1) RAIDframe uses a little state machine to take care of building, executing, and processing the DAGs used to direct IO. 2) The rf_DecrAccessesCountState state is handled by the function rf_State_DecrAccessCount(). The purpose of this state is to decrement the number of "accesses-in-flight". 3) rf_Cleanup_State is handled by rf_State_Cleanup(). Its job is to do general cleanup of DAG arrays and any stripe locks. 4) DefaultStates[] in rf_layout.c indicates that the right spot for rf_DecrAccessesCountState is just before rf_Cleanup_State. Analysis of code for both states indicates that the order doesn't matter too much, although rf_State_DecrAccessCount() should probably take place *after* rf_State_Cleanup() to be more correct. 5) Comments in rf_State_ProcessDAG() indicates that the next state should be rf_Cleanup_State. However: it attempts to get there by using desc->state++; which actually takes it to just rf_DecrAccessesCountState! This turned out to be OK before, since rf_Cleanup_State would follow right after, and all would be taken careof (albeit in arguably the "less correct" order). 6) With the current ordering, if we head directly to rf_Cleanup_State (as we do, for example, if multiple components fail in a RAID 5 set), then we'll actually miss going trough rf_DecrAccessesCountState), and could end up never being able to reach quiescence! Perhaps not too big of a deal, given that the RAID set is pretty much toast by that point at which such a drastic state change happens, but might as well have this correct. The changes made are: 1) Since having rf_State_DecrAccessCount() come after rf_State_Cleanup() is just fine, change rf_layout.c to reflect that rf_DecrAccessesCountState comes after rf_Cleanup_State (i.e. they swap positions in the state list). This means that going to rf_Cleanup_State after bailing on a failed DAG access will do all the right things -- the state will get cleaned up, and then the access counts will get decremented properly. The comment in rf_State_ProcessDAG() is now actually correct -- the next state *will* be rf_Cleanup_State. 2) Move rf_DecrAccessesCountState in RF_AccessState_e to just after rf_CleanupState. This puts RF_AccessState_e in sync with DefaultStates[]. Fortunately, these states are rarely referred to by name, and so this change ends up being mostly cosmetic -- it really only fixes cleanup behaviour for the recent "Failed to create a DAG" changes. |
||
---|---|---|
.. | ||
files.raidframe | ||
Makefile | ||
raidframeio.h | ||
raidframevar.h | ||
rf_acctrace.c | ||
rf_acctrace.h | ||
rf_alloclist.c | ||
rf_alloclist.h | ||
rf_archs.h | ||
rf_aselect.c | ||
rf_aselect.h | ||
rf_callback.c | ||
rf_callback.h | ||
rf_chaindecluster.c | ||
rf_chaindecluster.h | ||
rf_copyback.c | ||
rf_copyback.h | ||
rf_cvscan.c | ||
rf_cvscan.h | ||
rf_dag.h | ||
rf_dagdegrd.c | ||
rf_dagdegrd.h | ||
rf_dagdegwr.c | ||
rf_dagdegwr.h | ||
rf_dagffrd.c | ||
rf_dagffrd.h | ||
rf_dagffwr.c | ||
rf_dagffwr.h | ||
rf_dagflags.h | ||
rf_dagfuncs.c | ||
rf_dagfuncs.h | ||
rf_dagutils.c | ||
rf_dagutils.h | ||
rf_debugMem.c | ||
rf_debugMem.h | ||
rf_debugprint.c | ||
rf_debugprint.h | ||
rf_decluster.c | ||
rf_decluster.h | ||
rf_declusterPQ.c | ||
rf_declusterPQ.h | ||
rf_desc.h | ||
rf_diskqueue.c | ||
rf_diskqueue.h | ||
rf_disks.c | ||
rf_disks.h | ||
rf_driver.c | ||
rf_driver.h | ||
rf_engine.c | ||
rf_engine.h | ||
rf_etimer.h | ||
rf_evenodd_dagfuncs.c | ||
rf_evenodd_dagfuncs.h | ||
rf_evenodd_dags.c | ||
rf_evenodd_dags.h | ||
rf_evenodd.c | ||
rf_evenodd.h | ||
rf_fifo.c | ||
rf_fifo.h | ||
rf_general.h | ||
rf_geniq.c | ||
rf_hist.h | ||
rf_interdecluster.c | ||
rf_interdecluster.h | ||
rf_invertq.c | ||
rf_invertq.h | ||
rf_kintf.h | ||
rf_layout.c | ||
rf_layout.h | ||
rf_map.c | ||
rf_map.h | ||
rf_mcpair.c | ||
rf_mcpair.h | ||
rf_netbsd.h | ||
rf_netbsdkintf.c | ||
rf_nwayxor.c | ||
rf_nwayxor.h | ||
rf_options.c | ||
rf_options.h | ||
rf_optnames.h | ||
rf_paritylog.c | ||
rf_paritylog.h | ||
rf_paritylogDiskMgr.c | ||
rf_paritylogDiskMgr.h | ||
rf_paritylogging.c | ||
rf_paritylogging.h | ||
rf_parityloggingdags.c | ||
rf_parityloggingdags.h | ||
rf_parityscan.c | ||
rf_parityscan.h | ||
rf_pq.c | ||
rf_pq.h | ||
rf_pqdeg.c | ||
rf_pqdeg.h | ||
rf_pqdegdags.c | ||
rf_pqdegdags.h | ||
rf_psstatus.c | ||
rf_psstatus.h | ||
rf_raid0.c | ||
rf_raid0.h | ||
rf_raid1.c | ||
rf_raid1.h | ||
rf_raid4.c | ||
rf_raid4.h | ||
rf_raid5_rotatedspare.c | ||
rf_raid5_rotatedspare.h | ||
rf_raid5.c | ||
rf_raid5.h | ||
rf_raid.h | ||
rf_reconbuffer.c | ||
rf_reconbuffer.h | ||
rf_reconmap.c | ||
rf_reconmap.h | ||
rf_reconstruct.c | ||
rf_reconstruct.h | ||
rf_reconutil.c | ||
rf_reconutil.h | ||
rf_revent.c | ||
rf_revent.h | ||
rf_shutdown.c | ||
rf_shutdown.h | ||
rf_sstf.c | ||
rf_sstf.h | ||
rf_states.c | ||
rf_states.h | ||
rf_stripelocks.c | ||
rf_stripelocks.h | ||
rf_strutils.c | ||
rf_threadstuff.h | ||
rf_utils.c | ||
rf_utils.h |