Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Wed, 3 Sep 2008 09:03:18 +0000 (09:03 +0000)
committeryangsheng <yangsheng>
Wed, 3 Sep 2008 09:03:18 +0000 (09:03 +0000)
b=16771
i=adilger, johann

Swab the cfg_marker along with lcfg.

lustre/include/lustre/lustre_idl.h
lustre/obdclass/llog_swab.c
lustre/obdclass/obd_config.c

index 419b087..4f09b84 100644 (file)
@@ -1833,6 +1833,8 @@ struct cfg_marker {
         char              cm_comment[MTI_NAME_MAXLEN];
 };
 
+extern void lustre_swab_cfg_marker(struct cfg_marker *marker);
+
 /*
  * Opcodes for multiple servers.
  */
index 2fe194e..a64a881 100644 (file)
@@ -280,3 +280,17 @@ void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg)
         return;
 }
 EXPORT_SYMBOL(lustre_swab_lustre_cfg);
+
+void lustre_swab_cfg_marker(struct cfg_marker *marker)
+{
+        int i;
+        ENTRY;
+
+        __swab32s(&marker->cm_step);
+        __swab32s(&marker->cm_flags);
+        __swab32s(&marker->cm_vers);
+
+        EXIT;
+        return;
+}
+EXPORT_SYMBOL(lustre_swab_cfg_marker);
index 4ed5480..f4c88ca 100644 (file)
@@ -940,11 +940,13 @@ static int class_config_llog_handler(struct llog_handle * handle,
                 struct lustre_cfg_bufs bufs;
                 char *inst_name = NULL;
                 int inst_len = 0;
-                int inst = 0;
+                int inst = 0, swab = 0;
 
                 lcfg = (struct lustre_cfg *)cfg_buf;
-                if (lcfg->lcfg_version == __swab32(LUSTRE_CFG_VERSION))
+                if (lcfg->lcfg_version == __swab32(LUSTRE_CFG_VERSION)) {
                         lustre_swab_lustre_cfg(lcfg);
+                        swab = 1;
+                }
 
                 rc = lustre_cfg_sanity_check(cfg_buf, cfg_len);
                 if (rc)
@@ -953,6 +955,8 @@ static int class_config_llog_handler(struct llog_handle * handle,
                 /* Figure out config state info */
                 if (lcfg->lcfg_command == LCFG_MARKER) {
                         struct cfg_marker *marker = lustre_cfg_buf(lcfg, 1);
+                        if (swab)
+                                lustre_swab_cfg_marker(marker);
                         CDEBUG(D_CONFIG, "Marker, inst_flg=%#x mark_flg=%#x\n",
                                clli->cfg_flags, marker->cm_flags);
                         if (marker->cm_flags & CM_START) {