From: Ronnie Sahlberg Date: Thu, 19 Sep 2024 04:08:25 +0000 (-0400) Subject: LU-18231 obd: change obd_abort_mdt_recovery into OBDF_ABORT_MDT_RECOVERY X-Git-Tag: 2.16.51~101 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0020b949db1da2e9396857f4339977e1430a152c;p=fs%2Flustre-release.git LU-18231 obd: change obd_abort_mdt_recovery into OBDF_ABORT_MDT_RECOVERY Change the use of the odb_abort_mdt_recovery bitfield into a bit in the ofd_flags bitmap and use atomic bit set/clear/test operations on it. No logical changes to the code and no changes to locking. Test-Parameters: trivial Signed-off-by: Ronnie Sahlberg Change-Id: I827d8eb32b9dc79fb16d76f33bb7169abf228e8b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56417 Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Reviewed-by: Timothy Day Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 0aba68e..b888efc 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -599,6 +599,7 @@ enum { OBDF_SET_UP, /* finished setup */ OBDF_RECOVERING, /* there are recoverable clients */ OBDF_ABORT_RECOVERY, /* abort client and MDT recovery */ + OBDF_ABORT_MDT_RECOVERY, /* abort recovery between MDTs */ OBDF_NUM_FLAGS, }; @@ -618,7 +619,6 @@ struct obd_device { /* bitfield modification is protected by obd_dev_lock */ DECLARE_BITMAP(obd_flags, OBDF_NUM_FLAGS); unsigned long - obd_abort_mdt_recovery:1, /* abort recovery between MDTs */ obd_version_recov:1, /* obd uses version checking */ obd_replayable:1, /* recovery enabled; inform clients */ obd_no_recov:1, /* fail instead of retry messages */ @@ -811,7 +811,7 @@ static inline bool obd_recovery_abort(struct obd_device *obd) static inline bool obd_mdt_recovery_abort(struct obd_device *obd) { return obd->obd_stopping || test_bit(OBDF_ABORT_RECOVERY, obd->obd_flags) || - obd->obd_abort_mdt_recovery; + test_bit(OBDF_ABORT_MDT_RECOVERY, obd->obd_flags); } #endif diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index c68f1ab..dde85be 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1849,7 +1849,7 @@ void target_cleanup_recovery(struct obd_device *obd) } clear_bit(OBDF_RECOVERING, obd->obd_flags); clear_bit(OBDF_ABORT_RECOVERY, obd->obd_flags); - obd->obd_abort_mdt_recovery = 0; + clear_bit(OBDF_ABORT_MDT_RECOVERY, obd->obd_flags); spin_unlock(&obd->obd_dev_lock); spin_lock(&obd->obd_recovery_task_lock); @@ -2810,7 +2810,8 @@ static int target_recovery_thread(void *arg) tgt_boot_epoch_update(lut); /* cancel update llogs upon recovery abort */ - if (test_bit(OBDF_ABORT_RECOVERY, obd->obd_flags) || obd->obd_abort_mdt_recovery) + if (test_bit(OBDF_ABORT_RECOVERY, obd->obd_flags) || + test_bit(OBDF_ABORT_MDT_RECOVERY, obd->obd_flags)) obd->obd_type->typ_dt_ops->o_iocontrol(OBD_IOC_LLOG_CANCEL, obd->obd_self_export, 0, trd, NULL); @@ -2831,7 +2832,7 @@ static int target_recovery_thread(void *arg) spin_lock(&obd->obd_dev_lock); clear_bit(OBDF_RECOVERING, obd->obd_flags); clear_bit(OBDF_ABORT_RECOVERY, obd->obd_flags); - obd->obd_abort_mdt_recovery = 0; + clear_bit(OBDF_ABORT_MDT_RECOVERY, obd->obd_flags); spin_unlock(&obd->obd_dev_lock); spin_lock(&obd->obd_recovery_task_lock); target_cancel_recovery_timer(obd); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index e1e2fe6..9f1dbd1 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -7998,7 +7998,7 @@ static int mdt_iocontrol(unsigned int cmd, struct obd_export *exp, int len, if (data->ioc_type & OBD_FLG_ABORT_RECOV_MDT) { LCONSOLE_WARN("%s: Aborting MDT recovery\n", obd->obd_name); - obd->obd_abort_mdt_recovery = 1; + set_bit(OBDF_ABORT_MDT_RECOVERY, obd->obd_flags); 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 */