[CRIU] [PATCH v3 12/16] files: new "used" files introduced

Pavel Emelyanov xemul at parallels.com
Mon Dec 14 03:49:57 PST 2015


On 12/14/2015 02:24 PM, Stanislav Kinsburskiy wrote:
> 
> 
> 14.12.2015 12:21, Pavel Emelyanov пишет:
>> On 12/10/2015 06:17 PM, Stanislav Kinsburskiy wrote:
>>> This list contains all per-process used file fdinfo's, sorted by fd number.
>>> Will be used to safely create new artificial file descriptors and also allow
>>> to recreate temporary descriptors with original number, if possible, like
>>> AutoFS tries to preserve original pipe write end descriptor, when it was
>>> closed.
>> AFAIU you only need this to find the first unused descriptor number. Why
>> not just have max_fd number in the rst_info and update one in every place
>> a new fd is added?
> 
> This can be done like this, yes.
> One of the intentions was to try to keep autofs restored options as 
> close to original as possible.
> The actual idea was to try to reopen write end of the pipe with the same 
> fd, as it was originally.
> To be able to do so, loop over all the descriptor is required to make 
> sure, that fd is not busy.

But where is this code? The only usage for used list is to find the first
unused one (patch #13) and, btw, the only benefit of the list as compared to
the plan max_used_fd value -- the ability to get a 'hole' between used fds --
is not taken in this patch.



More information about the CRIU mailing list