1
0
mirror of https://github.com/ceph/ceph synced 2024-12-25 21:03:31 +00:00

mds: fix integer truncation

Client ID is a 64-bit integer. Unlike Ceph daemons, it may go beyond
2147483647 and cause problems.

Signed-off-by: Henry Chang <henry@bigtera.com>
This commit is contained in:
Henry Chang 2015-04-22 11:52:18 +08:00
parent 56e96f0e30
commit 37edd162a8
2 changed files with 6 additions and 6 deletions

View File

@ -695,7 +695,7 @@ void Server::reconnect_clients()
void Server::handle_client_reconnect(MClientReconnect *m)
{
dout(7) << "handle_client_reconnect " << m->get_source() << dendl;
int from = m->get_source().num();
client_t from = m->get_source().num();
Session *session = get_session(m);
assert(session);

View File

@ -39,7 +39,7 @@ public:
static const int TYPE_OSD = CEPH_ENTITY_TYPE_OSD;
static const int TYPE_CLIENT = CEPH_ENTITY_TYPE_CLIENT;
static const int NEW = -1;
static const int64_t NEW = -1;
// cons
entity_name_t() : _type(0), _num(0) { }
@ -48,10 +48,10 @@ public:
_type(n.type), _num(n.num) { }
// static cons
static entity_name_t MON(int i=NEW) { return entity_name_t(TYPE_MON, i); }
static entity_name_t MDS(int i=NEW) { return entity_name_t(TYPE_MDS, i); }
static entity_name_t OSD(int i=NEW) { return entity_name_t(TYPE_OSD, i); }
static entity_name_t CLIENT(int i=NEW) { return entity_name_t(TYPE_CLIENT, i); }
static entity_name_t MON(int64_t i=NEW) { return entity_name_t(TYPE_MON, i); }
static entity_name_t MDS(int64_t i=NEW) { return entity_name_t(TYPE_MDS, i); }
static entity_name_t OSD(int64_t i=NEW) { return entity_name_t(TYPE_OSD, i); }
static entity_name_t CLIENT(int64_t i=NEW) { return entity_name_t(TYPE_CLIENT, i); }
int64_t num() const { return _num; }
int type() const { return _type; }