Skip to content

Commit

Permalink
Version 6.2.7.9
Browse files Browse the repository at this point in the history
- Fixed bug which could result in empty flushes being issued to the storage
  below vdo while suspended.
- Fixed syntax mismatch which prevented lvm from being able to configure a
  512MB UDS index.
  • Loading branch information
corwin committed May 4, 2022
1 parent afe3b1e commit 65e143b
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 13 deletions.
9 changes: 6 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.6.14
%define kmod_driver_version 6.2.7.9
%define kmod_rpm_release %{spec_release}
%define kmod_kernel_version 3.10.0-693.el7

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

%changelog
* Thu Feb 10 2022 - Red Hat VDO Team <[email protected]> - 6.2.6.14-1
- Fixed stack frame warnings when building with the debug kernel.
* Wed May 04 2022 - Red Hat VDO Team <[email protected]> - 6.2.7.9-1
- Fixed bug which could result in empty flushes being issued to the storage
below vdo while suspended.
- Fixed syntax mismatch which prevented lvm from being able to configure a
512MB UDS index.
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.4.2
UDS_VERSION = 8.0.5.1

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.6.14
VDO_VERSION = 6.2.7.9

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/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#38 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/kernelLayer.c#39 $
*/

#include "kernelLayer.h"
Expand Down Expand Up @@ -1056,7 +1056,7 @@ int modifyKernelLayer(KernelLayer *layer,
return result;
}
}

return VDO_SUCCESS;
}

Expand Down Expand Up @@ -1303,6 +1303,7 @@ int suspendKernelLayer(KernelLayer *layer)
* the suspend, even if it hasn't been flushed yet.
*/
waitForNoRequestsActive(layer);
drainKVDOFlushes(layer);
int result = synchronousFlush(layer);
if (result != VDO_SUCCESS) {
setKVDOReadOnly(&layer->kvdo, result);
Expand Down
9 changes: 6 additions & 3 deletions vdo/kernel/kernelLayer.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/aluminum/src/c++/vdo/kernel/kernelLayer.h#18 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/kernelLayer.h#19 $
*/

#ifndef KERNELLAYER_H
Expand Down Expand Up @@ -132,6 +132,9 @@ struct kernelLayer {
// for REQ_FLUSH processing
struct bio_list waitingFlushes;
KVDOFlush *spareKVDOFlush;
uint32_t activeFlushCount;
bool flushesDraining;
struct completion flushCompletion;
spinlock_t flushLock;
Jiffies flushArrivalTime;
/**
Expand All @@ -150,8 +153,8 @@ struct kernelLayer {
/** Optional work queue for calling bio_endio. */
KvdoWorkQueue *bioAckQueue;
/** Underlying block device info. */
uint64_t startingSectorOffset;
VolumeGeometry geometry;
uint64_t startingSectorOffset;
VolumeGeometry geometry;
// Memory allocation
BufferPool *dataKVIOPool;
struct bio_set *bioset;
Expand Down
48 changes: 46 additions & 2 deletions vdo/kernel/kvdoFlush.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/kvdoFlush.c#6 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/kvdoFlush.c#7 $
*/

#include "kvdoFlush.h"

#include <linux/delay.h>

#include "logger.h"
#include "memoryAlloc.h"

Expand Down Expand Up @@ -131,7 +133,7 @@ void launchKVDOFlush(KernelLayer *layer, BIO *bio)

// We have flushes to start. Capture them in the KVDOFlush object.
initializeKVDOFlush(kvdoFlush, layer);

layer->activeFlushCount++;
spin_unlock(&layer->flushLock);

// Finish launching the flushes.
Expand All @@ -152,9 +154,17 @@ static void releaseKVDOFlush(KVDOFlush *kvdoFlush)
KernelLayer *layer = kvdoFlush->layer;
bool relaunchFlush = false;
bool freeFlush = false;
bool drained = false;

spin_lock(&layer->flushLock);

if (bio_list_empty(&layer->waitingFlushes)) {
--layer->activeFlushCount;
if ((layer->activeFlushCount == 0) && layer->flushesDraining) {
layer->flushesDraining = false;
drained = true;
}

// Nothing needs to be started. Save one spare KVDOFlush object.
if (layer->spareKVDOFlush == NULL) {
// Make the new spare all zero, just like a newly allocated one.
Expand All @@ -176,6 +186,10 @@ static void releaseKVDOFlush(KVDOFlush *kvdoFlush)
} else if (freeFlush) {
FREE(kvdoFlush);
}

if (drained) {
complete(&layer->flushCompletion);
}
}

/**
Expand Down Expand Up @@ -220,6 +234,36 @@ void kvdoCompleteFlush(VDOFlush **kfp)
}
}

/**********************************************************************/
void drainKVDOFlushes(KernelLayer *layer)
{
bool drained;

spin_lock(&layer->flushLock);
if (layer->activeFlushCount == 0) {
ASSERT_LOG_ONLY(bio_list_empty(&layer->waitingFlushes),
"no flush bios are waiting when flushes are inactive");
drained = true;
} else {
layer->flushesDraining = true;
init_completion(&layer->flushCompletion);
drained = false;
}
spin_unlock(&layer->flushLock);

if (drained) {
return;
}

// Using the "interruptible" interface means that Linux will not log a
// message when we wait for more than 120 seconds.
while (wait_for_completion_interruptible(&layer->flushCompletion) != 0) {
// However, if we get a signal in a user-mode process, we could
// spin...
msleep(1);
}
}

/**********************************************************************/
int synchronousFlush(KernelLayer *layer)
{
Expand Down
9 changes: 8 additions & 1 deletion vdo/kernel/kvdoFlush.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/aluminum/src/c++/vdo/kernel/kvdoFlush.h#1 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/kvdoFlush.h#2 $
*/

#ifndef KVDO_FLUSH_H
Expand Down Expand Up @@ -61,6 +61,13 @@ void launchKVDOFlush(KernelLayer *layer, BIO *bio);
**/
void kvdoCompleteFlush(VDOFlush **kfp);

/**
* Wait until there are no active KVDOFlushes or bios waiting to flush.
*
* @param layer The physical layer
**/
void drainKVDOFlushes(KernelLayer *layer);

/**
* Issue a flush request and wait for it to complete.
*
Expand Down

0 comments on commit 65e143b

Please sign in to comment.