]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
A couple of bugfixes found by suse autobuilding:
authorNeilBrown <neilb@suse.de>
Fri, 7 Nov 2008 03:46:30 +0000 (14:46 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 7 Nov 2008 03:46:30 +0000 (14:46 +1100)
1/ ia64 appear to have __clone2, not clone.
2/ Including "++" in the arg to a macro is a bad thing to do.

Signed-off-by: NeilBrown <neilb@suse.de>
mdmon.c
super-intel.c

diff --git a/mdmon.c b/mdmon.c
index fa5a0df9cd9452c1f15d445cfa52a1e6ff0d1308..5ee83464651983407c6ea261ba60b1f60c66abb9 100644 (file)
--- a/mdmon.c
+++ b/mdmon.c
@@ -79,13 +79,25 @@ int run_child(void *v)
        return 0;
 }
 
-int clone_monitor(struct supertype *container)
+#ifdef __ia64__
+int __clone2(int (*fn)(void *),
+           void *child_stack_base, size_t stack_size,
+           int flags, void *arg, ...
+        /* pid_t *pid, struct user_desc *tls, pid_t *ctid */ );
+#endif
+ int clone_monitor(struct supertype *container)
 {
        static char stack[4096];
 
+#ifdef __ia64__
+       mon_tid = __clone2(run_child, stack, sizeof(stack),
+                  CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD,
+                  container);
+#else
        mon_tid = clone(run_child, stack+4096-64,
                   CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD,
                   container);
+#endif
 
        mgr_tid = syscall(SYS_gettid);
 
index 34dfb8f5da3c9f2c5b2e8fc415ecf1ac47f758b8..a2b9bd26911b1fa83c76348657dfbc2bdb399731 100644 (file)
@@ -271,8 +271,10 @@ static __u32 __gen_imsm_checksum(struct imsm_super *mpb)
        __u32 *p = (__u32 *) mpb;
        __u32 sum = 0;
 
-        while (end--)
-                sum += __le32_to_cpu(*p++);
+        while (end--) {
+                sum += __le32_to_cpu(*p);
+               p++;
+       }
 
         return sum - __le32_to_cpu(mpb->check_sum);
 }