[CRIU] File size is not same on restore

Pavel Emelyanov xemul at parallels.com
Mon Nov 9 00:50:28 PST 2015


On 11/08/2015 04:45 AM, 上司陽平 wrote:
> Hi, I have an error and want to help me.
> I succeeded to dump a lxc container but I can't restore it.
> 
> A log of restore has following error messages:
> (00.200896)    146: Error (files-reg.c:1078): File 
> lib/x86_64-linux-gnu/libcgmanager.so.0.0.0 has bad size 137024 (expect 
> 108480)

This message means that at the restore time file's libcgmanager.so size
is 137024.

> (00.200902)    258:     pr2 Read page 7f79620bf000 from self 
> 7f79620bf000/4f000
> (00.200906)    146: Error (cr-restore.c:257): Can't fixup VMA's fd
> 
> I checked a status on host OS,
> $ stat /var/lib/lxc/u1/rootfs/lib/x86_64-linux-gnu/libcgmanager.so.0.0.0
> This file's size is 108480.
> Then I checked stat on the lxc container
> $ stat /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0
> This file's size is 108480, it is same!!
> 
> Therefore I injected debug print at the dump_one_reg_file function in 
> files-reg.c.
> 
> if (S_ISREG(p->stat.st_mode) && should_check_size(rfe.flags)) {
>                  rfe.has_size = true;
>                  rfe.size = p->stat.st_size;
>                  pr_debug("Debug: %s has %"PRIu64"\n", rfe.name, rfe.size);
> }
> 
> This printed in the log of dump,
> (00.113142) Debug: /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0 has 108480

Yes 108480 is what was seen at dump time.

> I think that size information of an open file is stored to an image file 
> after this checking.
> However this size is not same on restore.
> 
> ENV is following:
> uname -a ->
> Linux uhoi 4.2.5 #1 SMP Wed Oct 28 14:39:35 JST 2015 x86_64 x86_64 
> x86_64 GNU/Linux
> criu -V ->
> Version: 1.7.2
> GitID: v1.7-17-g2bf517e
> 
> Someone please tell me how to resolve these errors.
> Appreciate your helping hands.
> 
> Thanks,
> Yohei Kamitsukasa
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
> .
> 



More information about the CRIU mailing list