Skip to content

Commit

Permalink
Version 6.1.0.181
Browse files Browse the repository at this point in the history
- Fixed a bug which would cause kernel panics when a VDO device is stacked
  on a RAID50 device.
- Fixed a bug which could cause data loss when discarding unused portions
  of a VDO's logical space.
- Modified grow physical to fail in the prepare step if the size isn't
  changing, avoiding a suspend-and-resume cycle.
  • Loading branch information
corwin committed Jul 20, 2018
1 parent 5380820 commit fb4b94f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 40 deletions.
6 changes: 3 additions & 3 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.0.175
%define kmod_driver_version 6.1.0.181
%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 @@ -196,5 +196,5 @@ install -m 644 -D $PWD/obj/%{kmod_kbuild_dir}/Module.symvers $RPM_BUILD_ROOT/usr
rm -rf $RPM_BUILD_ROOT

%changelog
* Tue Jun 19 2018 - J. corwin Coburn <[email protected]> - 6.1.0.175-1
HASH(0x28d1cd0)
* Fri Jul 20 2018 - J. corwin Coburn <[email protected]> - 6.1.0.181-1
HASH(0x1b7e068)
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.0.175
VDO_VERSION = 6.1.0.181

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

#include "dataVIO.h"
Expand Down Expand Up @@ -92,6 +92,9 @@ void prepareDataVIO(DataVIO *dataVIO,
bool isTrim,
VDOAction *callback)
{
// Clearing the tree lock must happen before initializing the LBN lock,
// which also adds information to the tree lock.
memset(&dataVIO->treeLock, 0, sizeof(dataVIO->treeLock));
initializeLBNLock(dataVIO, lbn);
initializeRing(&dataVIO->hashLockNode);
initializeRing(&dataVIO->writeNode);
Expand Down
9 changes: 2 additions & 7 deletions vdo/base/vdoResize.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-rhel7.5/src/c++/vdo/base/vdoResize.c#1 $
* $Id: //eng/vdo-releases/magnesium-rhel7.5/src/c++/vdo/base/vdoResize.c#2 $
*/

#include "vdoResize.h"
Expand Down Expand Up @@ -215,11 +215,6 @@ static void growPhysicalCallback(VDOCompletion *completion)
/**********************************************************************/
int performGrowPhysical(VDO *vdo, BlockCount newPhysicalBlocks)
{
if ((vdo->config.physicalBlocks == newPhysicalBlocks)
&& (getNextVDOLayoutSize(vdo->layout) == 0)) {
return VDO_SUCCESS;
}

if (newPhysicalBlocks != getNextVDOLayoutSize(vdo->layout)) {
/*
* Either the VDO isn't prepared to grow, or it was prepared to grow
Expand Down Expand Up @@ -256,7 +251,7 @@ int prepareToGrowPhysical(VDO *vdo, BlockCount newPhysicalBlocks)
if (newPhysicalBlocks == vdo->config.physicalBlocks) {
finishVDOLayoutGrowth(vdo->layout);
abandonNewSlabs(vdo->depot);
return VDO_SUCCESS;
return VDO_PARAMETER_MISMATCH;
}

int result = prepareToGrowVDOLayout(vdo->layout, vdo->config.physicalBlocks,
Expand Down
27 changes: 1 addition & 26 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/magnesium-rhel7.5/src/c++/vdo/kernel/dmvdo.c#3 $
* $Id: //eng/vdo-releases/magnesium-rhel7.5/src/c++/vdo/kernel/dmvdo.c#4 $
*/

#include "dmvdo.h"
Expand Down Expand Up @@ -148,27 +148,6 @@ static int vdoMapBio(struct dm_target *ti, BIO *bio)
return kvdoMapBio(layer, bio);
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
/**********************************************************************/
static int vdoMerge(struct dm_target *ti,
struct bvec_merge_data *bvm,
struct bio_vec *biovec,
int max_size)
{
KernelLayer *layer = ti->private;
struct request_queue *q = bdev_get_queue(layer->dev->bdev);

if (!q->merge_bvec_fn) {
return max_size;
}

bvm->bi_bdev = layer->dev->bdev;
bvm->bi_sector = bvm->bi_sector - ti->begin;

return min(max_size, q->merge_bvec_fn(q, bvm, biovec));
}
#endif

/**********************************************************************/
static void vdoIoHints(struct dm_target *ti, struct queue_limits *limits)
{
Expand Down Expand Up @@ -984,10 +963,6 @@ static struct target_type vdoTargetBio = {
.postsuspend = vdoPostsuspend,
.preresume = vdoPreresume,
.resume = vdoResume,
// Put version specific functions at the bottom
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
.merge = vdoMerge,
#endif
};

static bool dmRegistered = false;
Expand Down
10 changes: 8 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/magnesium-rhel7.5/src/c++/vdo/kernel/kernelLayer.c#4 $
* $Id: //eng/vdo-releases/magnesium-rhel7.5/src/c++/vdo/kernel/kernelLayer.c#5 $
*/

#include "kernelLayer.h"
Expand Down Expand Up @@ -1216,7 +1216,13 @@ int prepareToResizePhysical(KernelLayer *layer, BlockCount physicalCount)
layer->allocationsAllowed = false;
if (result != VDO_SUCCESS) {
// kvdoPrepareToGrowPhysical logs errors.
return result;
if (result == VDO_PARAMETER_MISMATCH) {
// If we don't trap this case, mapToSystemError() will remap it to -EIO,
// which is misleading and ahistorical.
return -EINVAL;
} else {
return result;
}
}

logInfo("Done preparing to resize physical");
Expand Down

0 comments on commit fb4b94f

Please sign in to comment.