From 1b39ce3ff11a0c7cc742dc3f1aae2161df7cc6ab Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Fri, 7 Dec 2007 13:33:25 -0800 Subject: [PATCH] Ensure that segments with reused metadata are listed in root descriptor. --- metadata.cc | 5 +++++ scandir.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/metadata.cc b/metadata.cc index f972b75..c27278b 100644 --- a/metadata.cc +++ b/metadata.cc @@ -269,6 +269,11 @@ void MetadataWriter::metadata_flush() ObjectReference indirect; for (list::iterator i = items.begin(); i != items.end(); ++i) { + // If indirectly referencing any other metadata logs, be sure those + // segments are properly referenced. + if (i->reused) + add_segment(i->ref.get_segment()); + // Write out an indirect reference to any previous objects which could // be reused if (!i->reused || !indirect.merge(i->ref)) { diff --git a/scandir.cc b/scandir.cc index 654f9fb..cf66ea6 100644 --- a/scandir.cc +++ b/scandir.cc @@ -138,7 +138,7 @@ int64_t dumpfile(int fd, dictionary &file_info, const string &path, const ObjectReference &ref = *i; object_list.push_back(ref.to_string()); if (ref.is_normal()) - segment_list.insert(ref.get_segment()); + add_segment(ref.get_segment()); db->UseObject(ref); } size = stat_buf.st_size; @@ -228,7 +228,7 @@ int64_t dumpfile(int fd, dictionary &file_info, const string &path, object_list.push_back(ref.to_string()); if (ref.is_normal()) - segment_list.insert(ref.get_segment()); + add_segment(ref.get_segment()); db->UseObject(ref); size += bytes; -- 2.20.1