Commit graph

9314 commits

Author SHA1 Message Date
Pavel Tikhomirov
778d6d7b70 zdtm: check ghost restores on readonly fs if it is also a ghost in other writable bind
It is a test for convert_path_from_another_mp fix, it is a bit tricky as
we don't fully support ghosts on readonly fs, but only if the ghost can
be remaped on some _other_ bindmount (luckily we have same ghost on other
bind). Moreover wrong absolute path generated with old convert_path_from
_another_mp for lnkat don't always fail, only in case we want to do
linkat on mount in _other_ mountns and absolute path makes us do it in
local mountns and local path is readonly and we fail. =)

v2: remove unused headers

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-01-25 03:34:57 +03:00
Pavel Tikhomirov
41cdad6c2d files: make convert_path_from_another_mp always return relative path
If dmi->ns_mountpoint is "/" then in dst we will return "/..." -
absolute path but we want here path relative to dmi mount. Adding "./"
before the path guaranties that it will be always relative.

https://jira.sw.ru/browse/PSBM-72351
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2018-01-25 03:34:57 +03:00
Radostin Stoyanov
00524c298e img-remote: Fix typo in comment
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-01-25 03:30:02 +03:00
Radostin Stoyanov
ae1e61bb58 crtools: Fix typo
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-01-25 03:29:15 +03:00
Kirill Tkhai
51c4dc7c25 zdtm: Add fd01 test
Fork tasks and create fds with different numbers.
Some children share file with parent (CLONE_FILES).
Check, than we can suspend and resume in this case.

v2: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
c19df1ac02 files: Make tasks set their own service_fd_base
Currently, we set rlim(RLIMIT_NOFILE) unlimited
and service_fd_rlim_cur to place service fds.
This leads to a signify problem: every task uses
the biggest possible files_struct in kernel, and
it consumes excess memory after restore
in comparation to dump. In some situations this
may end in restore fail as there is no enough
memory in memory cgroup of on node.

The patch fixes the problem by introducing
task-measured service_fd_base. It's calculated
in dependence of max used file fd and is placed
near the right border of kernel-allocated memory
hunk for task's fds (see alloc_fdtable() for
details). This reduces kernel-allocated files_struct
to 512 fds for the most process in standard linux
system (I've analysed the processes in my work system).

Also, since the "standard processes" will have the same
service_fd_base, clone_service_fd() won't have to
actualy dup() their service fds for them like we
have at the moment. This is the one of reasons why
we still keep service fds as a range of fds,
and do not try to use unused holes in task fds.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

v2: Add a handle for very big fd numbers near service_fd_rlim_cur.
v3: Fix excess accounting for nr equal to pow 2 minus 1.
2018-01-16 20:43:22 +03:00
Kirill Tkhai
129bb14611 files: Prepare clone_service_fd() for overlaping ranges.
In normal life this is impossible. But in case of big
fdt::nr number (many processes, sharing the same files),
and custom service_fd_base, normal (!CLONE_FILES) child
of such process may have overlaping service fds with
parent's fdt. This patch introduces "memmove()" behavior
(currently there is "memcpy()" behavior) and this will
be used in next patch.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
a589166642 files: Refactor clone_service_fd()
This patch just moves part of clone_service_fd()
to separate function, that change readability of the code.

There are no functional changes, only refactoring.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
fa26f01bb4 files: Do setup_newborn_fds() later
This patch makes the call of service fds relocation after
root_prepare_shared()->prepare_fd_pid(). Next patches
will make service_fd_base depend on task's max fd used,
and for root_item we need to read all fles to know
the maximum of them.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
4fc7cdecf5 files: Close old service fd in clone_service_fd()
Next patches will make service_fd_base not contant.
It will be "floating" and change from task to task.
This patch makes preparation for that: it closes
old service fd after it's duplicated.

Currently the code is unused as in case of
!(rsti(me)->clone_flags & CLONE_FILES), the child
has the same id as its parent, and the duplication
just does not occur.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
d300d172a7 files: Pass pstree_item argument to clone_service_fd()
Refactoring for next patches.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
3c66f6c9f4 files: Count inh_fd_max
This patch counts maximum of inherited fds.
The value will be used in next patch.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
55187ec9c5 files: Rename service_fd_rlim_cur to service_fd_base_cur
Next patches will make service fds numbers not connected
not rlimit. Change the name to better fit its goal.

Also, leave service_fd_rlim_cur variable to have cached
access to rlimit value.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

v2: More comments
2018-01-16 20:43:22 +03:00
Kirill Tkhai
8d1eb0b89a sfds: Protect service fds
Mark area, where service fds modifications are prohibited.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
cdcfe1d5ae sfds: Populate pid proc
This patch populates/occupies PROC_FD_OFF fd number,
which is goint to be replaced atomically in next patches.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
a40231a0ce mnt: Populate ROOT_FD_OFF
This patch populates and occupies ROOT_FD_OFF fd,
which guarantees it won't be reused by ordinary fds.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
99e56c7e8c sfds: Protect service fds reuse
This patch introduces sfds_protected, which allows
to mask areas, where modifications of sfds are prohibited.
That guarantees, that populated sfds won't be reused.

v4: New
v5: Add comment and print sfd type before BUG().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
b5bea099f6 utils: Add print_stack_trace()
Function to print call trace of a process.

Borrowed from this fm:
https://www.gnu.org/software/libc/manual/html_node/Backtraces.html

backtrace() and backtrace_symbols() are not implemented in alpine,
so we use __GLIBC__ ifdef to do not compile this function there.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
bad2c90388 socket: Remove useless close_pid_proc() from set_netns()
Net namespace does not act on /proc/[pid] context,
so this close is completely useless.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
ef8ea19010 mnt: Remove useless closes in __mntns_get_root_fd()
1)Further mntns_set_root_fd() calls install_service_fd(),
which silently closes already open fd. So, kill close_service_fd()
and make __mntns_get_root_fd() atomical in ROOT_FD_OFF modifications.

