Lines Matching full:recovery

477 	set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);  in mddev_resume()
1362 /* active but not in sync implies recovery up to in super_90_validate()
1920 &mddev->recovery)) in super_1_validate()
2431 /* May as well allow recovery to be retried once */ in bind_rdev_to_array()
2627 * curr_resync_completed can only be used during recovery. in md_update_sb()
2634 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) && in md_update_sb()
2635 test_bit(MD_RECOVERY_RECOVER, &mddev->recovery) && in md_update_sb()
2636 !test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_update_sb()
2684 * then a recovery will happen and soon that array won't in md_update_sb()
2770 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in md_update_sb()
2812 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in add_bound_rdev()
2813 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in add_bound_rdev()
2962 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); in state_store()
2994 * check if recovery is needed. in state_store()
3000 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); in state_store()
3130 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); in slot_store()
3141 if (test_bit(MD_RECOVERY_RUNNING, &rdev->mddev->recovery)) in slot_store()
3226 test_bit(MD_RECOVERY_RUNNING,&mddev->recovery)) in new_offset_store()
3895 * - array is not engaged in resync/recovery/reshape in level_store()
3902 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || in level_store()
4252 if (mddev->pers && !test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) in resync_start_store()
4739 unsigned long recovery = mddev->recovery; in action_show() local
4740 if (test_bit(MD_RECOVERY_FROZEN, &recovery)) in action_show()
4742 else if (test_bit(MD_RECOVERY_RUNNING, &recovery) || in action_show()
4743 (md_is_rdwr(mddev) && test_bit(MD_RECOVERY_NEEDED, &recovery))) { in action_show()
4744 if (test_bit(MD_RECOVERY_RESHAPE, &recovery)) in action_show()
4746 else if (test_bit(MD_RECOVERY_SYNC, &recovery)) { in action_show()
4747 if (!test_bit(MD_RECOVERY_REQUESTED, &recovery)) in action_show()
4749 else if (test_bit(MD_RECOVERY_CHECK, &recovery)) in action_show()
4753 } else if (test_bit(MD_RECOVERY_RECOVER, &recovery)) in action_show()
4763 if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in stop_sync_thread()
4773 if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in stop_sync_thread()
4781 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in stop_sync_thread()
4796 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in idle_sync_thread()
4800 !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)); in idle_sync_thread()
4808 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in frozen_sync_thread()
4812 !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)); in frozen_sync_thread()
4828 else if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in action_store()
4831 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
4833 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
4834 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in action_store()
4841 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in action_store()
4846 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
4855 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
4864 set_bit(MD_RECOVERY_CHECK, &mddev->recovery); in action_store()
4867 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in action_store()
4868 set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in action_store()
4869 set_bit(MD_RECOVERY_SYNC, &mddev->recovery); in action_store()
4878 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in action_store()
5020 if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in sync_completed_show()
5027 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) || in sync_completed_show()
5028 test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) in sync_completed_show()
5061 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in min_sync_store()
5104 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in max_sync_store()
5947 mddev->recovery = 0; in md_run()
6055 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_run()
6056 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_run()
6123 set_bit(MD_RECOVERY_WAIT, &mddev->recovery); in md_start()
6126 clear_bit(MD_RECOVERY_WAIT, &mddev->recovery); in md_start()
6167 /* Kick recovery or resync if necessary */ in restart_array()
6168 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in restart_array()
6208 mddev->recovery = 0; in md_clean()
6226 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in __md_stop_writes()
6230 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in __md_stop_writes()
6292 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in __md_stop()
6319 if (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) { in md_set_readonly()
6321 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_set_readonly()
6324 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in md_set_readonly()
6325 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_set_readonly()
6337 &mddev->recovery)); in md_set_readonly()
6345 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in md_set_readonly()
6348 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_set_readonly()
6349 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_set_readonly()
6363 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in md_set_readonly()
6364 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_set_readonly()
6385 if (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) { in do_md_stop()
6387 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in do_md_stop()
6390 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in do_md_stop()
6391 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in do_md_stop()
6402 &mddev->recovery))); in do_md_stop()
6409 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in do_md_stop()
6413 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); in do_md_stop()
6414 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in do_md_stop()
7036 * Kick recovery, maybe this spare has to be added to the in hot_add_disk()
7039 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in hot_add_disk()
7056 if (mddev->recovery || mddev->sync_thread) in set_bitmap_file()
7258 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || in update_size()
7297 test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || in update_raid_disks()
7298 test_bit(MD_RESYNCING_REMOTE, &mddev->recovery) || in update_raid_disks()
7395 if (mddev->recovery || mddev->sync_thread) { in update_array_info()
7625 /* need to ensure recovery thread has run */ in md_ioctl()
7628 &mddev->recovery), in md_ioctl()
7724 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_ioctl()
8034 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_error()
8036 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_error()
8038 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_error()
8074 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) || in status_resync()
8075 test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) in status_resync()
8082 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) in status_resync()
8101 if (test_bit(MD_RESYNCING_REMOTE, &mddev->recovery)) { in status_resync()
8155 (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)? in status_resync()
8157 (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)? in status_resync()
8159 (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ? in status_resync()
8160 "resync" : "recovery"))), in status_resync()
8548 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_done_sync()
8549 set_bit(MD_RECOVERY_ERROR, &mddev->recovery); in md_done_sync()
8551 // stop recovery, signal do_sync .... in md_done_sync()
8574 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_write_start()
8762 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery) || in md_do_sync()
8763 test_bit(MD_RECOVERY_WAIT, &mddev->recovery)) in md_do_sync()
8766 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_do_sync()
8776 if (!(test_bit(MD_RECOVERY_SYNC, &mddev->recovery) || in md_do_sync()
8777 test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) || in md_do_sync()
8778 test_bit(MD_RECOVERY_RECOVER, &mddev->recovery)) in md_do_sync()
8784 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { in md_do_sync()
8785 if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) { in md_do_sync()
8788 } else if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { in md_do_sync()
8793 } else if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) in md_do_sync()
8796 desc = "recovery"; in md_do_sync()
8815 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
8844 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) && in md_do_sync()
8867 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { in md_do_sync()
8874 if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) in md_do_sync()
8879 } else if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) { in md_do_sync()
8890 /* recovery follows the physical size of devices */ in md_do_sync()
8905 * complete before we start doing a recovery. in md_do_sync()
8908 * recovery has checked that bit and skipped that in md_do_sync()
8960 if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_do_sync()
8973 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) && in md_do_sync()
8982 !test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { in md_do_sync()
8991 &mddev->recovery)); in md_do_sync()
8994 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
8999 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_do_sync()
9008 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
9040 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
9073 test_bit(MD_RECOVERY_INTR, &mddev->recovery) in md_do_sync()
9081 if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_do_sync()
9082 !test_bit(MD_RECOVERY_INTR, &mddev->recovery) && in md_do_sync()
9089 if (!test_bit(MD_RECOVERY_CHECK, &mddev->recovery) && in md_do_sync()
9091 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { in md_do_sync()
9092 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { in md_do_sync()
9097 &mddev->recovery)) in md_do_sync()
9107 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) in md_do_sync()
9109 if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_do_sync()
9110 test_bit(MD_RECOVERY_RECOVER, &mddev->recovery)) { in md_do_sync()
9131 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_do_sync()
9132 !test_bit(MD_RECOVERY_INTR, &mddev->recovery) && in md_do_sync()
9146 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { in md_do_sync()
9148 if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) in md_do_sync()
9151 } else if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) in md_do_sync()
9153 set_bit(MD_RECOVERY_DONE, &mddev->recovery); in md_do_sync()
9172 if (this && test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) in remove_and_add_spares()
9267 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); in md_start_sync()
9268 clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); in md_start_sync()
9269 clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in md_start_sync()
9270 clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); in md_start_sync()
9271 clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_start_sync()
9274 &mddev->recovery)) in md_start_sync()
9287 * need this as they never do any recovery or update the superblock.
9292 * "->recovery" and create a thread at ->sync_thread.
9299 * 2/ If a recovery thread is running, don't do anything else.
9300 * 3/ If recovery has finished, clean up, possibly marking spares active.
9335 !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) in md_check_recovery()
9339 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || in md_check_recovery()
9340 test_bit(MD_RECOVERY_DONE, &mddev->recovery) || in md_check_recovery()
9375 set_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_check_recovery()
9377 clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_check_recovery()
9378 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_check_recovery()
9408 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { in md_check_recovery()
9409 if (!test_bit(MD_RECOVERY_DONE, &mddev->recovery)) { in md_check_recovery()
9410 /* resync/recovery still happening */ in md_check_recovery()
9411 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_check_recovery()
9427 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_check_recovery()
9432 clear_bit(MD_RECOVERY_INTR, &mddev->recovery); in md_check_recovery()
9433 clear_bit(MD_RECOVERY_DONE, &mddev->recovery); in md_check_recovery()
9435 if (!test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || in md_check_recovery()
9436 test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) in md_check_recovery()
9438 /* no recovery is running. in md_check_recovery()
9450 set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); in md_check_recovery()
9451 clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_check_recovery()
9453 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); in md_check_recovery()
9454 clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); in md_check_recovery()
9455 clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in md_check_recovery()
9456 set_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_check_recovery()
9458 set_bit(MD_RECOVERY_SYNC, &mddev->recovery); in md_check_recovery()
9459 clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery); in md_check_recovery()
9460 } else if (!test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) in md_check_recovery()
9478 clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_check_recovery()
9481 &mddev->recovery)) in md_check_recovery()
9502 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) && in md_reap_sync_thread()
9503 !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) && in md_reap_sync_thread()
9512 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && in md_reap_sync_thread()
9532 clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); in md_reap_sync_thread()
9533 clear_bit(MD_RECOVERY_DONE, &mddev->recovery); in md_reap_sync_thread()
9534 clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); in md_reap_sync_thread()
9535 clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); in md_reap_sync_thread()
9536 clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); in md_reap_sync_thread()
9537 clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); in md_reap_sync_thread()
9546 /* flag recovery needed just to double check */ in md_reap_sync_thread()
9547 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in md_reap_sync_thread()
9768 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); in check_sb_changes()
9773 * as faulty. The recovery is performed by the in check_sb_changes()
9794 if (test_bit(MD_RESYNCING_REMOTE, &mddev->recovery) && in check_sb_changes()
9805 } else if (test_bit(MD_RESYNCING_REMOTE, &mddev->recovery) && in check_sb_changes()
9853 /* The other node finished recovery, call spare_active to set in read_rdev()