[CRIU] Re: [PATCH v3 3/8] dump: stat fd by fstatat()

Pavel Emelyanov xemul at parallels.com
Tue Mar 6 05:23:11 EST 2012


On 03/06/2012 01:02 PM, Kinsbursky Stanislav wrote:
> 05.03.2012 22:14, Pavel Emelyanov пишет:
>> On 03/05/2012 10:00 PM, Kinsbursky Stanislav wrote:
>>> This is a cleanup patch - it allows to get stats for file descriptor without
>>> opening.
>>>
>>> Signed-off-by: Stanislav Kinsbursky<skinsbursky at openvz.org>
>>>
>>> ---
>>>   cr-dump.c |   19 ++++++++++---------
>>>   1 files changed, 10 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/cr-dump.c b/cr-dump.c
>>> index 718685e..064304c 100644
>>> --- a/cr-dump.c
>>> +++ b/cr-dump.c
>>> @@ -327,10 +327,19 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, char *d_name, struct cr_fdset
>>>   		       struct sk_queue *sk_queue)
>>>   {
>>>   	struct stat fd_stat;
>>> -	int err = -1;
>>> +	int err;
>>>   	struct fd_parms p;
>>>   	int lfd;
>>>
>>> +	err = fstatat(pid_fd_dir, d_name,&fd_stat, 0);
>>> +	if (err<  0) {
>>> +		pr_perror("Failed to fstatat %d/%s", pid_fd_dir, d_name);
>>> +		return -1;
>>> +	}
>>> +
>>> +	if (read_fd_params(pid, d_name,&fd_stat,&p))
>>> +		return -1;
>> In patch #1 you moved this read_fd_parms lower. Now you move it back.
>> I like to move it, move it, I like to move it move it?
> 
> It's not me - it's diff.
> IOW, in first patch I've moved read_fd_params() below fstat().
> In this one I moved openat() below read_fd_params().

Isn't it easier to move fstat above the read_fd_parms and relax?



More information about the CRIU mailing list