Whamcloud - gitweb
LU-2590 lod: magic changed after swab
authorBobi Jam <bobijam.xu@intel.com>
Fri, 11 Jan 2013 04:08:30 +0000 (12:08 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 26 Jan 2013 03:25:23 +0000 (22:25 -0500)
In lod_qos_parse_config(), the stack magic variable should be changed
to native endianness as well.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I940c40f20f1ec55d7b55eeffe8d61404a1badfdb
Reviewed-on: http://review.whamcloud.com/4996
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
lustre/lod/lod_qos.c

index 72986b1..af0f9db 100644 (file)
@@ -1264,9 +1264,11 @@ static int lod_qos_parse_config(const struct lu_env *env,
 
        if (magic == __swab32(LOV_USER_MAGIC_V1)) {
                lustre_swab_lov_user_md_v1(v1);
+               magic = v1->lmm_magic;
        } else if (magic == __swab32(LOV_USER_MAGIC_V3)) {
                v3 = buf->lb_buf;
                lustre_swab_lov_user_md_v3(v3);
+               magic = v3->lmm_magic;
        }
 
        if (unlikely(magic != LOV_MAGIC_V1 && magic != LOV_MAGIC_V3)) {