From: Oleg Nesterov <oleg@tv-sign.ru>
To: Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Alexey Dobriyan <adobriyan@sw.ru>, Ingo Molnar <mingo@elte.hu>,
Pavel Emelyanov <xemul@sw.ru>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Toyo Abe <toyoa@mvista.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] compat_sys_clock_nanosleep: fix *rmtp handling for -EINTR case
Date: Fri, 1 Feb 2008 16:38:03 +0300 [thread overview]
Message-ID: <20080201133803.GA25629@tv-sign.ru> (raw)
COMPLETELY UNTESTED.
compat_sys_clock_nanosleep() update rmtp only if err == -ERESTART_RESTARTBLOCK.
This is wrong, nanosleep() can return -EINTR if flags & TIMER_ABSTIME.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- MM/kernel/compat.c~4_COMPAT_CLOCK 2008-02-01 14:50:01.000000000 +0300
+++ MM/kernel/compat.c 2008-02-01 15:05:28.000000000 +0300
@@ -618,8 +618,7 @@ static long compat_clock_nanosleep_resta
err = clock_nanosleep_restart(restart);
set_fs(oldfs);
- if ((err == -ERESTART_RESTARTBLOCK) && rmtp &&
- put_compat_timespec(&tu, rmtp))
+ if (err && rmtp && put_compat_timespec(&tu, rmtp))
return -EFAULT;
if (err == -ERESTART_RESTARTBLOCK) {
@@ -648,8 +647,7 @@ long compat_sys_clock_nanosleep(clockid_
(struct timespec __user *) &out);
set_fs(oldfs);
- if ((err == -ERESTART_RESTARTBLOCK) && rmtp &&
- put_compat_timespec(&out, rmtp))
+ if (err && rmtp && put_compat_timespec(&out, rmtp))
return -EFAULT;
if (err == -ERESTART_RESTARTBLOCK) {
next reply other threads:[~2008-02-01 13:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-01 13:38 Oleg Nesterov [this message]
2008-02-01 14:35 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080201133803.GA25629@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=a.p.zijlstra@chello.nl \
--cc=adobriyan@sw.ru \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=toyoa@mvista.com \
--cc=xemul@sw.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®