Skip to content

Commit

Permalink
Version 6.2.4.26
Browse files Browse the repository at this point in the history
- Modified physical growth to validate the new VDO size against the size of
  the underlying storage.
- Fixed issues which prevented lvrename from working on lvm managed
  VDO devices.
  • Loading branch information
corwin committed Nov 2, 2020
1 parent 57c50fd commit 052080f
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 17 deletions.
6 changes: 3 additions & 3 deletions kvdo.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%define spec_release 1
%define kmod_name kvdo
%define kmod_driver_version 6.2.4.14
%define kmod_driver_version 6.2.4.26
%define kmod_rpm_release %{spec_release}
%define kmod_kernel_version 3.10.0-693.el7

Expand Down Expand Up @@ -85,5 +85,5 @@ rm -rf $RPM_BUILD_ROOT
%{_usr}/src/%{kmod_name}-%{version}-%{kmod_driver_version}/*

%changelog
* Thu Oct 01 2020 - Red Hat VDO Group <[email protected]> - 6.2.4.14-1
HASH(0x55c9459fe3b8)
* Mon Nov 02 2020 - Red Hat VDO Group <[email protected]> - 6.2.4.26-1
HASH(0x5645fb62bab0)
2 changes: 1 addition & 1 deletion uds/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UDS_VERSION = 8.0.2.2
UDS_VERSION = 8.0.2.4

SOURCES = $(notdir $(wildcard $(src)/*.c)) murmur/MurmurHash3.c
SOURCES += $(addprefix util/,$(notdir $(wildcard $(src)/util/*.c)))
Expand Down
2 changes: 1 addition & 1 deletion vdo/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VDO_VERSION = 6.2.4.14
VDO_VERSION = 6.2.4.26

VDO_VERSION_MAJOR = $(word 1,$(subst ., ,$(VDO_VERSION)))
VDO_VERSION_MINOR = $(word 2,$(subst ., ,$(VDO_VERSION)))
Expand Down
25 changes: 15 additions & 10 deletions vdo/kernel/dmvdo.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/kernel/dmvdo.c#39 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/dmvdo.c#42 $
*/

#include "dmvdo.h"
Expand Down Expand Up @@ -582,17 +582,13 @@ static int vdoInitialize(struct dm_target *ti,
/**********************************************************************/
static int vdoCtr(struct dm_target *ti, unsigned int argc, char **argv)
{
// Mild hack to avoid bumping instance number when we needn't.
char *poolName;
int result = getPoolNameFromArgv(argc, argv, &ti->error, &poolName);
if (result != VDO_SUCCESS) {
return -EINVAL;
}

int result = VDO_SUCCESS;

RegisteredThread allocatingThread;
registerAllocatingThread(&allocatingThread, NULL);

KernelLayer *oldLayer = findLayerMatching(layerIsNamed, poolName);
const char *deviceName = dm_device_name(dm_table_get_md(ti->table));
KernelLayer *oldLayer = findLayerMatching(layerIsNamed, (void *)deviceName);
unsigned int instance;
if (oldLayer == NULL) {
result = allocateKVDOInstance(&instance);
Expand Down Expand Up @@ -727,6 +723,15 @@ static int vdoPreresume(struct dm_target *ti)
KernelLayer *layer = getKernelLayerForTarget(ti);
DeviceConfig *config = ti->private;
RegisteredThread instanceThread;

BlockCount backingBlocks = getUnderlyingDeviceBlockCount(layer);
if (backingBlocks < config->physicalBlocks) {
logError("resume of device '%s' failed: backing device has %" PRIu64
" blocks but VDO physical size is %llu blocks",
config->poolName, backingBlocks, config->physicalBlocks);
return -EINVAL;
}

registerThreadDevice(&instanceThread, layer);

if (getKernelLayerState(layer) == LAYER_STARTING) {
Expand Down Expand Up @@ -786,7 +791,7 @@ static void vdoResume(struct dm_target *ti)
static struct target_type vdoTargetBio = {
.features = DM_TARGET_SINGLETON,
.name = "vdo",
.version = {6, 2, 2},
.version = {6, 2, 3},
.module = THIS_MODULE,
.ctr = vdoCtr,
.dtr = vdoDtr,
Expand Down
51 changes: 49 additions & 2 deletions vdo/kernel/kernelLayer.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/kernel/kernelLayer.c#37 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/kernelLayer.c#38 $
*/

#include "kernelLayer.h"
Expand Down Expand Up @@ -105,7 +105,9 @@ static BlockCount kvdoGetBlockCount(PhysicalLayer *header)
/**********************************************************************/
bool layerIsNamed(KernelLayer *layer, void *context)
{
return (strcmp(layer->deviceConfig->poolName, (char *) context) == 0);
struct dm_target *ti = layer->deviceConfig->owningTarget;
const char *deviceName = dm_device_name(dm_table_get_md(ti->table));
return (strcmp(deviceName, (const char *) context) == 0);
}

/**
Expand Down Expand Up @@ -958,6 +960,41 @@ int prepareToModifyKernelLayer(KernelLayer *layer,
return VDO_SUCCESS;
}

/**********************************************************************
* Modify the pool name of the device.
*
* @param layer The kernel layer
* @param oldName The old pool name
* @param newName The new pool name
*
* @return VDO_SUCCESS or an error
*
*/
int modifyPoolName(KernelLayer *layer, char *oldName, char *newName)
{
// We use pool name for sysfs and procfs. Rename them accordingly
logInfo("Modify pool name from %s to %s", oldName, newName);

void *procfsPrivate;
int result = vdoCreateProcfsEntry(layer, newName, &procfsPrivate);
if (result != VDO_SUCCESS) {
return result;
}

result = kobject_rename(&layer->kobj, newName);
if (result != 0) {
vdoDestroyProcfsEntry(newName, procfsPrivate);
return result;
}

void *tmpProcfs = layer->procfsPrivate;
layer->procfsPrivate = procfsPrivate;

vdoDestroyProcfsEntry(oldName, tmpProcfs);

return VDO_SUCCESS;
}

/**********************************************************************/
int modifyKernelLayer(KernelLayer *layer,
DeviceConfig *config)
Expand Down Expand Up @@ -1010,6 +1047,16 @@ int modifyKernelLayer(KernelLayer *layer,
}
}

if (strcmp(config->poolName, extantConfig->poolName) != 0) {
logInfo("Modifying device '%s' pool name from %s to %s",
config->poolName, extantConfig->poolName, config->poolName);
int result = modifyPoolName(layer, extantConfig->poolName,
config->poolName);
if (result != VDO_SUCCESS) {
return result;
}
}

return VDO_SUCCESS;
}

Expand Down

0 comments on commit 052080f

Please sign in to comment.