[CRIU] [PATCH v5 16/33] files: Add fdinfo_list_entry::stage

Pavel Emelyanov xemul at virtuozzo.com
Wed Jan 18 02:02:36 PST 2017


On 01/18/2017 12:09 PM, Kirill Tkhai wrote:
> 
> 
> On 18.01.2017 12:12, Pavel Emelyanov wrote:
>> On 01/18/2017 11:57 AM, Kirill Tkhai wrote:
>>>
>>>
>>> On 18.01.2017 11:43, Pavel Emelyanov wrote:
>>>> On 12/26/2016 05:27 PM, Kirill Tkhai wrote:
>>>>> Add fle open stages. Set a stage after every operation.
>>>>>
>>>>> v2: Do not merge filetype specific state with generic.
>>>>>
>>>>> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
>>>>> ---
>>>>>  criu/files.c         |   13 ++++++++++---
>>>>>  criu/include/files.h |    9 +++++++++
>>>>>  2 files changed, 19 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/criu/files.c b/criu/files.c
>>>>> index 87d8fc655..8e04309b6 100644
>>>>> --- a/criu/files.c
>>>>> +++ b/criu/files.c
>>>>> @@ -1005,12 +1005,16 @@ static int post_open_fd(int pid, struct fdinfo_list_entry *fle)
>>>>>  			return -1;
>>>>>  		}
>>>>>  		if (!is_service_fd(fle->fe->fd, CTL_TTY_OFF))
>>>>> -			return 0;
>>>>> +			goto out;
>>>>>  	}
>>>>>  
>>>>>  	if (!d->ops->post_open)
>>>>> -		return 0;
>>>>> -	return d->ops->post_open(d, fle->fe->fd);
>>>>> +		goto out;
>>>>> +	if (d->ops->post_open(d, fle->fe->fd))
>>>>> +		return -1;
>>>>> +out:
>>>>> +	fle->stage = FLE_RESTORED;
>>>>> +	return 0;
>>>>>  }
>>>>>  
>>>>>  
>>>>> @@ -1058,6 +1062,9 @@ static int open_fd(int pid, struct fdinfo_list_entry *fle)
>>>>>  		return -1;
>>>>>  	}
>>>>>  
>>>>> +	if (fle->stage < FLE_OPEN)
>>>>
>>>> Why is this if here?
>>>
>>> I supposed, there may be file types, which would need to advance their state
>>> more, that to FLE_OPEN. But there is no one no.
>>>
>>> If you want, I may do patch, which will delete this and below, on top of the series.
>>
>> If I just remove this if from the patch, will it still work? ;)
> 
> Yes, it will be OK

OK, applied



More information about the CRIU mailing list