Skip to content

Commit

Permalink
Version 6.2.8.1
Browse files Browse the repository at this point in the history
- Fixed a bug which could produce a deadlock after multiple saves and
  resumes of a vdo.
  • Loading branch information
corwin committed Sep 22, 2022
1 parent 72f94c2 commit 51b4f6f
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 10 deletions.
7 changes: 4 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.7.17
%define kmod_driver_version 6.2.8.1
%define kmod_rpm_release %{spec_release}
%define kmod_kernel_version 3.10.0-693.el7

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

%changelog
* Wed Jul 13 2022 - Red Hat VDO Team <[email protected]> - 6.2.7.17-1
- Fixed a race handling timeouts of dedupe index queries.
* Thu Sep 22 2022 - Red Hat VDO Team <[email protected]> - 6.2.8.1-1
- Fixed a bug which could produce a deadlock after multiple saves and
resumes of a vdo.

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.5.1
UDS_VERSION = 8.0.6.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.7.17
VDO_VERSION = 6.2.8.1

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

#include "blockAllocatorInternals.h"
Expand Down Expand Up @@ -364,6 +364,8 @@ void queueSlab(Slab *slab)
if (!isSlabJournalBlank(slab->journal)) {
relaxedAdd64(&allocator->statistics.slabsOpened, 1);
}
} else {
resumeSlabJournal(slab->journal);
}

// All slabs are kept in a priority queue for allocation.
Expand Down
4 changes: 3 additions & 1 deletion vdo/base/recoveryJournal.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/base/recoveryJournal.c#31 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/recoveryJournal.c#34 $
*/

#include "recoveryJournal.h"
Expand Down Expand Up @@ -356,6 +356,8 @@ static void initializeJournalState(RecoveryJournal *journal)
= getRecoveryJournalBlockNumber(journal, journal->blockMapHead);
journal->slabJournalHeadBlockNumber
= getRecoveryJournalBlockNumber(journal, journal->slabJournalHead);
journal->availableSpace
= journal->entriesPerBlock * getRecoveryJournalLength(journal->size);
}

/**********************************************************************/
Expand Down
15 changes: 14 additions & 1 deletion vdo/base/slabJournal.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/base/slabJournal.c#18 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/slabJournal.c#21 $
*/

#include "slabJournalInternals.h"
Expand Down Expand Up @@ -1167,6 +1167,15 @@ bool releaseRecoveryJournalLock(SlabJournal *journal,
return true;
}

/**********************************************************************/
void resumeSlabJournal(SlabJournal *journal)
{
if ((journal->suspendType == ADMIN_STATE_SAVING) &&
!isVDOReadOnly(journal)) {
reopenSlabJournal(journal);
}
}

/**********************************************************************/
void drainSlabJournal(SlabJournal *journal)
{
Expand All @@ -1181,6 +1190,10 @@ void drainSlabJournal(SlabJournal *journal)
"slab is recovered or has no waiters");
}

if ((journal->slab->state.state == ADMIN_STATE_SUSPENDING) ||
(journal->slab->state.state == ADMIN_STATE_SAVING)) {
journal->suspendType = journal->slab->state.state;
}
switch (journal->slab->state.state) {
case ADMIN_STATE_REBUILDING:
case ADMIN_STATE_SUSPENDING:
Expand Down
12 changes: 11 additions & 1 deletion vdo/base/slabJournal.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/base/slabJournal.h#8 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/slabJournal.h#11 $
*/

#ifndef SLAB_JOURNAL_H
Expand Down Expand Up @@ -211,6 +211,16 @@ void decodeSlabJournal(SlabJournal *journal);
bool requiresScrubbing(const SlabJournal *journal)
__attribute__((warn_unused_result));

/**
* Reset slab journal state, if necessary, for a suspend-resume cycle.
*
* @param journal The slab journal to reset
*
* After a successful save, any info about locks, journal blocks
* partially filled, etc., is out of date and should be reset.
**/
void resumeSlabJournal(SlabJournal *journal);

/**
* Dump the slab journal.
*
Expand Down
5 changes: 4 additions & 1 deletion vdo/base/slabJournalInternals.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/base/slabJournalInternals.h#8 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/slabJournalInternals.h#11 $
*/

#ifndef SLAB_JOURNAL_INTERNALS_H
Expand Down Expand Up @@ -251,6 +251,9 @@ struct slabJournal {
/** This node is for BlockAllocator to keep a queue of dirty journals */
RingNode dirtyNode;

/** The type of suspend most recently performed, for use during resume */
AdminStateCode suspendType;

/** The lock for the oldest unreaped block of the journal */
JournalLock *reapLock;
/** The locks for each on disk block */
Expand Down

0 comments on commit 51b4f6f

Please sign in to comment.