Skip to content

Commit

Permalink
Version 6.2.5.62
Browse files Browse the repository at this point in the history
- Fixed chapter computation for a converted sparse index.
- Fixed invalidation of converted chapters.
- Removed extraneous fields from the super block of a converted index.
- Fixed calculation of the number of expiring chapters in a converted
  index.
- Fixed bugs rebuilding a converted index.
  • Loading branch information
corwin committed Jul 12, 2021
1 parent df68a45 commit e11cbd8
Show file tree
Hide file tree
Showing 22 changed files with 208 additions and 138 deletions.
12 changes: 8 additions & 4 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.5.41
%define kmod_driver_version 6.2.5.62
%define kmod_rpm_release %{spec_release}
%define kmod_kernel_version 3.10.0-693.el7

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

%changelog
* Thu May 27 2021 - Red Hat VDO Team <[email protected]> - 6.2.5.41-1
- Fixed bugs in reading the UDS index of a VDO volume which was converted
to LVM.
* Mon Jul 12 2021 - Red Hat VDO Team <[email protected]> - 6.2.5.62-1
- Fixed chapter computation for a converted sparse index.
- Fixed invalidation of converted chapters.
- Removed extraneous fields from the super block of a converted index.
- Fixed calculation of the number of expiring chapters in a converted
index.
- Fixed bugs rebuilding a converted 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.3.21
UDS_VERSION = 8.0.3.34

SOURCES = $(notdir $(wildcard $(src)/*.c)) murmur/MurmurHash3.c
SOURCES += $(addprefix util/,$(notdir $(wildcard $(src)/util/*.c)))
Expand Down
2 changes: 1 addition & 1 deletion uds/config.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/uds-releases/jasper/src/uds/config.h#5 $
* $Id: //eng/uds-releases/jasper/src/uds/config.h#6 $
*/

#ifndef CONFIG_H
Expand Down
33 changes: 27 additions & 6 deletions uds/geometry.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/uds-releases/jasper/src/uds/geometry.c#8 $
* $Id: //eng/uds-releases/jasper/src/uds/geometry.c#9 $
*/

#include "geometry.h"
Expand Down Expand Up @@ -209,10 +209,31 @@ bool isChapterSparse(const Geometry *geometry,
}

/**********************************************************************/
bool areSamePhysicalChapter(const Geometry *geometry,
uint64_t chapter1,
uint64_t chapter2)
unsigned int chaptersToExpire(const Geometry *geometry, uint64_t newestChapter)
{
return (mapToPhysicalChapter(geometry, chapter1)
== mapToPhysicalChapter(geometry, chapter2));
// If the index isn't full yet, don't expire anything.
if (newestChapter < geometry->chaptersPerVolume) {
return 0;
}

// If a chapter is out of order...
if (geometry->remappedPhysical > 0) {
uint64_t oldestChapter = newestChapter - geometry->chaptersPerVolume;

// ... expire an extra chapter when expiring the moved chapter
// to free physical space for the new chapter ...
if (oldestChapter == geometry->remappedVirtual) {
return 2;
}

// ... but don't expire anything when the new chapter will use
// the physical chapter freed by expiring the moved chapter.
if (oldestChapter
== (geometry->remappedVirtual + geometry->remappedPhysical)) {
return 0;
}
}

// Normally, just expire one.
return 1;
}
19 changes: 7 additions & 12 deletions uds/geometry.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/uds-releases/jasper/src/uds/geometry.h#8 $
* $Id: //eng/uds-releases/jasper/src/uds/geometry.h#9 $
*/

#ifndef GEOMETRY_H
Expand Down Expand Up @@ -219,7 +219,7 @@ unsigned int mapToPhysicalChapter(const Geometry *geometry,

/**
* Check whether this geometry is reduced by a chapter
*
*
* @param geometry The geometry to check
*
* @return true if this geometry is reduced by a chapter
Expand Down Expand Up @@ -276,19 +276,14 @@ bool isChapterSparse(const Geometry *geometry,
__attribute__((warn_unused_result));

/**
* Check whether two virtual chapter numbers correspond to the same
* physical chapter.
* Calculate how many chapters to expire after opening the newest chapter.
*
* @param geometry The geometry of the index
* @param chapter1 The first chapter to compare
* @param chapter2 The second chapter to compare
* @param geometry The geometry of the index
* @param newestChapter The newest virtual chapter number
*
* @return <code>true</code> if both chapters correspond to the same
* physical chapter
* @return The number of oldest chapters to expire
**/
bool areSamePhysicalChapter(const Geometry *geometry,
uint64_t chapter1,
uint64_t chapter2)
unsigned int chaptersToExpire(const Geometry *geometry, uint64_t newestChapter)
__attribute__((warn_unused_result));

#endif /* GEOMETRY_H */
9 changes: 3 additions & 6 deletions uds/index.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/uds-releases/jasper/src/uds/index.c#15 $
* $Id: //eng/uds-releases/jasper/src/uds/index.c#16 $
*/

#include "index.h"
Expand Down Expand Up @@ -878,11 +878,8 @@ void getIndexStats(Index *index, UdsIndexStats *counters)
void advanceActiveChapters(Index *index)
{
index->newestVirtualChapter++;
if (areSamePhysicalChapter(index->volume->geometry,
index->newestVirtualChapter,
index->oldestVirtualChapter)) {
index->oldestVirtualChapter++;
}
index->oldestVirtualChapter +=
chaptersToExpire(index->volume->geometry, index->newestVirtualChapter);
}

/**********************************************************************/
Expand Down
Loading

0 comments on commit e11cbd8

Please sign in to comment.