This is a fix for a bug introduced by the patch
make-futex_wait-use-an-hrtimer-for-timeout.patch : the timeout value
is not passed anymore to futex_lock_pi.

Signed-off-by: Pierre Peiffer <[EMAIL PROTECTED]>

---
 kernel/futex.c        |    8 ++++++--
 kernel/futex_compat.c |    4 +++-
 2 files changed, 9 insertions(+), 3 deletions(-)

Index: b/kernel/futex.c
===================================================================
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2383,8 +2383,10 @@ sys_futex64(u64 __user *uaddr, int op, u
                        return -EFAULT;
                if (!timespec_valid(&ts))
                        return -EINVAL;
+
+               t = timespec_to_ktime(ts);
                if (op == FUTEX_WAIT)
-                       t = ktime_add(ktime_get(), timespec_to_ktime(ts));
+                       t = ktime_add(ktime_get(), t);
                tp = &t;
        }
        /*
@@ -2413,8 +2415,10 @@ asmlinkage long sys_futex(u32 __user *ua
                        return -EFAULT;
                if (!timespec_valid(&ts))
                        return -EINVAL;
+
+               t = timespec_to_ktime(ts);
                if (op == FUTEX_WAIT)
-                       t = ktime_add(ktime_get(), timespec_to_ktime(ts));
+                       t = ktime_add(ktime_get(), t);
                tp = &t;
        }
        /*
Index: b/kernel/futex_compat.c
===================================================================
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -150,8 +150,10 @@ asmlinkage long compat_sys_futex(u32 __u
                        return -EFAULT;
                if (!timespec_valid(&ts))
                        return -EINVAL;
+
+               t = timespec_to_ktime(ts);
                if (op == FUTEX_WAIT)
-                       t = ktime_add(ktime_get(), timespec_to_ktime(ts));
+                       t = ktime_add(ktime_get(), t);
                tp = &t;
        }
        if (op == FUTEX_REQUEUE || op == FUTEX_CMP_REQUEUE


-- 
Pierre Peiffer
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to