[CRIU] [PATCH 2/2] mkdir -p any dirs necessary for files

Pavel Emelyanov xemul at parallels.com
Tue Jun 24 05:09:32 PDT 2014


On 06/24/2014 12:28 PM, Andrew Vagin wrote:
> On Tue, Jun 24, 2014 at 10:51:27AM +0400, Pavel Emelyanov wrote:
>> On 06/24/2014 06:57 AM, Tycho Andersen wrote:
>>> On Mon, Jun 23, 2014 at 10:20:18PM +0400, Andrew Vagin wrote:
>>>> On Mon, Jun 23, 2014 at 03:54:23PM +0000, Tycho Andersen wrote:
>>>>> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
>>>>> ---
>>>>> @@ -709,8 +710,11 @@ static int do_open_reg_noseek_flags(int ns_root_fd, struct reg_file_info *rfi, v
>>>>>  {
>>>>>  	u32 flags = *(u32 *)arg;
>>>>>  	int fd;
>>>>> +	char *dir;
>>>>>  
>>>>>  	fd = openat(ns_root_fd, rfi->path, flags);
>>>>> +	dir = dirname(rfi->path);
>>>>> +	mkdirpat(ns_root_fd, dir);
>>>>
>>>> I don't understand how it should work.
>>>>
>>>> You open file and then create a directory. If this directory doesn't
>>>> exist, the file can't be opened. You should fail on the next line,
>>>> should not you?
>>>
>>> Hmm. You are correct, except that this fixes an issue for me. Without
>>> it, I get:
>>>
>>> (00.320920)    364: Error (files-reg.c:721): Can't open file /dev/lxc/tty3 on restore: No such file or directory
>>> (00.320940)    364: Error (files-reg.c:686): Can't open file /dev/lxc/tty3: No such file or directory
>>
>> This /dev/lxc/tty3 file -- what is it? Is it a tmpfs/devtmpfs filesystem? They
>> should not be just regular files on regular FS, why do they disappear after dump?
> 
> 1480 1470 0:12 /8 /dev/lxc/tty4 rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000
> 
> Looks like an external bind-mount.

Then why wasn't it detected as such? Tycho, can you try to check the same
on 1.3-rc2, we have fixed several issues regarding bind mounts detection in there.

Thanks,
Pavel




More information about the CRIU mailing list