From: xie xingguo Date: Tue, 14 Jun 2016 02:24:28 +0000 (+0800) Subject: mds/SessionMap: explicitly require importing_count to be postive X-Git-Tag: v11.0.0~172^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=de8bc250b9b9495739ebf23f5fb6778c20e03577;p=ceph.git mds/SessionMap: explicitly require importing_count to be postive The importing_count is of type int, thus it can go underflow and assert(importing_count) can still return false positive while it should not supposed to do so. Also this can make the assert itself more sensitive, e.g., can catch underflow errors. Signed-off-by: xie xingguo --- diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index dee8ffbf3cc..3ab7be65c83 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -186,7 +186,7 @@ public: ++importing_count; } void dec_importing() { - assert(importing_count); + assert(importing_count > 0); --importing_count; } bool is_importing() { return importing_count > 0; }