Skip to content

Commit

Permalink
Version 6.1.1.24
Browse files Browse the repository at this point in the history
- Modified spec files to work with the Fedora copr repository.
- Removed obsolete nagios module.
- Fixed prerun handling of loaded kernel modules
- Modified spec files to use systemd macros
- Updated the vdo.8 man page
- Improved some error messages
  • Loading branch information
corwin committed Mar 22, 2018
1 parent a2eac78 commit de36367
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 16 deletions.
25 changes: 18 additions & 7 deletions kvdo.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%define spec_release 1

%define kmod_name kvdo
%define kmod_driver_version 6.1.1.12
%define kmod_driver_version 6.1.1.24
%define kmod_rpm_release %{spec_release}
%define kmod_kernel_version 3.10.0-693.el7
%define kmod_headers_version %(rpm -qa kernel-devel | sed 's/^kernel-devel-//')
Expand Down Expand Up @@ -135,8 +135,15 @@ fi

%preun
rpm -ql kmod-kvdo-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-%{kmod_name}-modules
modprobe -r kvdo
modprobe -r uds

# Check whether kvdo or uds is loaded, and if so attempt to remove it. A
# failure here means there is still something using the module, which should be
# cleared up before attempting to remove again.
for module in kvdo uds; do
if grep -q "^${module}" /proc/modules; then
modprobe -r ${module}
fi
done

%postun
modules=( $(cat /var/run/rpm-kmod-%{kmod_name}-modules) )
Expand Down Expand Up @@ -209,7 +216,11 @@ install -m 644 -D $PWD/obj/%{kmod_kbuild_dir}/Module.symvers $RPM_BUILD_ROOT/usr
rm -rf $RPM_BUILD_ROOT

%changelog
* Sat Feb 17 2018 - J. corwin Coburn <[email protected]> - 6.1.1.12-1
- Added support for 4.15 kernels.
- Modified spec files to support building on more distros.
- Removed unused code from the UDS module.
* Thu Mar 22 2018 - J. corwin Coburn <[email protected]> - 6.1.1.24-1
- Modified spec files to work with the Fedora copr repository.
- Removed obsolete nagios module.
- Fixed prerun handling of loaded kernel modules
- Modified spec files to use systemd macros
- Updated the vdo.8 man page
- Improved some error messages

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.1.1.12
VDO_VERSION = 6.1.1.24

VDO_VERSION_MAJOR = $(word 1,$(subst ., ,$(VDO_VERSION)))
VDO_VERSION_MINOR = $(word 2,$(subst ., ,$(VDO_VERSION)))
Expand Down
5 changes: 3 additions & 2 deletions vdo/base/statusCodes.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/magnesium/src/c++/vdo/base/statusCodes.c#3 $
* $Id: //eng/vdo-releases/magnesium/src/c++/vdo/base/statusCodes.c#5 $
*/

