[CRIU] Re: [PATCH v2] restorer: move vma flags ANON bit drop alter IPC check

Kinsbursky Stanislav skinsbursky at openvz.org
Fri Feb 17 07:42:56 EST 2012


17.02.2012 16:36, Pavel Emelyanov пишет:
> On 02/17/2012 02:43 PM, Kinsbursky Stanislav wrote:
>> v2: local flags variable introduced
>>
>> This doesn't change anything. But looks clearer, because this check has
>> nothing with SYSV IPC mappings.
>>
>> Signed-off-by: Stanislav Kinsbursky<skinsbursky at openvz.org>
>>
>> ---
>>   restorer.c |   30 ++++++++++++++++--------------
>>   1 files changed, 16 insertions(+), 14 deletions(-)
>>
>> diff --git a/restorer.c b/restorer.c
>> index 3eb5e35..e0eccb4 100644
>> --- a/restorer.c
>> +++ b/restorer.c
>> @@ -289,16 +289,29 @@ err:
>>
>>   static u64 restore_mapping(const struct vma_entry *vma_entry)
>>   {
>> -	int prot;
>> +	int prot, flags;
>>
>>   	if (vma_entry_is(vma_entry, VMA_AREA_SYSVIPC))
>>   		return sys_shmat(vma_entry->fd, (void *)vma_entry->start,
>>   				 (vma_entry->prot&  PROT_WRITE) ? 0 : SHM_RDONLY);
>>
>> +	flags = vma_entry->flags;
>> +
>> +	/*
>> +	 * Restore or shared mappings are tricky, since
>> +	 * we open anonymous mapping via map_files/
>> +	 * MAP_ANONYMOUS should be eliminated so fd would
>> +	 * be taken into account by a kernel.
>> +	 */
>> +	if (vma_entry_is(vma_entry, VMA_ANON_SHARED)) {
>> +		if (vma_entry->fd != -1UL)
> Write both conditions in on if ().

This patch was commited already.
I'll send another one.

-- 
Best regards,
Stanislav Kinsbursky




More information about the CRIU mailing list