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:
parent
56e96f0e30
commit
37edd162a8
src
@ -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);
|
||||
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user