[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4F3BC8FC.5000806@parallels.com>
Date: Wed, 15 Feb 2012 19:02:20 +0400
From: Stanislav Kinsbursky <skinsbursky@...allels.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"criu@...nvz.org" <criu@...nvz.org>,
"lucas.demarchi@...fusion.mobi" <lucas.demarchi@...fusion.mobi>,
"dhowells@...hat.com" <dhowells@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"serge.hallyn@...onical.com" <serge.hallyn@...onical.com>
Subject: Re: [PATCH] IPC: message queue stealing feature introduced
15.02.2012 13:40, Eric Dumazet пишет:
> Le mercredi 15 février 2012 à 13:08 +0400, Stanislav Kinsbursky a
> écrit :
>> This patch is required for checkpoint/restore in userspace project.
>> C/r requires some way to get all pending IPC messages without deleting them for
>> the queue (checkpoint can fail and in this case tasks will be resumed, so queue
>> have to be valid).
>> To achive this, new operation flag MSG_STEAL for sys_msgrcv() system call
>> introduced.
>> If this flag is set, then passed struct msgbuf pointer will be used for storing
>> array of structures:
>>
>> struct msgbuf_a {
>> long mtype; /* type of message */
>> size_t msize; /* size of message */
>> char mtext[0]; /* message text */
>> };
>>
>
> This structure is not 32/64 bit safe and will need compat tricks.
>
> + ret = do_steal_msg(mtext, arrsz, msg);
> + if (ret< 0) {
> + msg = ERR_PTR(ret);
> + goto out_unlock;
> + }
> + mtext += ret + sizeof(struct msgbuf_a);
> + arrsz -= ret + sizeof(struct msgbuf_a);
>
> I cant see where alignement requirements are met.
>
> (ret should be rounded up to a multiple of alignof(struct msgbuf_a)
>
Thanks for reply, Eric.
Will fix and resend soon.
--
Best regards,
Stanislav Kinsbursky
--
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