2)close_pid_proc() is not need here, as it's about root_item's
/proc directory and __mntns_get_root_fd() actions don't act on it.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
eea17eba89 files: Do not close PROC_PID_FD_OFF sfd in prepare_fds()
Here we need to close proc self fd only, as it's not
a service fd, and it can occupy real task fd number.
Closing of PROC_PID_FD_OFF is useless action here,
because it's already occupy a service fd number.

So, we skip this excess syscall, and leave PROC_PID_FD_OFF
open.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
d5bece6678 sfds: Kill SELF_STDIN_OFF via fdstore
Place stdin in fdstore. Kill SELF_STDIN_OFF.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:22 +03:00
Kirill Tkhai
847e585f68 core: Init fdstore even earlier
Next patch will move SELF_STDIN_OFF sfd to fdstore.
This patch moves fdstore_init() before tty_prep_fds().

v4: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2018-01-16 20:43:21 +03:00
Kirill Tkhai
76b8ab3500 zdtm: Add zombie01 test
Create a zombie with specific pgid and check that
pgid remains the same after restore.

This test hangs criu restore without any of two previous patches:
1)without "restore: Call prepare_fds() in restore_one_zombie()"
  in 100% cases;

2)without "restore: Split restore_one_helper() and wait exiting
  zombie children" fail is racy, but you can add something like

criu/cr-restore.c:
## -1130,6 +1130,8 @@ static int restore_one_zombie(CoreEntry *core)

        if (task_entries != NULL) {
                restore_finish_stage(task_entries, CR_STATE_RESTORE);
+               if (current->parent->pid->state == TASK_ALIVE)
+                       sleep(2);
                zombie_prepare_signals();
        }

and it will fail with almost 100% probability.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-01-02 20:45:34 +03:00
Kirill Tkhai
0699dd583a restore: Split restore_one_helper() and wait exiting zombie children
Zombie is also can be choosen as a parent for task helper like
any other task.

If the task helper exits between restore_finish_stage(CR_STATE_RESTORE)
and zombie_prepare_signals()->SIG_UNBLOCK, the standard criu SIGCHLD
handler is called, and the restore fails:

(00.057762)     41: Error (criu/cr-restore.c:1557): 40 exited, status=0
(00.057815) Error (criu/cr-restore.c:2465): Restoring FAILED.

This patch makes restore_one_zombie() behave as restore_one_helper()
and to wait children exits before allowing SIGCHLD. This makes us
safe against races with exiting children.

See next patch for test details.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-01-02 20:45:34 +03:00
Kirill Tkhai
7d8c2d86a8 restore: Call prepare_fds() in restore_one_zombie()
Zombie may be choosen as parent for task helper
during solving pgid dependences. In this situation,
it becomes to share fdt with the helper and it has
to call prepare_fds() to decrement fdt->nr.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-01-02 20:45:34 +03:00
Kirill Tkhai
75b46c9d05 zdtm: Export sys_clone_unified() to headers
Make it possible to use this function by tests.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-01-02 20:45:34 +03:00
Kirill Tkhai
64f9832566 files: Kill unused CTL_TTY_OFF leftovers
CTL_TTY_OFF and reserve_service_fd() are unused now,
so purge them from the code.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2017-12-28 20:02:50 +03:00
Kirill Tkhai
f697398305 files: Move CTL_TTY_OFF fixup to generic file engine
There are two problems. The first is CTL_TTY_OFF occupies
one of the biggest available fds in the system. It's a number
near service_fd_rlim_cur. Next patches want to allocate
service fds lower, than service_fd_rlim_cur, and they want
to know max used fd from file fles after the image reading.

