From ac7c1dca0a4f6e92e50d362784122e2d3200e6b5 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sun, 18 Sep 2016 10:43:10 +0800 Subject: [PATCH] tools/rebuild_mondb: return error if ondisk version of pg_info is incompatible In this case "r" will be >= 0 and caller will be able to catch this kind of error. Signed-off-by: xie xingguo --- src/tools/rebuild_mondb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rebuild_mondb.cc b/src/tools/rebuild_mondb.cc index a8d36ec0f02de..232df75ff622e 100644 --- a/src/tools/rebuild_mondb.cc +++ b/src/tools/rebuild_mondb.cc @@ -410,7 +410,7 @@ int update_pgmap_pg(ObjectStore& fs, MonitorDBStore& ms) } if (struct_v < PG::cur_struct_v) { cerr << "incompatible pg_info: v" << struct_v << std::endl; - return r; + return -EINVAL; } version_t latest_epoch = 0; r = ms.get(prefix, stringify(pgid.pgid), bl); -- 2.39.5