aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorStanislav Kinsbursky2013-01-04 17:35:03 -0600
committerLinus Torvalds2013-01-04 18:11:46 -0600
commit3fcfe78658695b424314ddb76abc8d58b4fc98e6 (patch)
tree755f48f8377acf7e226f0168bfacb870aba7781e /ipc
parent51eeacaa07d1372a7bc9612548ffe6cd846f4f2f (diff)
downloadkernel-omap-3fcfe78658695b424314ddb76abc8d58b4fc98e6.tar.gz
kernel-omap-3fcfe78658695b424314ddb76abc8d58b4fc98e6.tar.xz
kernel-omap-3fcfe78658695b424314ddb76abc8d58b4fc98e6.zip
ipc: add more comments to message copying related code
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 8493e1d7e353..950572f9d796 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)
770} 770}
771 771
772#ifdef CONFIG_CHECKPOINT_RESTORE 772#ifdef CONFIG_CHECKPOINT_RESTORE
773/*
774 * This function creates new kernel message structure, large enough to store
775 * bufsz message bytes.
776 */
773static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz, 777static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
774 int msgflg, long *msgtyp, 778 int msgflg, long *msgtyp,
775 unsigned long *copy_number) 779 unsigned long *copy_number)
@@ -881,6 +885,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
881 msg = ERR_PTR(-E2BIG); 885 msg = ERR_PTR(-E2BIG);
882 goto out_unlock; 886 goto out_unlock;
883 } 887 }
888 /*
889 * If we are copying, then do not unlink message and do
890 * not update queue parameters.
891 */
884 if (msgflg & MSG_COPY) 892 if (msgflg & MSG_COPY)
885 goto out_unlock; 893 goto out_unlock;
886 list_del(&msg->m_list); 894 list_del(&msg->m_list);