From e3b7d825696c23c23f6bd867de4dbda69be38db8 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 13 Nov 2017 14:02:16 +0000 Subject: [PATCH 1/4] [cache_restore] v2 dirty bitset root wasn't being written to superblock. Resulting in corrupt restored data. --- caching/metadata.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/caching/metadata.cc b/caching/metadata.cc index 91806f4..7b150be 100644 --- a/caching/metadata.cc +++ b/caching/metadata.cc @@ -128,6 +128,10 @@ void metadata::commit_mappings() { sb_.mapping_root = mappings_->get_root(); + if (sb_.version >= 2) { + dirty_bits_->flush(); + sb_.dirty_root = dirty_bits_->get_root(); + } } void From f48f533d753800dd753cdc9748a12330c2c6200b Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 13 Nov 2017 14:11:22 +0000 Subject: [PATCH 2/4] bump version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0a1ffad..8bd6ba8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.4 +0.7.5 From 1253d720e9f995374280e853ad3846ae3989be5f Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 13 Nov 2017 14:18:07 +0000 Subject: [PATCH 3/4] update CHANGES --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 16bf825..491c24a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +v0.7.5 +====== + +- Fix a bug that stopped cache_restore working with metadata version 2. + v0.7.4 ====== From 39809c17b2e87ba5db0cd9feeeafc386be21207b Mon Sep 17 00:00:00 2001 From: csonto Date: Tue, 14 Nov 2017 16:09:11 +0100 Subject: [PATCH 4/4] [*_restore] Fix leaking file descriptor (#89) --- base/file_utils.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base/file_utils.cc b/base/file_utils.cc index b8741d2..7173000 100644 --- a/base/file_utils.cc +++ b/base/file_utils.cc @@ -151,6 +151,8 @@ file_utils::zero_superblock(std::string const &path) memset(buffer, 0, SUPERBLOCK_SIZE); if (::write(fd, buffer, SUPERBLOCK_SIZE) != SUPERBLOCK_SIZE) throw runtime_error("couldn't zero superblock"); + + ::close(fd); } //----------------------------------------------------------------