Whamcloud - gitweb
LU-2227 build: fix 'memory illegal access' errors
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_iam_lvar.c
index 9fc9fd7..ef53adf 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012 Whamcloud, Inc.
+ * Copyright (c) 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -949,18 +949,17 @@ static void lvar_root(void *buf,
        LASSERT((keysize + ptrsize) >=
                (sizeof(struct dx_countlimit) + sizeof(__u32)));
 
-       entry = limit + 1;
+       entry = (void *)(limit + 1);
        /* Put "idle_blocks" just after the limit. There was padding after
         * the limit, the "idle_blocks" re-uses part of the padding, so no
         * compatibility issues with old layout.
         */
        *(__u32 *)entry = 0;
 
-        entry = root + 1;
-        /*
-         * Skip over @limit.
-         */
-        entry += isize;
+       /*
+        * Skip over @limit.
+        */
+       entry = (void *)(root + 1) + isize;
 
         /*
          * Entry format is <key> followed by <ptr>. In the minimal tree