When abort_recov_mdt is set to abort MDT-MDT recovery then
abort_recovery flag is set too inside target_stop_recovery_thread()
call, that causes not just MDT-MDT recovery abort but aborts
also clients/MDT recovery.
Fixes:
dd9e79b64d ("LU-12546 mdt: abort recovery between MDTs")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Ibda05e91a2da90156e2b6c9fdcb2169cdbd50fe4
Reviewed-on: https://review.whamcloud.com/44610
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
return;
}
obd->obd_recovering = obd->obd_abort_recovery = 0;
+ obd->obd_abort_recov_mdt = 0;
spin_unlock(&obd->obd_dev_lock);
spin_lock(&obd->obd_recovery_task_lock);
*/
spin_lock(&obd->obd_dev_lock);
obd->obd_recovering = obd->obd_abort_recovery = 0;
+ obd->obd_abort_recov_mdt = 0;
spin_unlock(&obd->obd_dev_lock);
spin_lock(&obd->obd_recovery_task_lock);
target_cancel_recovery_timer(obd);
struct obd_ioctl_data *data = karg;
CERROR("%s: Aborting recovery for device\n", mdt_obd_name(mdt));
- if (data->ioc_type & OBD_FLG_ABORT_RECOV_MDT)
+ if (data->ioc_type & OBD_FLG_ABORT_RECOV_MDT) {
obd->obd_abort_recov_mdt = 1;
- else /* if (data->ioc_type & OBD_FLG_ABORT_RECOV_OST) */
+ wake_up(&obd->obd_next_transno_waitq);
+ } else { /* if (data->ioc_type & OBD_FLG_ABORT_RECOV_OST) */
/* lctl didn't set OBD_FLG_ABORT_RECOV_OST < 2.13.57 */
obd->obd_abort_recovery = 1;
-
- target_stop_recovery_thread(obd);
+ target_stop_recovery_thread(obd);
+ }
rc = 0;
break;
}
goto out;
}
- /* sampled unlocked, but really... */
- if (obd->obd_recovering == 0) {
+ /* There is gap between client data read from storage and setting
+ * obd_recovering so check obd_recovery_end as well to make sure
+ * recovery is really finished
+ */
+ if (obd->obd_recovery_end > 0 && !obd->obd_recovering) {
seq_printf(m, "COMPLETE\n");
seq_printf(m, "recovery_start: %lld\n",
(s64)ktime_get_real_seconds() -