From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: akpm@linux-foundation.org
Cc: serge.hallyn@canonical.com, dhowells@redhat.com, arnd@arndb.de,
lucas.demarchi@profusion.mobi, linux-kernel@vger.kernel.org,
criu@openvz.org, mtk.manpages@gmail.com
Subject: [PATCH 3/4] ipc: handle MSG_PEEK_ALL flag if CONFIG_CHECKPOINT_RESTORE is dropped
Date: Mon, 09 Apr 2012 21:54:12 +0400 [thread overview]
Message-ID: <20120409175412.8358.59542.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20120409175309.8358.21631.stgit@localhost6.localdomain6>
Return -ENOSYS, if user called sys_msgrcv() with MSG_PEEK_ALL flag set and
checkpoint/restore code wasn't compiled.
---
ipc/compat.c | 5 ++++-
ipc/msg.c | 4 ++++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/ipc/compat.c b/ipc/compat.c
index bb9350d..0163aa1 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -377,7 +377,10 @@ long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
return -EINVAL;
if (second < 0)
return -EINVAL;
-
+#ifndef CONFIG_CHECKPOINT_RESTORE
+ if (third & MSG_PEEK_ALL)
+ return -ENOSYS;
+#endif
if (!version) {
struct compat_ipc_kludge ipck;
if (!uptr)
diff --git a/ipc/msg.c b/ipc/msg.c
index 8d63cc7..9d8f249 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -819,6 +819,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
if (msqid < 0 || (long) bufsz < 0)
return -EINVAL;
+#ifndef CONFIG_CHECKPOINT_RESTORE
+ if (msgflg & MSG_PEEK_ALL)
+ return -ENOSYS;
+#endif
mode = convert_mode(&msgtyp, msgflg);
ns = current->nsproxy->ipc_ns;
next prev parent reply other threads:[~2012-04-09 17:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 17:53 [PATCH 0/4] IPC: message queue checkpoint/restore - requested updates Stanislav Kinsbursky
2012-04-09 17:53 ` [PATCH 1/4] ipc: rename obfuscating MSG_STEAL flag into MSG_PEEK_ALL Stanislav Kinsbursky
2012-04-09 17:54 ` [PATCH 2/4] ipc: move all checkpoint-restore code under appropriate define Stanislav Kinsbursky
2012-04-09 19:47 ` [CRIU] " Pavel Emelyanov
2012-04-10 9:05 ` Stanislav Kinsbursky
2012-04-10 13:27 ` [CRIU] [PATCH v2 " Stanislav Kinsbursky
2012-04-09 17:54 ` Stanislav Kinsbursky [this message]
2012-04-09 17:54 ` [PATCH 4/4] test: IPC message queue migration test Stanislav Kinsbursky
2012-04-10 19:17 ` Andrew Morton
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=20120409175412.8358.59542.stgit@localhost6.localdomain6 \
--to=skinsbursky@parallels.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=criu@openvz.org \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
--cc=mtk.manpages@gmail.com \
--cc=serge.hallyn@canonical.com \
/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
Powered by JetHome