Skip to content

Commit

Permalink
Version 6.2.7.9
Browse files Browse the repository at this point in the history
- Fixed excessive vdo2lvm "Retrying" messages.
- Fixed a pylint 2+ complaint in the vdo scripts.
  • Loading branch information
corwin committed May 4, 2022
1 parent 17879e8 commit 055c579
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 29 deletions.
2 changes: 1 addition & 1 deletion utils/uds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# UDS interfaces exported from libuds.so. DISTRIBUTION_VERSION is the long
# version name used in distribution builds. We extract these values from the
# traditional location.
UDS_VERSION = 8.0.4.2
UDS_VERSION = 8.0.5.1
BUILD_VERSION = $(UDS_VERSION)
DISTRO_CODENAME := $(shell lsb_release -s -c)

Expand Down
2 changes: 1 addition & 1 deletion utils/vdo/base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# $Id: //eng/vdo-releases/aluminum/src/packaging/src-dist/user/utils/vdo/base/Makefile#2 $

VDO_VERSION = 6.2.6.14
VDO_VERSION = 6.2.7.9

UDS_DIR = ../../uds

Expand Down
2 changes: 1 addition & 1 deletion utils/vdo/user/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# $Id: //eng/vdo-releases/aluminum/src/packaging/src-dist/user/utils/vdo/user/Makefile#17 $

VDO_VERSION = 6.2.6.14
VDO_VERSION = 6.2.7.9

UDS_DIR = ../../uds
VDO_BASE_DIR = ../base
Expand Down
5 changes: 3 additions & 2 deletions utils/vdo/user/parseUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/user/parseUtils.c#3 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/user/parseUtils.c#4 $
*/

