[CRIU] [PATCH v3 08/16] rst_info: artificial files list introduced

Pavel Emelyanov xemul at parallels.com
Mon Dec 14 04:00:47 PST 2015


On 12/14/2015 02:55 PM, Stanislav Kinsburskiy wrote:
> 
> 
> 14.12.2015 12:47, Pavel Emelyanov пишет:
>> On 12/14/2015 02:16 PM, Stanislav Kinsburskiy wrote:
>>>
>>> 14.12.2015 12:10, Pavel Emelyanov пишет:
>>>> On 12/10/2015 06:16 PM, Stanislav Kinsburskiy wrote:
>>>>> This list is used to collect and handle some service files, which an be used
>>>>> only during restore procedure for some service perations, and must be closed
>>>>> before process is released.
>>>> OK, but I see only opening code in here, where's the closing one?
>>> I do close in post_open() callback.
>>> If there is a better place, I would be glad to do it there.
>> In the post_open_fd() right after calling the ->post_open?
>>
> 
> Emm. How to distinguish, which fd have to closed and which has not?
> By introducing another optional callback?

You already know which list you're scanning -- artificial or not -- so it's
possible to make this decision based on this knowledge.

Otherwise I see no benefits of having the 4th list on rst_info over the
specially crafted desc_opts (as you do now anyway) that would just close the
descriptor itself in its post_open callback.

>>>>> AutoFS will use them to fix up mount points druing restore.
>>>> Why can't we use existing fds list?
>>> We can, if we put them at the end on the list.
>> Why at the end of the list?
> 
> Because artificial files is just a way to operate on existent ones. Thus 
> existent ones have to be processes (opened) befoe artificial ones.

No, it's not so. In the current set artificial files are the same ones (pipes)
that are anyway owned be the processes we restore. So you can pretend that
the process that _wants_ autofs pipe for mountpoint final fixup just shares 
the pipe with the process that actually _owns_ one in its fdt.

-- Pavel



More information about the CRIU mailing list