But since one of fds is already set very big (CTL_TTY_OFF)
on a stage of collection fles, the only availabe service
fds are near service_fd_rlim_cur. It's vicious circle,
and the only way is to change ctl tty fd allocation way.

The second problem is ctl tty is ugly out of generic file
engine fixup (see open_fd()). This is made because ctl tty
is the only slave fle, which needs additional actions
(see tty_restore_ctl_terminal()). Another file types just
receive their slave fle, and do not do anything else.

This patch moves ctl tty to generic engine and solves all
the above problems. To do that, we implement new CTL_TTY
file type, which open method waits till slave tty is received
and then calls tty_restore_ctl_terminal() for that. It fits
to generic engine well, and allocates fd via find_unused_fd(),
and do not polute file table by big fd numbers.

Next patch will kill currently unneed CTL_TTY leftovers
and will remove CTL_TTY_OFF service fd from criu.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2017-12-28 20:02:50 +03:00
Kirill Tkhai
d3d17b0cbf files: Move prepare_ctl_tty() to criu/tty.c
Move the function and reduce its arguments number.
This is cleanup needed to keep all tty code together.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2017-12-28 20:02:50 +03:00
Kirill Tkhai
56cd4b53c2 files: Close ctl tty via generic engine
Just mark the fle as "fake" and the engine will do all the work.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
2017-12-28 20:02:50 +03:00
Pavel Tikhomirov
b1a67f8572 zdtm: improve tempfs_overmounted test
Unchanged test provided by Andrew.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Pavel Tikhomirov
b286426642 mount: do remaps for child-overmount of another overmount
In case we have mounts:

1 /mnt/
2 /mnt/a with parent 1
3 /mnt/a/b with parent 1
4 /mnt/a with parent 2

We determine 2 as needing remap with does_mnt_overmount() and remap it.
Next we mount 4 on top of 2. Next in fixup_remap_mounts() we want to
move 2 back to it's parent 1, but instead move 4 there. So in these case
children-overmounts need to be remapped too.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Pavel Tikhomirov
b82c935c27 mount: fix try_remap_mount
Remaps in mnt_remap_list should follow same descending order which was
setup in mnt_resort_siblings(), so don't reorder them.

For instance if we have sibling mounts with mountpoints:
1) /dir1/dir2/dir3
2) /dir1/dir2
3) /dir1
Here (2) is sibling-overmount for (1). Mount (3) is sibling-overmount
for both (1) and (2). So when we move overmounts back in
fixup_remap_mounts() we should first move (2) and only then (3).

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Pavel Tikhomirov
f083987f27 mount: fix mnt_resort_siblings to work as described
We should add new entry _before_ first entry with less depth to sort in
descending order.

e.g: entries in list have depths [7,5,3], adding new entry m with depth
4 we would break list_for_each_entry loop on p with depth 3, before
patch we would get [7,5,3,4] after list_add, which is wrong.

Also we can relax "<=" check to "<" to avoid unnecessary reordering.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Pavel Tikhomirov
7ca51df5a8 zdtm: now tempfs_overmounted will pass so remove crfail
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Pavel Tikhomirov
b6cfb1ce29 mount: make open_mountpoint handle overmouts properly
dump of VZ7 ct fails, if we have overmounted tmpfs inside:

[root@silo ~]# prlctl enter su-test-2
entered into CT
CT-829e7b28 /# mkdir /mnt/overmntedtmp
CT-829e7b28 /# mount -t tmpfs tmpfs /mnt/overmntedtmp/
CT-829e7b28 /# mount -t tmpfs tmpfs /mnt
CT-829e7b28 /# logout

[root@silo ~]# prlctl suspend su-test-2
Suspending the CT...
Failed to suspend the CT: PRL_ERR_VZCTL_OPERATION_FAILED (Details: Will skip in-flight TCP connections
(01.657913) Error (criu/mount.c:1202): mnt: Can't open ./mnt/overmntedtmp: No such file or directory
(01.662528) Error (criu/util.c:709): exited, status=1
(01.664329) Error (criu/util.c:709): exited, status=1
(01.664694) Error (criu/cr-dump.c:2005): Dumping FAILED.
Failed to checkpoint the Container
All dump files and logs were saved to /vz/private/829e7b28-f204-4bce-b09f-d203b99befd4/dump/Dump.fail
Checkpointing failed
)

Criu wants to dump the contents of /mnt/overmntedtmp/ mount but it is
unavailable. So we copy the mount namespace in such a case and unmount
overmounts to access what we want to dump.

Actual usecase here is dumping CT with active mariadb and ssh
connection. Together they happen to create such overmount. As by default
systemd creates a separate mount namespace for mysql and also mounts
tmpfs to /run/user in it, and when ssh(root) is connected - systemd also
mounts tmpfs in container root mount namespace to /run/user/0 for user
files. As /run is slave mount /run/user/0 also propagates to mysql's
mount namespace and initially becomes overmounted by /run/user.

