From a8a34d9336f6d1b4a51512410fb0153f39ce79d6 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Wed, 3 Sep 2008 09:03:18 +0000 Subject: [PATCH] Branch HEAD b=16771 i=adilger, johann Swab the cfg_marker along with lcfg. --- lustre/include/lustre/lustre_idl.h | 2 ++ lustre/obdclass/llog_swab.c | 14 ++++++++++++++ lustre/obdclass/obd_config.c | 8 ++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 419b087..4f09b84 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -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. */ diff --git a/lustre/obdclass/llog_swab.c b/lustre/obdclass/llog_swab.c index 2fe194e..a64a881 100644 --- a/lustre/obdclass/llog_swab.c +++ b/lustre/obdclass/llog_swab.c @@ -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); diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 4ed5480..f4c88ca 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -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) { -- 1.8.3.1