From a99a41fcdb05a9cc1ffb991abcade8d52211f3d8 Mon Sep 17 00:00:00 2001 From: Yan Song Date: Wed, 8 Mar 2023 03:05:13 +0000 Subject: [PATCH] rafs: do not fix blob id for old bootstrap In fact, there is no way to tell if a separate old bootstrap file was inline to the blob, for example, for an old merged bootstrap, we can't set the blob id it references to as the filename, otherwise it will break blob table on loading rafs. Signed-off-by: Yan Song --- rafs/src/metadata/mod.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rafs/src/metadata/mod.rs b/rafs/src/metadata/mod.rs index 2111595d5c7..99dccee5a3a 100644 --- a/rafs/src/metadata/mod.rs +++ b/rafs/src/metadata/mod.rs @@ -718,21 +718,11 @@ impl RafsSuper { // Old converters extracts bootstraps from data blobs with inlined bootstrap // use blob digest as the bootstrap file name. The last blob in the blob table from // the bootstrap has wrong blod id, so we need to fix it. - let mut fixed = false; let blobs = rs.superblock.get_blob_infos(); for blob in blobs.iter() { // Fix blob id for new images with old converters. if blob.has_feature(BlobFeatures::INLINED_FS_META) { blob.set_blob_id_from_meta_path(path.as_ref())?; - fixed = true; - } - } - if !fixed && !blob_accessible && !blobs.is_empty() { - // Fix blob id for old images with old converters. - let last = blobs.len() - 1; - let blob = &blobs[last]; - if !blob.has_feature(BlobFeatures::CAP_TAR_TOC) { - rs.set_blob_id_from_meta_path(path.as_ref())?; } } }