#include "statusCodes.h"
Expand Down Expand Up @@ -44,7 +44,7 @@ const struct errorInfo vdoStatusList[] = {
{ "VDO_BLOCK_SIZE_TOO_SMALL", "The block size is too small" },
{ "VDO_UNKNOWN_PARTITION", "No partition exists with a given id" },
{ "VDO_PARTITION_EXISTS", "A partition already exists with a given id"},
{ "VDO_NOT_CLEAN", "The device is not in a clean state" },
{ "VDO_NOT_READ_ONLY", "The device is not in read-only mode" },
{ "VDO_INCREMENT_TOO_SMALL", "Physical block growth of too few blocks" },
{ "VDO_CHECKSUM_MISMATCH", "Incorrect checksum" },
{ "VDO_RECOVERY_JOURNAL_FULL", "The recovery journal is full" },
Expand All @@ -62,6 +62,7 @@ const struct errorInfo vdoStatusList[] = {
{ "VDO_READ_CACHE_BUSY", "Read cache has no free slots" },
{ "VDO_BIO_CREATION_FAILED", "Bio creation failed" },
{ "VDO_BAD_MAGIC", "Bad magic number" },
{ "VDO_BAD_NONCE", "Bad nonce" },
{ "VDO_JOURNAL_OVERFLOW", "Journal sequence number overflow" },
};

Expand Down
8 changes: 5 additions & 3 deletions vdo/base/statusCodes.h
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/magnesium/src/c++/vdo/base/statusCodes.h#3 $
* $Id: //eng/vdo-releases/magnesium/src/c++/vdo/base/statusCodes.h#5 $
*/

#ifndef STATUS_CODES_H
Expand Down Expand Up @@ -72,8 +72,8 @@ enum vdoStatusCodes {
VDO_UNKNOWN_PARTITION,
/** a partition already exists with a given id */
VDO_PARTITION_EXISTS,
/** the VDO is not in a clean state */
VDO_NOT_CLEAN,
/** the VDO is not in read-only mode */
VDO_NOT_READ_ONLY,
/** physical block growth of too few blocks */
VDO_INCREMENT_TOO_SMALL,
/** incorrect checksum */
Expand Down Expand Up @@ -108,6 +108,8 @@ enum vdoStatusCodes {
VDO_BIO_CREATION_FAILED,
/** bad magic number */
VDO_BAD_MAGIC,
/** bad nonce */
VDO_BAD_NONCE,
/** sequence number overflow */
VDO_JOURNAL_OVERFLOW,
/** one more than last error code */
Expand Down
4 changes: 3 additions & 1 deletion vdo/base/types.h
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/magnesium/src/c++/vdo/base/types.h#5 $
* $Id: //eng/vdo-releases/magnesium/src/c++/vdo/base/types.h#6 $
*/

#ifndef TYPES_H
Expand Down Expand Up @@ -336,6 +336,8 @@ typedef struct vdoConfig {
typedef struct vdoLoadConfig {
/** the offset on the physical layer where the VDO begins */
PhysicalBlockNumber firstBlockOffset;
/** the expected nonce of the VDO */
Nonce nonce;
/** the thread configuration of the VDO */
ThreadConfig *threadConfig;
/** the page cache size, in pages */
Expand Down
9 changes: 8 additions & 1 deletion vdo/base/vdoLoad.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/magnesium/src/c++/vdo/base/vdoLoad.c#3 $
* $Id: //eng/vdo-releases/magnesium/src/c++/vdo/base/vdoLoad.c#5 $
*/

#include "vdoLoad.h"
Expand Down Expand Up @@ -261,6 +261,12 @@ static int startVDODecode(VDO *vdo, bool validateConfig)
return VDO_SUCCESS;
}

if (vdo->loadConfig.nonce != vdo->nonce) {
return logErrorWithStringError(VDO_BAD_NONCE, "Geometry nonce %" PRIu64
" does not match superblock nonce %" PRIu64,
vdo->loadConfig.nonce, vdo->nonce);
}

BlockCount blockCount = vdo->layer->getBlockCount(vdo->layer);
return validateVDOConfig(&vdo->config, blockCount, true);
}
Expand Down Expand Up @@ -540,6 +546,7 @@ int loadVDO(PhysicalLayer *layer,
}

vdo->loadConfig.firstBlockOffset = getDataRegionOffset(geometry);
vdo->loadConfig.nonce = geometry.nonce;
result = loadSuperBlock(layer, getFirstBlockOffset(vdo), &vdo->superBlock);
if (result != VDO_SUCCESS) {
freeVDO(&vdo);
Expand Down
3 changes: 2 additions & 1 deletion 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/magnesium/src/c++/vdo/kernel/dmvdo.c#12 $
* $Id: //eng/vdo-releases/magnesium/src/c++/vdo/kernel/dmvdo.c#13 $
*/

#include "dmvdo.h"
Expand Down Expand Up @@ -751,6 +751,7 @@ static int vdoInitialize(struct dm_target *ti,
// Now that we have read the geometry, we can finish setting up the
// VDOLoadConfig.
loadConfig.firstBlockOffset = getDataRegionOffset(layer->geometry);
loadConfig.nonce = layer->geometry.nonce;

if (config->cacheSize < (2 * MAXIMUM_USER_VIOS
* loadConfig.threadConfig->logicalZoneCount)) {
Expand Down

0 comments on commit de36367

Please sign in to comment.