[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121107100510.22846.706.stgit@localhost.localdomain>
Date: Wed, 07 Nov 2012 13:05:10 +0300
From: Stanislav Kinsbursky <skinsbursky@...allels.com>
To: akpm@...ux-foundation.org
Cc: ebiederm@...ssion.com, devel@...nvz.org,
linux-kernel@...r.kernel.org, viro@...iv.linux.org.uk,
jmorris@...ei.org
Subject: [PATCH 4/4] ipc: add more comments to message copying related code
Signed-off-by: Stanislav Kinsbursky <skinsbursky@...allels.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists