diff --git a/kvdo.spec b/kvdo.spec index 636841c8..c787d202 100644 --- a/kvdo.spec +++ b/kvdo.spec @@ -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 @@ -96,6 +96,7 @@ rm -rf $RPM_BUILD_ROOT %{_usr}/src/%{kmod_name}-%{version} %changelog -* Wed Jul 13 2022 - Red Hat VDO Team - 6.2.7.17-1 -- Fixed a race handling timeouts of dedupe index queries. +* Thu Sep 22 2022 - Red Hat VDO Team - 6.2.8.1-1 +- Fixed a bug which could produce a deadlock after multiple saves and + resumes of a vdo. diff --git a/uds/Makefile b/uds/Makefile index 4f323d13..531f3d1b 100644 --- a/uds/Makefile +++ b/uds/Makefile @@ -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))) diff --git a/vdo/Makefile b/vdo/Makefile index e597c1d7..43798a37 100644 --- a/vdo/Makefile +++ b/vdo/Makefile @@ -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))) diff --git a/vdo/base/blockAllocator.c b/vdo/base/blockAllocator.c index edaad38c..4f0def01 100644 --- a/vdo/base/blockAllocator.c +++ b/vdo/base/blockAllocator.c @@ -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" @@ -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. diff --git a/vdo/base/recoveryJournal.c b/vdo/base/recoveryJournal.c index f77eae80..de8861c8 100644 --- a/vdo/base/recoveryJournal.c +++ b/vdo/base/recoveryJournal.c @@ -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" @@ -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); } /**********************************************************************/ diff --git a/vdo/base/slabJournal.c b/vdo/base/slabJournal.c index c12ef7d3..a5c1cde2 100644 --- a/vdo/base/slabJournal.c +++ b/vdo/base/slabJournal.c @@ -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" @@ -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) { @@ -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: diff --git a/vdo/base/slabJournal.h b/vdo/base/slabJournal.h index 0e7b26ac..332fa858 100644 --- a/vdo/base/slabJournal.h +++ b/vdo/base/slabJournal.h @@ -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 @@ -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. * diff --git a/vdo/base/slabJournalInternals.h b/vdo/base/slabJournalInternals.h index c519c3e8..d6f22496 100644 --- a/vdo/base/slabJournalInternals.h +++ b/vdo/base/slabJournalInternals.h @@ -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 @@ -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 */