From 2d9eaa1c569658333ef616b8bb140a7f2d749264 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Fri, 7 Aug 2020 01:06:46 +0800 Subject: [PATCH] [metadata_checker] Do not update the superblock if the needs_check flag is not set --- thin-provisioning/metadata_checker.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/thin-provisioning/metadata_checker.cc b/thin-provisioning/metadata_checker.cc index b3e05c1..fd47cac 100644 --- a/thin-provisioning/metadata_checker.cc +++ b/thin-provisioning/metadata_checker.cc @@ -449,6 +449,10 @@ namespace { block_manager::ptr bm = open_bm(path_, block_manager::READ_WRITE); superblock_detail::superblock sb = read_superblock(bm); + + if (!sb.get_needs_check_flag()) + return true; + sb.set_needs_check_flag(false); write_superblock(bm, sb);