Whamcloud - gitweb
LU-18231 obd: change obd_abort_mdt_recovery into OBDF_ABORT_MDT_RECOVERY 17/56417/5
authorRonnie Sahlberg <rsahlberg@whamcloud.com>
Thu, 19 Sep 2024 04:08:25 +0000 (00:08 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 9 Dec 2024 06:12:00 +0000 (06:12 +0000)
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 <rsahlberg@whamcloud.com>
Change-Id: I827d8eb32b9dc79fb16d76f33bb7169abf228e8b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56417
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/obd.h
lustre/ldlm/ldlm_lib.c
lustre/mdt/mdt_handler.c

index 0aba68e..b888efc 100644 (file)
@@ -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
 
index c68f1ab..dde85be 100644 (file)
@@ -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);
index e1e2fe6..9f1dbd1 100644 (file)
@@ -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 */