From 94390a3296483323d1b2c57856ea2e8ecca99b64 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 (cherry picked from commit ac7c1dca0a4f6e92e50d362784122e2d3200e6b5) --- 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 af3532cb56975..b853439187e72 100644 --- a/src/tools/rebuild_mondb.cc +++ b/src/tools/rebuild_mondb.cc @@ -412,7 +412,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