criu: Version 1.1 release

The bugfix period after 1.1-rc1 seems to be over.
With this version we pin down the API to plugins and libcriu.so.

Next steps will be tied with live-migration usecase for CRIU :)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
deduplication: make it recursively deduplicate all parent snapshots

If we write a page into image and punch it from parnet, checking
only one level down is not enough -- the iovec can reside deeper.

That said, make the hole punching be recursive.

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test: recursive deduplication

check if size of second parent-level image become smaller

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test: recoursive autodedup

verify decline in size of second parent-level image file

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: add transition test for memory

This test does a few operation in a loop
* create a mapping with random flags
* touch a few pages in a new mapping, if it's writable

This test has two processes. The second process goes a predefined value
of steps behind the first one. When we need to check the result, we stop
the first process, wait until the second process come to the same point
and compare these processes. The processes are dumped in different
states, but at the end both processes must be in the same state.

bash -x test/zdtm.sh -s -i 5 -r transition/maps007
...
(00.743662) Error (page-read.c:107): Missing 139773474525184 in parent pagemap, current iov: base=7f1f8c4cf000,len=4096
(00.743696) Error (page-xfer.c:523): Hole 0x7f1f8c4c5000/4096 not found in parent
(00.744196) Error (mem.c:331): Can't dump page with parasite
(00.758201) Error (cr-dump.c:1828): Dumping FAILED.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test: Add test for tempfs mount with open file

This test fails when run in ns:

(00.300947)      1: Error (util.c:568): exited, status=1
(00.300964)      1: Error (cr-restore.c:1067): 5 exited, status=1
(00.300989)      1: Error (mount.c:637): Can't restore tmpfs content
(00.301005) Error (cr-restore.c:1602): Restoring FAILED.

Reason for failure -- tar is spawned in new mount namespace where
it can not be found (bug #2870).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: collect_mappings -- Fix message text

@vma_area_list::longest is in pages not bytes.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
unix: Don't drop whole socket with unlinked path

When we can't stat socket name with ENOENT errno this
means, that the socket is bound and unlinked. Don't
drop the whole socket info, just treat it as nameless.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fsnotify: Helper for opening files by dev:handle pair

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fsnotify: Check on dump that file handle can be opened

Some filesystems do not provide open-by-handle functionality. For those,
we should abort fsnotifies dumping, not restoring.

The open_mount() changes are about opening mountpoints inside another
mount namespace.

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
irmap: Reverse dev:inode to path mapping

For inotify/fanotifies we cannot always open inodes by a
handle and have to scan directories searching for the inode
path :(

Fortunately, in most of the containers' cases fsnotifies are
put in "typical" places. These are used as hints for scanner.

The best way to go is use openvz's ploop over such filesystems.
Long term solution is to fix NFS to provide opening by handle.

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fsnotify: Restore name-hinted marks

If we failed to open inode by handle, try doing the irmap
search. If that's successful, dump the "real" path for the
inode.

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
files: Don't call fstatfs twice

When filling fd_parms we do call statfs, no need to call it
again later.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>