https://jira.sw.ru/browse/PSBM-57362

remove __maybe_unused for mnt_is_overmounted and umount_overmounts

changes in v2:
1) Use clone not fork, share resources with parent same as in
call_in_child_process.
2) Do not enter userns (create helper) for non-overmounted mounts. Thus
return back setns/resorens logic.
3) Helper opens fd for parent directly due to CLONE_FILES, remove futex.
4) Check helper exit status properly.
5) Add get_clean_fd helper.
6) Add better comments.

changes in v3:
1) Pass fd from helper through args instead of ret code, fix ret code
checking.
2) Add \n to pr_err in open_mountpoint

changes in v5:
Make comments even better.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Pavel Tikhomirov
24298e00b3 mount add umount_overmounts helper to make mount visible
also remove __maybe_unused for __umount_children_overmounts

note: leave it __maybe_unused yet
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Pavel Tikhomirov
9e71c1f284 mount: add __umount_children_overmounts helper to make mount visible
note: leave it __maybe_unused yet
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Pavel Tikhomirov
d4fa52e6b9 mount: add mnt_is_overmounted helper to check mount visibility
note: leave it __maybe_unused yet
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-26 21:11:45 +03:00
Andrei Vagin
c1b0a849e4 syscall: fix arguments for preadv()
It has two arguments "pos_l and "pos_h" instead of one "off". It is used
to handle 64-bit offsets on 32-bit kernels.

SYSCALL_DEFINE5(preadv, unsigned long, fd, const struct iovec __user *, vec,
                unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h)

https://github.com/checkpoint-restore/criu/issues/424
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-15 21:54:58 +03:00
Vitaly Ostrosablin
6ccd871ba6 criu: Don't fail if ghost file has no parent dirs.
Due to way CRIU handles paths (as relative to workdir), there's a case,
where migration would fail. Simple example is a ghost file in filesystem
root (with root being cwd). For example, "/unlinked" becomes "unlinked".
And original code piece scans path for other slashes, which would be
missing in this case. But it's still a perfectly valid case, and there's
no need to fail. So if there's no parent dir - we just don't need to
create one and we can just return 0 here instead of failing.

Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-15 21:54:58 +03:00
Andrei Vagin
c767b11c54 test: check that corked udp sockets are not dumped
The kernel doesn't have an interface to get a sent queue for udp
sockets, so currently we can't dump them and criu dump has to fail in
such cases.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-15 09:14:03 +03:00
Andrei Vagin
776782fe20 sk-inet: detect corked sockets by getting a proper sock opt
Now we block all sockets with non-zero idiag_wqueue, but it doesn't mean
that a CORK option is enabled for a socket. A packet can be in a network
stack and it is accounted into idiag_wqueue.

https://github.com/checkpoint-restore/criu/issues/409

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-15 09:14:03 +03:00
Andrei Vagin
9ca8953baa test/docker: check a continaer with a read-only file system
Now it's probably one valide use case, because there is no way to commit
a container when a container is being checkpointed.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-07 19:56:24 +03:00
Andrei Vagin
514510ba87 zdtm/tempfs_subns: sync children with the main process
All static tests has to stop any activity before C/R.

./tempfs_subns --pidfile=tempfs_subns.pid --outfile=tempfs_subns.out --dirname=tempfs_subns.test
Run criu dump
Unable to kill 128: [Errno 3] No such process
Run criu restore
7: Old mounts lost: []
7: New mounts appeared: [('/rootfs/criu/test', '/'), ('/', '/proc'), ('/', '/dev/pts')]
:

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-07 19:55:23 +03:00
Pavel Tikhomirov
35f7f5e360 pr_err: add \n where we miss them
Except for several false positives done by:
find -type f -name "*.c" -not -path "./test/*" -exec sed -i
's/\(\<pr_err.*[^\][^n]\)\("[,)]\)/\1\\n\2/g' {} \;

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-07 19:52:13 +03:00
Pierre-Olivier Mercier
acde064232 compel: add missing header required by musl
This fix compilation issue regarding undeclared NULL and memcpy when using musl
on ARM.

Signed-off-by: Pierre-Olivier Mercier <nemunaire@nemunai.re>
2017-12-06 21:44:24 -08:00
Andrei Vagin
0c1b1d0fe7 pipe: dump all data from a pipe
Currently we use an additional pipe to steal data from a pipe, but we
don't check that we steal all data. And the additional pipe can have a
smaller size.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-05 04:49:50 +03:00
Andrei Vagin
b921ad2908 test: check a pipe with a custom size
CRIU doesn't handle correctly pipes with sizes which are bigger than a
default one.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-04 23:59:06 +03:00