From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: akpm@linux-foundation.org
Cc: ebiederm@xmission.com, devel@openvz.org,
linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
jmorris@namei.org
Subject: [PATCH 4/4] ipc: add more comments to message copying related code
Date: Wed, 07 Nov 2012 13:05:10 +0300 [thread overview]
Message-ID: <20121107100510.22846.706.stgit@localhost.localdomain> (raw)
In-Reply-To: <20121107100317.22846.94715.stgit@localhost.localdomain>
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
ipc/msg.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/ipc/msg.c b/ipc/msg.c
index 5e317fe..4a4725c 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -770,6 +770,10 @@ static long do_msg_fill(void __user *dest, struct msg_msg *msg, size_t bufsz)
}
#ifdef CONFIG_CHECKPOINT_RESTORE
+/*
+ * This function creates new kernel message structure, large enough to store
+ * bufsz message bytes.
+ */
static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
int msgflg, long *msgtyp,
unsigned long *copy_number)
@@ -881,6 +885,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
msg = ERR_PTR(-E2BIG);
goto out_unlock;
}
+ /*
+ * If we are copying, then do not unlink message and do
+ * not update queue parameters.
+ */
if (msgflg & MSG_COPY)
goto out_unlock;
list_del(&msg->m_list);
prev parent reply other threads:[~2012-11-07 10:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-07 10:04 [PATCH 0/4] IPC: CRIU enhancements fixes and cleanup Stanislav Kinsbursky
2012-11-07 10:04 ` [PATCH 1/4] ipc: simplify free_copy() call Stanislav Kinsbursky
2012-11-07 10:05 ` [PATCH 2/4] ipc: convert prepare_copy() from macro to function Stanislav Kinsbursky
2012-11-07 19:20 ` Andrew Morton
2012-11-07 10:05 ` [PATCH 3/4] ipc: simplify message copying Stanislav Kinsbursky
2012-11-07 10:05 ` Stanislav Kinsbursky [this message]
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=20121107100510.22846.706.stgit@localhost.localdomain \
--to=skinsbursky@parallels.com \
--cc=akpm@linux-foundation.org \
--cc=devel@openvz.org \
--cc=ebiederm@xmission.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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