Lines Matching full:recovery
518 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in __mddev_resume()
1413 /* active but not in sync implies recovery up to in super_90_validate()
1997 &mddev->recovery)) in super_1_validate()
2460 /* May as well allow recovery to be retried once */ in bind_rdev_to_array()
2656 * curr_resync_completed can only be used during recovery. in md_update_sb()
2663 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) && in md_update_sb()
2664 test_bit(MD_RECOVERY_RECOVER, &mddev->recovery) && in md_update_sb()
2665 !test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_update_sb()
2713 * then a recovery will happen and soon that array won't in md_update_sb()
2794 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in md_update_sb()
2832 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in add_bound_rdev()
2833 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in add_bound_rdev()
2979 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); in state_store()
3010 * check if recovery is needed. in state_store()
3016 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); in state_store()
3145 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); in slot_store()
3155 if (test_bit(MD_RECOVERY_RUNNING, &rdev->mddev->recovery)) in slot_store()
3239 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in new_offset_store()
3906 * - array is not engaged in resync/recovery/reshape in level_store()
3912 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || in level_store()
4287 if (mddev->pers && !test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) in resync_start_store()
4797 unsigned long recovery = mddev->recovery; in md_sync_action() local
4803 if (test_bit(MD_RECOVERY_FROZEN, &recovery)) in md_sync_action()
4817 if (!test_bit(MD_RECOVERY_RUNNING, &recovery) && in md_sync_action()
4818 !test_bit(MD_RECOVERY_NEEDED, &recovery)) in md_sync_action()
4821 if (test_bit(MD_RECOVERY_RESHAPE, &recovery) || in md_sync_action()
4825 if (test_bit(MD_RECOVERY_RECOVER, &recovery)) in md_sync_action()
4828 if (test_bit(MD_RECOVERY_SYNC, &recovery)) { in md_sync_action()
4833 if (test_bit(MD_RECOVERY_CHECK, &recovery)) in md_sync_action()
4835 if (test_bit(MD_RECOVERY_REQUESTED, &recovery)) in md_sync_action()
4883 if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in stop_sync_thread()
4891 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in stop_sync_thread()
4901 !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || in stop_sync_thread()
4902 (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery) && in stop_sync_thread()
4913 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_idle_sync_thread()
4922 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_frozen_sync_thread()
4931 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_unfrozen_sync_thread()
4932 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_unfrozen_sync_thread()
4948 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in mddev_start_reshape()
4958 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in mddev_start_reshape()
4990 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in action_store()
5013 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
5017 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
5023 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
5024 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in action_store()
5027 set_bit(MD_RECOVERY_CHECK, &mddev->recovery); in action_store()
5030 set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in action_store()
5031 set_bit(MD_RECOVERY_SYNC, &mddev->recovery); in action_store()
5035 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
5051 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in action_store()
5198 if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in sync_completed_show()
5205 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) || in sync_completed_show()
5206 test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) in sync_completed_show()
5239 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in min_sync_store()
5282 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in max_sync_store()
6153 mddev->recovery = 0; in md_run()
6235 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_run()
6236 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_run()
6301 set_bit(MD_RECOVERY_WAIT, &mddev->recovery); in md_start()
6303 clear_bit(MD_RECOVERY_WAIT, &mddev->recovery); in md_start()
6344 /* Kick recovery or resync if necessary */ in restart_array()
6345 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in restart_array()
6392 mddev->recovery = 0; in md_clean()
6435 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_stop_writes()
6471 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in __md_stop()
6500 if (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) { in md_set_readonly()
6502 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_set_readonly()
6510 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in md_set_readonly()
6528 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_set_readonly()
6529 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_set_readonly()
6546 if (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) { in do_md_stop()
6548 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in do_md_stop()
6554 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in do_md_stop()
6557 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in do_md_stop()
6558 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in do_md_stop()
7166 * Kick recovery, maybe this spare has to be added to the in hot_add_disk()
7169 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in hot_add_disk()
7185 if (mddev->recovery || mddev->sync_thread) in set_bitmap_file()
7380 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in update_size()
7416 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || in update_raid_disks()
7417 test_bit(MD_RESYNCING_REMOTE, &mddev->recovery) || in update_raid_disks()
7514 if (mddev->recovery || mddev->sync_thread) { in update_array_info()
7818 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_ioctl()
8131 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_error()
8133 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_error()
8135 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_error()
8184 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) || in status_resync()
8185 test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) in status_resync()
8192 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) in status_resync()
8211 if (test_bit(MD_RESYNCING_REMOTE, &mddev->recovery)) { in status_resync()
8265 (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)? in status_resync()
8267 (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)? in status_resync()
8269 (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ? in status_resync()
8270 "resync" : "recovery"))), in status_resync()
8639 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_done_sync()
8640 set_bit(MD_RECOVERY_ERROR, &mddev->recovery); in md_done_sync()
8642 // stop recovery, signal do_sync .... in md_done_sync()
8665 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_write_start()
8896 * complete before we start doing a recovery. in md_sync_position()
8899 * recovery has checked that bit and skipped that in md_sync_position()
8934 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) in md_do_sync()
8937 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
8940 if (test_bit(MD_RECOVERY_WAIT, &mddev->recovery) || in md_do_sync()
8942 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_do_sync()
8952 if (!(test_bit(MD_RECOVERY_SYNC, &mddev->recovery) || in md_do_sync()
8953 test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) || in md_do_sync()
8954 test_bit(MD_RECOVERY_RECOVER, &mddev->recovery)) in md_do_sync()
8980 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
9009 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) && in md_do_sync()
9077 if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_do_sync()
9090 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) && in md_do_sync()
9099 !test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { in md_do_sync()
9108 &mddev->recovery)); in md_do_sync()
9111 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
9117 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_do_sync()
9126 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
9158 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
9191 test_bit(MD_RECOVERY_INTR, &mddev->recovery) in md_do_sync()
9199 if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_do_sync()
9200 !test_bit(MD_RECOVERY_INTR, &mddev->recovery) && in md_do_sync()
9207 if (!test_bit(MD_RECOVERY_CHECK, &mddev->recovery) && in md_do_sync()
9209 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { in md_do_sync()
9210 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { in md_do_sync()
9215 &mddev->recovery)) in md_do_sync()
9225 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
9227 if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_do_sync()
9228 test_bit(MD_RECOVERY_RECOVER, &mddev->recovery)) { in md_do_sync()
9249 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_do_sync()
9250 !test_bit(MD_RECOVERY_INTR, &mddev->recovery) && in md_do_sync()
9264 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { in md_do_sync()
9266 if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) in md_do_sync()
9269 } else if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) in md_do_sync()
9271 set_bit(MD_RECOVERY_DONE, &mddev->recovery); in md_do_sync()
9372 if (this && test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in remove_and_add_spares()
9424 set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); in md_choose_sync_action()
9425 clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_choose_sync_action()
9436 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); in md_choose_sync_action()
9437 clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); in md_choose_sync_action()
9438 clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in md_choose_sync_action()
9440 /* Start new recovery. */ in md_choose_sync_action()
9441 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_choose_sync_action()
9445 /* Check if recovery is in progress. */ in md_choose_sync_action()
9447 set_bit(MD_RECOVERY_SYNC, &mddev->recovery); in md_choose_sync_action()
9448 clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_choose_sync_action()
9453 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) in md_choose_sync_action()
9503 name = test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) ? in md_start_sync()
9529 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); in md_start_sync()
9530 clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); in md_start_sync()
9531 clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in md_start_sync()
9532 clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); in md_start_sync()
9533 clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_start_sync()
9545 if (test_and_clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery) && in md_start_sync()
9552 if (!test_bit(MD_RECOVERY_DONE, &mddev->recovery)) { in unregister_sync_thread()
9553 /* resync/recovery still happening */ in unregister_sync_thread()
9554 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in unregister_sync_thread()
9568 * need this as they never do any recovery or update the superblock.
9573 * "->recovery" and create a thread at ->sync_thread.
9580 * 2/ If a recovery thread is running, don't do anything else.
9581 * 3/ If recovery has finished, clean up, possibly marking spares active.
9601 !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) && in md_check_recovery()
9602 !test_bit(MD_RECOVERY_DONE, &mddev->recovery)) in md_check_recovery()
9606 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || in md_check_recovery()
9607 test_bit(MD_RECOVERY_DONE, &mddev->recovery) || in md_check_recovery()
9623 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in md_check_recovery()
9642 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_check_recovery()
9650 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_check_recovery()
9654 clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_check_recovery()
9655 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_check_recovery()
9686 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in md_check_recovery()
9696 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_check_recovery()
9701 clear_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_check_recovery()
9702 clear_bit(MD_RECOVERY_DONE, &mddev->recovery); in md_check_recovery()
9704 if (test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) && in md_check_recovery()
9705 !test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) { in md_check_recovery()
9708 clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_check_recovery()
9729 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) && in md_reap_sync_thread()
9730 !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) && in md_reap_sync_thread()
9739 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_reap_sync_thread()
9759 clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_reap_sync_thread()
9760 clear_bit(MD_RECOVERY_DONE, &mddev->recovery); in md_reap_sync_thread()
9761 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); in md_reap_sync_thread()
9762 clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); in md_reap_sync_thread()
9763 clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in md_reap_sync_thread()
9764 clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); in md_reap_sync_thread()
9773 /* flag recovery needed just to double check */ in md_reap_sync_thread()
9774 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_reap_sync_thread()
10005 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in check_sb_changes()
10010 * as faulty. The recovery is performed by the in check_sb_changes()
10031 if (test_bit(MD_RESYNCING_REMOTE, &mddev->recovery) && in check_sb_changes()
10042 } else if (test_bit(MD_RESYNCING_REMOTE, &mddev->recovery) && in check_sb_changes()
10090 /* The other node finished recovery, call spare_active to set in read_rdev()