Commits
Author | Commit | Message | Commit date | Issues | |
---|---|---|---|---|---|
Kir Kolyshkin | 110d209ee67 | Released ploop 1.12.1Changelog: see https://openvz.org/Download/ploop/1.12.1/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 0d8bf29313e | ploop_copy_send: wait for send_thread to finishThis should fix a race condition between the main process and send_thread. The problem is that the main process doesn't wait for send_thread to finish its work, incorrectly assuming that if it can take the mutex lock again, the send_thread has already finished. But there might be a situation when send_thread() still waits in pthread_cond_wait() (with the mutex lock released), while async_send ... | |||
Kir Kolyshkin | 1ff79b26941 | ploop_copy_send: use while in pthread_cond_waitIt's a common practice and a good thing to recheck the condition after being woken up. Reported-by: Maxim Patlasov <mpatlasov@parallels.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | e32afb06d54 | ploop mount: add check for host mount optsAs pointed out in bug #3030, ext4 fs that hosts ploop images should not be mounted with data=writeback as it increases chances of broken ploop. This patch adds a check for such mount option -- if it is found then a warning message is printed once, suggesting to not use it. https://bugzilla.openvz.org/3030 Reported-by: Devon <devon.b@virtualcomplete.com> Signed-off-by: Kir Kolyshkin <kir@open... | |||
Kir Kolyshkin | a077fe7bc49 | send_thread(): move mutex lock/unlock out of do/whileAs suggested by Maxim, there is no point to release a mutex and immediately take it again. Reported-by: Maxim Patlasov <mpatlasov@parallels.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 27b48271bb8 | async_send(): call pthread_cond_signal() with mutex lockedFrom pthread_conf_signal man page: > The pthread_cond_broadcast() or pthread_cond_signal() functions may be > called by a thread whether or not it currently owns the mutex that > threads calling pthread_cond_wait() or pthread_cond_timedwait() have > associated with the condition variable during their waits; however, if > predictable scheduling behavior is required, then that mutex s... | |||
Kir Kolyshkin | 8279bdaf0ec | ploop_is_large_disk_supported(): check ploop module firstA user got the following error: > # ploop snapshot-switch -u cc0930cb-0e5e-46d8-9f4d-83567ce8fb38 DiskDescriptor.xml > Opening delta /vz/private/120/root.hdd/root.hdd > del snapshot {5fbaabe3-6958-40ff-92a7-860e329aab41} > Adding snapshot {5fbaabe3-6958-40ff-92a7-860e329aab41} > Storing /vz/private/120/root.hdd/DiskDescriptor.xml.tmp > Error in do_create_delta (ploop.c:345): Unknown ploop imag... | |||
Kir Kolyshkin | 32e630837e8 | ploop_switch_snapshot_ex(): don't show error on ENOENT rmA failure to remove old top delta is not fatal, plus if ENOENT is returned it doesn't make sense to even show the error. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 7e0365c0f8f | tune_fs(): fix check for non-implemented ioctlThe check was obviously broken -- errno values are positive. This is a fix to commit 5a0ab39. Reference: ploop@1044468 Reported-by: Corrado Fiore <lists@corradofiore.it> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 33c7e878d5b | Released ploop 1.12Changelog: see https://openvz.org/Download/ploop/1.12/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | b68f919cacb | ploop info help: add -dThis is an addition to commit 0b51f0d. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 276dfc7aa4e | ploop_check(): use reopen_rw()1. reopen_rw(): check the result of close(), reassign new fd 2. modify check_and_repair_sparse to use *fd not fd 3. use reopen_rw() in ploop_check() Reference: ploop@1037067 | |||
Igor Sukhih | 9c528410b89 | [style] check.c: rearrange code to remove function declarationmove up: static int reopen_rw(const char *image, int *fd); static int fill_hole(const char *image, int *fd, off_t start, off_t end, int *log, int repair); static int check_and_repair_sparse(const char *image, int fd, __u64 cluster, int flags); Reference: ploop@1037054 | |||
Igor Sukhih | f9eb8195141 | ploop_check: fixed reopen fd logicThis is a fix to commit 1bfbe42. Reference: ploop@1037051 | |||
Kir Kolyshkin | 058480ef46a | make_fs(): add tunefs -e remount-roAs suggested in bug #3025, it is good to remount ploop inner filesystem read-only as soon as kernel sees it is corrupted, in order to prevent any more damage. https://bugzilla.openvz.org/3025 Reported-by: Pavel Odintsov <pavel.odintsov@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 1bfbe4236bb | ploop_check(): don't pass -1 to closeThis fixes a complain from Coverity Scan: > CID 1228664 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS) > negative_returns: fd is passed to a parameter that cannot be negative. While at it, use close_safe() to close the old fd, so we can detect and report an error. Reference: ploop@1036954 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | e548c2d2e09 | check_and_repair_sparse(): reopen image rw if neededAfter the commit r1036784, we can be in the situation when image is opened as read-only but check_and_repair_sparse() needs to write to it. As we don't know beforehand whether we will need to write to an image file or not, let's fix it in a somewhat kludgy way -- as soon as we found out we need to write, check opened fd mode and reopen the image read/write if necessary. Note this is only perfo... | 2 Jira Issues | ||
Kir Kolyshkin | b3aae6bc170 | fill_hole: use *fdReplace fd argument with pointer to it. This is a preparation for the next commit, to make it easier to read. Reference: ploop@1036951 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 7ea107768d6 | check_and_repair_sparse: use fill_hole ret codeSince fill_hole returns SYSEXIT_* values it makes sense to return those explicitly. Reference: ploop@1036950 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 164d098eab6 | fill_hole(): no need to bzero static bufIn C, statically-allocated objects without an explicit initializer are initialized to zero, so there is no need for explicit bzero(). While at it, mark buf as const to make sure it is kept as is (all zeroes). Reference: ploop@1036949 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | d5cbe9ae829 | ploop_check(): open image RO, reopen RW laterMost of the time writing to the image file is not required, so let's optimize for this case and open the file read only. Later, if an image has dirty flag set, of CHECK_DETAILED is set, reopen the file in read/write mode. This also helps with filesystems on which opening the file read/write is more expensive than opening it read-only. Reference: PSBM-26499 References: ploop@1036784, ploop@103... | PSBM-26499 | ||
Kir Kolyshkin | a25968cf30f | ploop_create_{image,dd}: use ploop_di_add_image ret valueAs ploop_di_add_image is always returning proper SYSEXIT_* code, let's just use it directly, saving a couple lines of code. This also fixes a few cases of returning SYSEXIT_MALLOC instead of SYSEXIT_PARAM which ploop_di_add_image() returns sometimes. Reference: ploop@1031842 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 0da809ed5a3 | Added ploop_create_dd()Added functionality to create DiskDescriptor.xml at custom path int ploop_create_dd(const char *ddxml, struct ploop_create_param *param) Reference: PSBM-26581 References: ploop@1031445, ploop@1031841 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | PSBM-26581 | ||
Igor Sukhih | 8e5b3a75cc1 | fsutils.c: quiet fsckfsck output can broke tools parser. There is no quiet option for fsck so just redirect stdout to /dev/null # fsck -p /dev/ploop26995p1 fsck from util-linux-ng 2.17.2 /dev/ploop26995p1: clean, 12/655360 files, 83119/2620928 blocks [kir@: errors from fsck will still be shown on stderr] Reference: PSBM-26738 Reference: ploop@1008262 | PSBM-26738 | ||
Kir Kolyshkin | a093baa5839 | ploop_get_max_size: improve description, move to cWe do not have descriptions of our public functions in libploop.h file, so let's not start doing it. So far, the best documentation for such functions is their code itself, so let's keep the description close to the code. This is an addition to the previous commit 71be8d5 Cc: Nikolay Shirokovskiy <nshirokovskiy@parallels.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Nikolay Shirokovskiy | b46eecff3e6 | ploop_get_max_size(): add[kir@: add dynload.h entry] Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@parallels.com> Acked-by: Igor Sukhih <igor@parallels.com> Reference: PSBM-26570 - ""ploop convert" fails to convert the container due to huge limit for "diskinodes"" Reference: ploop@1028131 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | PSBM-26570 | ||
Kir Kolyshkin | 5d606213507 | De-introduce SYSEXIT_INUSEThis was introduced by the previous commit 22ff44b (aka ploop@1025736) for the sole purpose of reporting the "in-use flag is set" condition from get_image_param_offline(), which, in turn, takes it from errno value explicitly set to EBUSY by open_delta(). This condition is then checked in the only place -- do_create_snapshot(). Note that SYSEXIT_* codes are part of public API, but this new valu... | |||
Igor Sukhih | ebb6e5213b3 | create_snapshot: clear stale top delta inuse flagSometimes after the node crash the top delta in-use flag is left set, so snapshot creation returns an error. Handle this particular case by calling check_delta to validate top delta and drop inuse flag on create snapshot. Reference: PSBM-27694 "Failed to create the snapshot: Operation failed. %1 after node crash" References: ploop@1025736, ploop@1026188 Signed-off-by: Kir Kolyshkin <kir@openv... | PSBM-27694 | ||
Kir Kolyshkin | c9439349f67 | ploop(8): document ploop info -dThis is an addition to commit 0b51f0d Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Nikolay Shirokovskiy | 0b51f0d7d85 | ploop info: add -d to show ploop deviceReference: PSBM-26990 Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@parallels.com> Acked-by: Igor Sukhih <igor@parallels.com> References: ploop@1025015, ploop@1026043 | PSBM-26990 | ||
Kir Kolyshkin | 9d151b06195 | tune_fs: fix error message, assorted nitpicksA few nitpicks after commit 5a0ab39 (ploop@1022894), in the order of importance; 1. Fix an error message (s/for size/to/, obviously a copy-paste error) 2. Pass errno to ploop_err() to know why ioctl failed 3. An empty line between variable declarations and code 4. Some more empty lines to improve code readability. 5. A comma in a comment. Reference: ploop@1025878 Signed-off-by: Kir Kolysh... | |||
Dmitriy Monakhov | 5a0ab39da92 | tune_fs(): use EXT4_IOC_SET_RSV_BLOCKS if availableWe have to update reservation block counts according to balloon size. One can do that directly via tune2fs which is not good for mounted fs, and should use this ioctl instead EXT4_IOC_SET_RSV_BLOCKS is available since 042stab092.1. In case it's not there, fall back to old implementation. Signed-off-by: dmonakhov@openvz.org Committed-by: igor@openvz.org Reference: PSBM-25929 "Error in __ploop_... | PSBM-25929 | ||
Igor Sukhih | 71c50ce3835 | ploop_delete_snapshot: fix for temp snapshotIn case snapshot guid supplied is one of temp snapshot, we first implicitly delete it in merge_temporary_snapshots(), then try to delete it again explicitly in do_delete_snapshot() and we fail. To fix, move merge_temporary_snapshots() to after do_delete_snapshot. Reference: PSBM-27327 "Error in do_delete_snapshot (snapshot.c:61): Can't find snapshot by uuid" Reference: ploop@1021028, ploop@10... | PSBM-27327 | ||
Kir Kolyshkin | 01e7bd62da5 | reset_top_delta(): rm irrelevant messageApparently a copy-paste leftover. This is an addition to commit 86f3119 (ploop@1019626) Reference: ploop@1020175 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 86f31196486 | ploop_switch_snapshot_ex: fixed case with PLOOP_SNAP_SKIP_TOPDELTA_CREATEThe PLOOP_SNAP_SKIP_TOPDELTA_CREATE used in rollback, move logic to separate function Reference: ploop@1019626 | |||
Igor Sukhih | 9f7a9f831be | merge_temporary_snapshots: fix infinite loopIn case a snapshot with references deleted, there's an infinite loop. Reference: ploop@1019621 | |||
Kir Kolyshkin | 89b657c221a | do_delete_snapshot(): fix a warningFix and improve a warning message about inability to remove a snapshot with >1 references to it, and marking it as temp. This is an addition to commit ploop@1016663 aka 32711a4. Reference: ploop@1016859 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | eeb46fe42c9 | do_delete_snapshot: deny delete top delta in case parent snapshot is temporaryCreating temporary snapshot and deleting top delta broke DiskDescriptor.xml: ploop tsnapshot -u {aff55492-7320-4d72-aedd-c1e303a22cc1} -c test DiskDescriptor.xml ploop snapshot-delete -u {5fbaabe3-6958-40ff-92a7-860e329aab41} DiskDescriptor.xml ploop mount DiskDescriptor.xml Error in validate_disk_descriptor (xml.c:327): Validation of /vz/igor/Virtuozzo/current/ploop/DiskDescriptor.xml f... | |||
Igor Sukhih | 32711a466da | BUGFIX Can not delete snapshot with multiple refsThe direct way to delete snapshot with > 1 references is to make a copy of a snapshot image and merge with the copy * Delete A A -> B => A -> B => B \-> C A -> C A -> C Let's handle in another way, mark as temporary and merge when it will be possible Reference: PSBM-27154 "Can not delete snapshot of Container - double referenced" Reference: ploop@1016663 | PSBM-27154 | ||
Kir Kolyshkin | d77b58792cf | ploop_switch_snapshot_ex(): don't return 0 if guid_old is badCode checks that param->guid_old is (1) valid and (2) non-existent, and prints and error if any of those checks fails, but returns 0 instead of an error. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 31fc986e249 | do_delete_snapshot: fix wrt temp snapshot uuidTemporary snapshot uuid is changed if topdelta is deleted. Call check_snapshot_mount() to validate snapshot-delete action Use case: ploop tsnapshot ploop snapshot-delete <TOP_DELTA_UUID> Reference: ploop@1015313 | |||
Kir Kolyshkin | 17a8a4181dc | ploop_resize_image(): handle get_mount_dir() errorget_mount_dir() return value is not boolean, but rather a 3-state. It doesn't make sense to proceed if it returned an error, as it's probably fatal. While at it, document get_mount_dir() return values. Signed-off-by: Kir Kolyshkin <kir@openvz.org> git-svn-id: https://svn.parallels.com/parallels/vzlin/utils/current/ploop@1015021 3f79cd19-dd19-0410-83c5-8b167e6f9dce Signed-off-by: Kir Kolyshki... | |||
Igor Sukhih | a60cc48a742 | ploop_resize_image: auto-mount fsProblem: unable to resize ploop if it is running but fs is not mounted Solution: automount file system before performing online resize Reference: PSBM-26764 Reference: ploop@1013361 | PSBM-26764 | ||
Kir Kolyshkin | d83a0ff52c4 | ploop_store_diskdescriptor(): fix error msgAfter commit b519e4c, we call a different function, so fix the error message accordingly. @noreview Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | b1026985fca | ploop_store_diskdescriptor: fix typo, show errno1 s/Faled/Failed/ to fix a typo. 2 s/Failed/Can't/ to use a verb we tend to use more often. 3 Pass errno to ploop_err() to show why exactly we can't. This is an addition to commit b519e4c Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | b519e4c630e | ploop_store_diskdescriptor: fsync DiskDescriptor.xmlProblem: DiskDescriptor.xml is empty after host's hard reboot Solution: call fsync() before rename Reference: PSBM-27028 Reference: ploop@1013886 | PSBM-27028 | ||
Kir Kolyshkin | 802af7ca006 | ploop copy: fix open_mount_point err handlingBefore this patch: # ploop -vvvv copy -s /dev/ploop47147 -d file [ 0.000337] Error in open_mount_point (pcopy.c:357): Can't open : No such file or directory Apparently, ploop_get_mnt_by_dev() can return 1 in case there is no error, but mount point can't be found, therefore we should check for non-zero, not just < 0. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | cdfea9d65c9 | ploop_copy_send(): fix potential NULL derefAs pointed out by Coverity, CID 1216781. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | c0c69ddc376 | ploop_copy_send(): add check for feedback_fdIf feedback_fd is specified, check that it is a pipe or a socket. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 9af38b5d5b5 | ploop_copy_receive(): improve fd checksUse is_fd_pipe() to check both input fd and feedback fd. Also, print fd in error message. Signed-off-by: Kir Kolyshkin <kir@openvz.org> |