- 15 Feb, 2018 13 commits
-
-
Kirill Tkhai authored
Nobody uses it. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
-
Andrew Vagin authored
This tests create a few processes which live in three network namespaces and have a few sockets which are created in different network namespaces. Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Each sockets belongs to one network namespace and operates in this network namespace. socket_diag reports informations about sockets from one network namespace, but it doesn't report sockets which are not bound or connected to somewhere. So we need to have a way to get network namespaces for such sockets. Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
This ioctl is called for a socket and returns a file descriptor for network namespace where a socket has been created. Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Each socket has to be restored from a proper network namespaces where it was created. We set a specified network namespace before restoring a socket. A task network namespace is set after restoring all files. v2: don't set the root netns for transport sockets Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
We need this to avoid conflicts with file descriptors, which has to be restored. Currently open_proc_pid() doesn't used during restoring file descriptors, but we are going to use it to restore sockets in proper network namespaces. Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Restore all network namespaces from the root task and then set a proper namespace for each task after restoring sockets, because we need to switch network namespaces to restore sockets. Each socket has to be created in a proper network namespace. v2: fix a typo bug Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Each socket has to be restored in a proper namespaces where it has been created. Here is an issue about unconnected and unbound sockets, they are not reported via socket-diag and we can't to get their network namespaces. v2: add a comment before get_socket_ns() remove nsid from sk_packet_entry Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
PID ussualy means processs ID, but prepare_net_ns works with namespaces. travis-ci: success for Dump and restore nested network namespaces (rev4) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
ns_id will be used to collect sockets and other per-netns resources travis-ci: success for Dump and restore nested network namespaces (rev4) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
There are a number of global variables around this descriptor (e.g. open_proc_fd) and their values are saved in memory which are not shared between processes. travis-ci: success for Dump and restore nested network namespaces (rev4) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 19 Dec, 2017 5 commits
-
-
Pavel Emelyanov authored
This time we shifted the update one month, due to the amount of changes not being very big. And got pretty big update, including a set of bugfixes and new functionality. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrei Vagin authored
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/424Signed-off-by:
Andrei Vagin <avagin@openvz.org> Reviewed-by:
Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Vitaly Ostrosablin authored
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>
-
Andrei Vagin authored
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>
-
Andrei Vagin authored
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/409Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
- 12 Dec, 2017 22 commits
-
-
Pavel Tikhomirov authored
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>
-
Pavel Begunkov authored
Leases can be set only on regular files. Thus, as optimization we can skip attempts to find associated leases in 'correct_file_leases_type' for other fd types. Signed-off-by:
Pavel Begunkov <asml.silence@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Begunkov authored
-- check childs' errors in file_leases03 -- test c/r of lease transfered to child process Signed-off-by:
Pavel Begunkov <asml.silence@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Begunkov authored
CRIU creates dictinct lock record for each file descriptor on the same OFD. The patch removes this duplicates. To do so, it adds new field into struct file_lock, which stores pid of fd, on which lock was found. 'owner pid' is not actually helpful, because the original fd, on which lock have been set, can be already closed. Also it purges crutches doing the same stuff but only for file leases. Signed-off-by:
Pavel Begunkov <asml.silence@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Begunkov authored
Test cases: 0. Basic non-breaking read/write leases. 1. Multiple read leases and OFDs with no lease for the same file. 2. Breaking leases. 3. Multiple fds (dup + inherited) for single lease (mutual OFD). Signed-off-by:
Pavel Begunkov <asml.silence@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Begunkov authored
Information about locks in /proc/<pid>/fdinfo is presented only since kernel v4.1. This patch adds logic to *note_file_lock* to match leases and OFDs. Signed-off-by:
Pavel Begunkov <asml.silence@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Begunkov authored
restore of breaking leases is executed in 2 steps: 1. restore the lease in a state it was before break 2. break it by opening associated file. The patch fixes type of broken leases to 'target lease type', because procfs always returns 'READ' in this case. Also, it adds 'updated' field in lock structure. It's used to remove all duplicated records for single lease from the image, which wasn't corrected by 'correct_lease_type'. Signed-off-by:
Pavel Begunkov <asml.silence@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Begunkov authored
Leases in breaking state are not supported. In that case criu will report an error during the dumping. Also lock info in /proc/<pid>/fdinfo should be presented (since kernel 4.1). Before taking out new lease it modifies process fsuid to match file uid (see fcntl F_SETLEASE). Signed-off-by:
Pavel Begunkov <asml.silence@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
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>
-
Andrei Vagin authored
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>
-
Pierre-Olivier Mercier authored
This fix compilation issue regarding undeclared NULL and memcpy when using musl on ARM. Signed-off-by:
Pierre-Olivier Mercier <nemunaire@nemunai.re>
-
Andrei Vagin authored
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>
-
Andrei Vagin authored
CRIU doesn't handle correctly pipes with sizes which are bigger than a default one. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Tikhomirov authored
a) As we shmalloced rpath it can not be xfreed. b) As we shmalloc variables in collect_remap_ghost() far away from open_remap_ghost() where we want to free them, there is no guaranty that our shmalloc was last and we can't use shfree_last(). fixes commit 0c675a5e ("files: remove link_remaps when everything has been restored") When create_ghost() fails for some reason that produces a segfault for me. Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
Reading and writing large buffers may result in short read/write. In cases we expect the entire buffer to be transferred use {read,write}_data rather than plain read/write syscalls. Reported-by: Mr Jenkins Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
Some tests expect that all the data will be handled in a single invocation of read/write system call. But it possible to have short read/write on a loaded system and this is not an error. Add helper functions that will reliably read/write the entire buffer. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
If we start backroung memory fetch before restore is completely finished, we may try to write to the memory areas which were not yet remapped to proper place and are not registered with userfaultfd. Add synchronization between restore and the lazy-pages so that lazy-pages will only handle #PFs before all the tasks are restored. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
The remote page read has nothing to do if the page-server on the source has closed the connection. Just report an error and abort. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
Currently when we poll a file descriptor, we only process EPOLLIN events and if a connection is closed the receiving side has no means to deal with it. Add a callback for EPOLL{RD}HUP events and the default implementation for these events that removes the file descriptor from epoll and closes it. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
A bit more readable and will be easy to distinguish from upcoming hevent^Whangup_event. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
The generic epoll_wait wrapper should not do any assumptions about timeout. It's it up to lazy-pages daemon to make (future) policy decisions. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
If we receive only part of the IOV from the page-server we recalculate the IOV so it will point to the area we still have to fetch. During the split, the IOV covering the remaining area may remain marked as 'queued' and we'll never retry fetching it. Marking the IOV as not queued will ensure its pages will be requested again. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-