#include "parseUtils.h"
Expand Down Expand Up @@ -108,7 +108,8 @@ static int parseMem(char *string, uint32_t *sizePtr)
UdsMemoryConfigSize mem;
if (strcmp(string, "0.25") == 0) {
mem = UDS_MEMORY_CONFIG_256MB;
} else if (strcmp(string, "0.5") == 0) {
} else if ((strcmp(string, "0.5") == 0)
|| (strcmp(string, "0.50") == 0)) {
mem = UDS_MEMORY_CONFIG_512MB;
} else if (strcmp(string, "0.75") == 0) {
mem = UDS_MEMORY_CONFIG_768MB;
Expand Down
38 changes: 26 additions & 12 deletions utils/vdo/user/vdoprepareforlvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/user/vdoPrepareForLVM.c#4 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/user/vdoPrepareForLVM.c#5 $
*/

#include <err.h>
Expand All @@ -43,6 +43,11 @@

#include "fileLayer.h"

enum {
MAX_OPEN_RETRIES = 25,
OPEN_RETRY_SLEEP_MICROSECONDS = 200000,
};

static const char usageString[] =
" [--help] [--version] [--check] filename";

Expand Down Expand Up @@ -148,22 +153,31 @@ static const char *processArgs(int argc, char *argv[])
static int openDeviceExclusively(int *descriptorPtr)
{
int fd, result;
unsigned int retries = 25;
unsigned int micro_sec_delay = 200000;

while (((fd = open(fileName, O_RDWR | O_EXCL | O_NONBLOCK)) < 0)
&& retries--) {
if (!retries) {
unsigned int retry = 0;
int modeFlags = O_RDWR | O_EXCL;

// Initially attempt to open non-blocking so we can control how long
// we wait for exclusive access.
while ((fd = open(fileName, modeFlags | O_NONBLOCK)) < 0) {
retry++;
if (retry == 1) {
printf("Device %s is in use. Retrying...", fileName);
fflush(stdout);
} else if (retry > MAX_OPEN_RETRIES) {
printf("\n");
return EBUSY;
} else if ((retry % (1000000 / OPEN_RETRY_SLEEP_MICROSECONDS)) == 0) {
// Indicate we're still trying about every second.
printf(".");
fflush(stdout);
}

usleep(micro_sec_delay);
printf("Retrying in use check for %s.\n", fileName);
usleep(OPEN_RETRY_SLEEP_MICROSECONDS);
}

// Now that the device is open, unset O_NONBLOCK flag to prevent subsequent
// I/Os from not being delayed or blocked correctly
result = fcntl(fd, F_SETFL, O_RDWR | O_EXCL);
// Now that the device is open, unset O_NONBLOCK flag to ensure subsequent
// I/Os are delayed or blocked correctly.
result = fcntl(fd, F_SETFL, modeFlags);
if (result != VDO_SUCCESS) {
warnx("Unable to clear non-blocking flag for %s", fileName);
close(fd);
Expand Down
10 changes: 5 additions & 5 deletions vdo-manager/statistics/VDOStatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ def __init__(self, name="VDOStatistics", **kwargs):
Uint64Field("physicalBlocks"),
# number of logical blocks
Uint64Field("logicalBlocks"),
Uint64Field("oneKBlocks", label = "1K-blocks", derived = "$physicalBlocks * $blockSize // 1024"),
Uint64Field("oneKBlocksUsed", label = "1K-blocks used", available = "not $inRecoveryMode", derived = "($dataBlocksUsed + $overheadBlocksUsed) * $blockSize // 1024"),
Uint64Field("oneKBlocksAvailable", derived = "($physicalBlocks - $dataBlocksUsed - $overheadBlocksUsed) * $blockSize // 1024", available = "not $inRecoveryMode", label = "1K-blocks available"),
Uint64Field("oneKBlocks", derived = "$physicalBlocks * $blockSize // 1024", label = "1K-blocks"),
Uint64Field("oneKBlocksUsed", derived = "($dataBlocksUsed + $overheadBlocksUsed) * $blockSize // 1024", label = "1K-blocks used", available = "not $inRecoveryMode"),
Uint64Field("oneKBlocksAvailable", derived = "($physicalBlocks - $dataBlocksUsed - $overheadBlocksUsed) * $blockSize // 1024", label = "1K-blocks available", available = "not $inRecoveryMode"),
Uint8Field("usedPercent", derived = "int((100 * ($dataBlocksUsed + $overheadBlocksUsed) // $physicalBlocks) + 0.5)", available = "((not $inRecoveryMode) and ($mode != b'read-only'))"),
Uint8Field("savings", display = False, available = "not $inRecoveryMode", derived = "int(100 * ($logicalBlocksUsed - $dataBlocksUsed) // $logicalBlocksUsed) if ($logicalBlocksUsed > 0) else -1"),
Uint8Field("savings", derived = "int(100 * ($logicalBlocksUsed - $dataBlocksUsed) // $logicalBlocksUsed) if ($logicalBlocksUsed > 0) else -1", available = "not $inRecoveryMode", display = False),
Uint8Field("savingPercent", derived = "$savings if ($savings >= 0) else NotAvailable()", available = "((not $inRecoveryMode) and ($mode != b'read-only'))"),
# Size of the block map page cache, in bytes
Uint64Field("blockMapCacheSize"),
Expand All @@ -217,7 +217,7 @@ def __init__(self, name="VDOStatistics", **kwargs):
# Number of times the VDO has recovered from read-only mode
Uint64Field("readOnlyRecoveries", label = "read-only recovery count"),
# String describing the operating mode of the VDO
StringField("mode", length = 15, label = "operating mode"),
StringField("mode", label = "operating mode", length = 15),
# Whether the VDO is in recovery mode
BoolField("inRecoveryMode", display = False),
# What percentage of recovery mode work has been completed
Expand Down
4 changes: 2 additions & 2 deletions vdo-manager/utils/Command.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""
Command - runs commands and manages their results
$Id: //eng/vdo-releases/aluminum/src/python/vdo/utils/Command.py#1 $
$Id: //eng/vdo-releases/aluminum/src/python/vdo/utils/Command.py#2 $
"""
from __future__ import absolute_import
Expand Down Expand Up @@ -202,7 +202,7 @@ def __init__(self, commandList, environment=None):

######################################################################
def __str__(self):
' '.join(self._commandList)
return ' '.join(self._commandList)

######################################################################
# Protected methods
Expand Down
9 changes: 4 additions & 5 deletions vdo.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Summary: Management tools for Virtual Data Optimizer
Name: vdo
Version: 6.2.6.14
Version: 6.2.7.9
Release: %{spec_release}%{?dist}
License: GPLv2
Source0: %{name}-%{version}.tgz
Expand Down Expand Up @@ -184,8 +184,7 @@ This package provides the user-space support tools for VDO.
%{_mandir}/man8/vdoregenerategeometry.8.gz

%changelog
* Thu Feb 10 2022 - Red Hat VDO Team <[email protected]> - 6.2.6.14-1
- Updated the vdo man page to explain issues with import.
- Added a tool to make LVMVDO pools read/write so that support and
debugging tools may access them.
* Wed May 04 2022 - Red Hat VDO Team <[email protected]> - 6.2.7.9-1
- Fixed excessive vdo2lvm "Retrying" messages.
- Fixed a pylint 2+ complaint in the vdo scripts.

0 comments on commit 055c579

Please sign in to comment.