Commits
Author | Commit | Message | Commit date | Issues | |
---|---|---|---|---|---|
Kir Kolyshkin | d42955558fb | Fix compilation with gcc 7GCC 7.0 adds a new warning (which becomes an error with -Werror) telling us something like this: > CC ploop.o > ploop.c: In function ‘plooptool_list’: > ploop.c:1153:37: warning: ‘%s’ directive output may be truncated > writing up to 255 bytes into a region of size 59 [-Wformat-truncation=] > snprintf(dev, sizeof(dev), "/dev/%s", de->d_name); > ... | |||
Igor Sukhih | a3caaeba53a | ploop_if.h: add PLOOP_IOC_FREEZE and PLOOP_IOC_THAW ioctlsSigned-off-by: Igor Sukhih <igor@virtuozzo.com> | |||
Dmitry Mishin | 7ed245ccca5 | Update ploop_if.h header to the latest kernel version | |||
Dmitry Mishin | efaad138251 | Sync ploop_if.h with the latest kernel versionIntroduced new API for "push" backup scheme. This scheme have a number of advantages over traditional "pull" one: * No temporary delta which one should care of * No I/O doplication (store new data to temporary place and move after backup is done) PSBM-45001 | PSBM-45001 | ||
Igor Sukhih | 08497f002d6 | Create .statfs and DiskDescriptor.xml.lck with 644 mode (v2) #PSBM-48352For openstack we need to copy disk directory under "stack" user (not root) But in disk directory there are files without "read" permission for all user -rw-r--r-- 1 root root DiskDescriptor.xml -rw------- 1 root root DiskDescriptor.xml.lck -rw-rw-r-- 1 stack libvirtd root.hds -rw------- 1 root root .statfs v2: use fchmod to set mode Signed-off-by: Igor... | PSBM-48352 | ||
Pisarev Alexander | 14329fea474 | Fix close of 0 descriptor in case of error in grow_lower_delta. #PSBM-47329In case of node backup with CTs command line lost connection with dispatcher. It was caused by close 0 fd in case of error in grow_lower_delta before delta was open. | PSBM-47329 | ||
Igor Sukhih | 9269a83768e | libploop.h: move PLOOP_MAX_FS_SIZE to public headerSigned-off-by: Igor Sukhih <igor@virtuozzo.com> | |||
Igor Sukhih | 3833b778836 | 'ploop balloon discard --stat' does not work on not mounted image #PSBM-53998Add automount logic if ploop image is not mounted Signed-off-by: Igor Sukhih <igor@virtuozzo.com> | PSBM-53998 | ||
Igor Sukhih | 385b11f0690 | Turn off console logging for 'balloon discard --stat'To not brake output format by log messages Signed-off-by: Igor Sukhih <igor@virtuozzo.com> | |||
Kir Kolyshkin | 962a0937ea5 | ploop.8: fix typosReference: PSBM-58292 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | PSBM-58292 | ||
Kir Kolyshkin | a449c3859f6 | ploop_restore_descriptor: fix clang compilationclang 3.8.0 rightfully complains: > ploop.c:3739:24: error: comparison of unsigned expression < 0 is always false > [-Werror,-Wtautological-compare] > if (param.blocksize < 0) { > ~~~~~~~~~~~~~~~ ^ ~ Fix is easy. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 69d50ff704d | Released ploop 1.15Changes: see https://openvz.org/Download/ploop/1.15/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | dd67dc54a9f | defrag_complete: make sure cmd buf is long enoughEmploy BUILD_BUG_ON to make sure our buffer is not shorter than it should be. No runtime overhead! Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | fe49c250383 | defrag_complete(): don't use %ms in fscanfUnfortunately, on a RHEL5 system (which we still support!) we have pretty ancient gcc-4.1.2 and glibc-2.5, and they don't support %ms in fscanf, spitting the following error: cc1: warnings being treated as errors balloon.c: In function 'defrag_complete': balloon.c:1210: warning: unknown conversion type character 'm' in format balloon.c:1210: warning: too many arguments for format In fact, it'... | |||
Sergei Mamonov | 675ca48eeef | Add --defrag flag for usage and man[kir@: fix typos] | |||
Andrey Ryabinin | 756aa7ea8ad | discard/defrag: take into account image size change caused by defragDefragmentation may increase size of ploop image. In that case, 'ploop-discard --defrag --to-free X' command will not give us expected result, because delta added by defrag won't be taken into account. This patch calculates such change of image size and adds it to 'to_free' parameter so it we will discarded later. https://jira.sw.ru/browse/PSBM-42548 https://jira.sw.ru/browse/PSBM-45364 Signe... | 2 Jira Issues | ||
Igor Sukhih | fde7755a182 | ploop discard operation cancelled on fs defragmentation error #PSBM-46198fs defragmentation is optimization and should not fail the discard operation Signed-off-by: Igor Sukhih <igor@parallels.com> | PSBM-46198 | ||
Igor Sukhih | a9810288fcc | Unable to create ploop image > 16TB without filesystem inside #PSBM-45162Restriction 16T valid only for images with ext4 inside. Lets remove 16T restriction for images withousd file system Signed-off-by: Igor Sukhih <igor@parallels.com> | PSBM-45162 | ||
Kir Kolyshkin | 624ac93a92d | get_delta_fname: make staticThis is an addition to commit b738b45. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Bazhitov | 8b09007aafb | Lock and read disk descriptor before accessing it in ploop_get_*_delta_fname() (PSBM-45496)get_{top,base}_delta_guid() operate on ploop_disk_images_data structure, which must be already initialized prior to calling these functions. Call ploop_lock_dd() before calling get_{top,base}_delta_guid(). [kir@: this patch also fixes an error message in get_delta_fname()] Signed-off-by: Igor Bazhitov <ibazhitov@virtuozzo.com> | PSBM-45496 | ||
Igor Sukhih | b738b45afcd | api to get base delta file name #PSBM-46238ploop_get_base_delta_fname() [kir@: add v1.15 to include/dynload.h] Signed-off-by: Igor Sukhih <igor@parallels.com> | PSBM-46238 | ||
Kir Kolyshkin | 268cffb1dab | find_image_idx_by_file: get_basedir() only if neededSigned-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 847302c1dfa | do_mntn_merge(): fix the check for same file1. It's better to use ploop_fname_cmp() as the file names could differ. 2. Make the error more correct and descriptive. 3. Fix the error code -- this is a problem with dd.xml. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | b51495e1905 | do_mntn_merge: compile fixSince commit aeed3c3 ploop_di_merge_image() does not return the delta file name, so let's use find_image_by_guid() to get it. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 43617b3c8fb | Repair DiskDescriptot.xml on process PLOOP_MNTN_MERGE stage #PSBM-33414Online merge of top delta performed in the kernel and if ioctl(PLOOP_IOC_MERGE) was terminated, ploop device remaons in the PLOOP_MNTN_MERGE state. We heve complete on-going operation logic. if we detect PLOOP_MNTN_MERGE we do complete this operation in the kernel but do not update dd.xml This patch introduce functionlity to update dd.xml after merge completion. NB: the problem of inconsisten... | PSBM-33414 | ||
Igor Sukhih | 9791aaa4339 | ploop_complete_running_operation(): add 'struct ploop_disk_images_data' argument* rename ploop_complete_running_operation/complete_running_operation * add extra arg to complete_running_operation() * deprecate ploop_complete_running_operation() [kir@: remove PL_EXT from function proto] Signed-off-by: Igor Sukhih <igor@parallels.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | df6574016e2 | Remove temp mount point after ploop resizeReferences: #PSBM-42493 https://src.openvz.org/projects/OVZ/repos/ploop/commits/746e5937c232b8ceae5c2a50b23ec22a7a007caa https://src.openvz.org/projects/OVZ/repos/ploop/commits/0b751692117f869bf82e0c1d57276492684c38ed https://src.openvz.org/projects/OVZ/repos/ploop/commits/c51df35e1cedc5472b59d06f9ac3cb61577d5aa5 https://src.openvz.org/projects/OVZ/repos/ploop/commits/652d778da87b9d73c602a... | PSBM-42493 | ||
Kir Kolyshkin | b74dca4731b | mount_image(): kill flags argumentIt is not used anywhere. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 0606858ec20 | ploop_mount_fs: don't mount ro when finding balloon inodeWhen mounting a ploop-backed filesystem, we did the following: 1. Mount with MS_RDONLY flag. 2. stat() the balloon file to figure out its inode number 3. Remount with intended flags (usually read-write) plus the added balloon_ino=XXX option. Unfortunately, this way is not working well with applications that live in MS_SLAVE mount namespace. A slave mount namespace is a namespace to which a... | |||
Kir Kolyshkin | 2daf7c3e088 | Fix compile with gcc-5.3.0gcc-5.3.0 on Alpine Linux complains: ploop.h: In function 'ploop_ioff_to_sec': ploop.h:213:1: error: control reaches end of non-void function [-Werror=return-type] This is apparently a bug in compiler, but let it go by adding bogus "return 0" statement. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | f814766a502 | Fix compile with musl wrt gnu_dev_*Functions gnu_dev_{minor,major,makedev} are GNU extensions. Standard functions minor(), major() and makedev() should be used. This fixes compilation on Alpine Linux. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 37f82f062dc | Fix compile with musl wrt offsetofoffsetof() is defined in stddef.h, which is probably included from some other includes in GNU libc, but not in musl libc, so we get a number of errors like this: balloon_util.c:45:12: error: implicit declaration of function 'offsetof' [-Werror=implicit-function-declaration] To fix, add the proper #include. This fixes compilation for Alpine Linux. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | d15dfe3da7c | gensym.sh: busybox sed compatibilityApparently busybox sed does not understand something that GNU sed was fine with (say, ^ inside \(...\) pair). Simplify sed expression in gen_h(), making it compatible with sed from busybox suite. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | fe198091bdd | Resize ploop image mounted inside mnt namespace #PSBM-39492If ploop image mounted inside CT it not possible to use host e2resizefs to resize ext4 (mount is not visible from the node). Workaround is mount device from host. [kir@: whitespace cleanup, make mount_fs() static] Signed-off-by: Igor Sukhih <igor@parallels.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | PSBM-39492 | ||
Igor Sukhih | e8227923746 | ploop balloon discard infinite loop #PSBM-40948The next code resulted to loop for (; range.minlen >= minlen_b; range.minlen /= 2) { ... if (range.minlen != minlen_b && range.minlen / 2 < minlen_b) range.minlen = minlen_b * 2 } Signed-off-by: Igor Sukhih <igor@parallels.com> | PSBM-40948 | ||
Kir Kolyshkin | 5435d143a42 | defrag_complete(): report stale pidfileIn case the process which pid is saved to pidfile is a different process than the one we ran, or it doesn't exist, do warn about the stale pidfile. v2: check again the file exists before reporting Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 195b940550c | defrag_complete(): fix messageUse present continuous. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | a80c01c6a56 | defrag_complete(): report stale pidfileIn case the process which pid is saved to pidfile is a different process than the one we ran, or it doesn't exist, do warn about the stale pidfile. v2: check again the file exists before reporting Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | f60cd09c6e0 | defrag_complete(): check for cmdlineInstead of checking if the running process executable file on disk is the same as the one that we ran, it's slightly better to check that the executable path is the same. This is because the file might be different, for example after defrag rpm upgrade, but its name and path stays the same. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 530f5afcceb | defrag_complete(): report errorsDon't silently exit in case of errors -- an error (except for ENOENT after open() which is fine) might be an indication of something going wrong, so it's better if we report it. v2: remove access(), check for ENOENT after open(). Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | b8a49a49063 | defrag_complete: fix a typoThis is a pretty interesting case of missing ; after return, leading to ploop_log() statement after it to be executed conditionally. The only issue in this case, though, is that the message is only printed in the error case, rather than in the normal case as it should be. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | d6abd5f6d8e | balloon.c: no need to include libgen.hlibgen.h only provides POSIX version of basename() and dirname(). Neither is used from balloon.c. In fact it can be dangerous to include libgen.h, as GNU basename() can be replaced with POSIX basename() and we might rely on GNU version. As neither is used from balloon.c it's not a problem this time. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | d64c996ba25 | ploop defragmentation support #PSBM-30163ext4 defragmentation is part of 'ploop balloon discar' action If defrag functionality requested the /usr/sbin/e4defrag2 utility is called. To terminate ploop defragmentation the pid of running e4defrag2 is stored at '/var/lock/ploop/ploopN.defrag.pid' and will used to terminate defragmentation process Signed-off-by: Igor Sukhih <igor@parallels.com> | PSBM-30163 | ||
Kir Kolyshkin | 23f857a692e | copy_delta(): avoid double-freeAs pointed out by Coverity (CID 1258241), when we are reallocating buf and the second p_memalign() fails, free(buf) is called twice. Make sure to set buf to NULL after free() to avoid it. While at it, there's no need to check buf for NULL before calling free(), as free(NULL) is totally valid. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 07048d6cb13 | ploop_merge_snapshot_by_guid(): remove merge_modeGet rid of PLOOP_MERGE_WITH_CHILD|PLOOP_MERGE_WITH_PARENT logic. Now guid is snapshot guid which is to be merged to its parent. Based on patch by Igor Sukhih: https://src.openvz.org/projects/OVZ/repos/ploop/commits/b07589212937e277ab49aa27c26a02cdd23ada82 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 8d48206a801 | do_delete_snapshot(): don't use PLOOP_MERGE_WITH_CHILDThis is to simplify the logic in ploop_merge_snapshot_by_guid(). Based on patch by Igor Sukhih, see https://src.openvz.org/projects/OVZ/repos/ploop/commits/ec8d2cd3ef103e00b10711cb67524f8236f14815 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 54416bbbeba | make_fs(): drop lazy_journal_initCommit d496ba8 introduced somewhat complex retry procedure, and commits b7d4766 and 4501da4 further improved it. This patch reverts it all, instead just removing lazy_journal_init option (which is not understood by older mke2fs as pointed out in #OVZ-6539). https://bugs.openvz.org/browse/OVZ-6539 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | OVZ-6539 | ||
Igor Sukhih | 3b47889e97a | mount_image: return SYSEXIT_NOSNAP error, #PSBM-38423If snapshot does not exist provide specific error to caller. Will be used to not fail mount snapshot operation Signed-off-by: Igor Sukhih <igor@parallels.com> | PSBM-38423 | ||
Igor Sukhih | 69fca24aa21 | ploop_get_devs: fix NULL pointer dereference0 0x00007f4a8d0786bb in ploop_get_devs (di=0x13690d0, out=out@entry=0x7fff8710a2f8) at ploop.c:1205 1205 return ploop_get_dev_by_delta(di->images[0]->file, NULL, NULL, out); ploop_open_dd() does not load all metadata so it needed to call ploop_lock_dd or ploop_read_dd() to update di->images Reference: PSBM-40203 Signed-off-by: Igor Sukhih <igor@parallels.com> | PSBM-40203 | ||
Kir Kolyshkin | 4501da4b334 | make_fs(): fix a commentA comment mistakenly says about lazy_itable_init. It should be lazy_journal_init. Fix accordingly. While at it, break a particularly long line. Signed-off-by: Kir Kolyshkin <kir@openvz.org> |