diff --git a/kvdo.spec b/kvdo.spec index cb274673..73a430bf 100644 --- a/kvdo.spec +++ b/kvdo.spec @@ -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-//') @@ -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) ) @@ -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 - 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 - 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 + diff --git a/vdo/Makefile b/vdo/Makefile index 01b5260f..2819e4e8 100644 --- a/vdo/Makefile +++ b/vdo/Makefile @@ -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))) diff --git a/vdo/base/statusCodes.c b/vdo/base/statusCodes.c index 74ab5b04..4ed025fa 100644 --- a/vdo/base/statusCodes.c +++ b/vdo/base/statusCodes.c @@ -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" @@ -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" }, @@ -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" }, }; diff --git a/vdo/base/statusCodes.h b/vdo/base/statusCodes.h index 9df13220..bf3b08da 100644 --- a/vdo/base/statusCodes.h +++ b/vdo/base/statusCodes.h @@ -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 @@ -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 */ @@ -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 */ diff --git a/vdo/base/types.h b/vdo/base/types.h index cc24eeae..319ef8fb 100644 --- a/vdo/base/types.h +++ b/vdo/base/types.h @@ -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 @@ -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 */ diff --git a/vdo/base/vdoLoad.c b/vdo/base/vdoLoad.c index b5e6051e..74302b1b 100644 --- a/vdo/base/vdoLoad.c +++ b/vdo/base/vdoLoad.c @@ -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" @@ -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); } @@ -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); diff --git a/vdo/kernel/dmvdo.c b/vdo/kernel/dmvdo.c index ec3766a9..123010e2 100644 --- a/vdo/kernel/dmvdo.c +++ b/vdo/kernel/dmvdo.c @@ -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" @@ -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)) {