From bff426da22bb8c31e28c39f6b72a31d8cbe05cce Mon Sep 17 00:00:00 2001 From: sageweil Date: Wed, 10 Oct 2007 21:20:18 +0000 Subject: [PATCH] uninit bug, struct padding, debug git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1916 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/sage/mds/client/Client.cc | 1 + branches/sage/mds/common/Logger.cc | 6 +++++- branches/sage/mds/ebofs/Ebofs.cc | 1 + branches/sage/mds/include/buffer.h | 1 + branches/sage/mds/include/frag.h | 2 +- branches/sage/mds/msg/msg_types.h | 3 ++- branches/sage/mds/osd/OSD.cc | 6 +++++- 7 files changed, 16 insertions(+), 4 deletions(-) diff --git a/branches/sage/mds/client/Client.cc b/branches/sage/mds/client/Client.cc index aac84c5491b3e..4a7e6baacaf5a 100644 --- a/branches/sage/mds/client/Client.cc +++ b/branches/sage/mds/client/Client.cc @@ -470,6 +470,7 @@ Inode* Client::insert_trace(MClientReply *reply) } else { // not root. Dir *dir = cur->open_dir(); + assert(pdn != reply->get_trace_dn().end()); cur = this->insert_inode(dir, *pin, *pdn); dout(10) << "insert_trace dn " << *pdn << " ino " << (*pin)->inode.ino << " -> " << cur << dendl; ++pdn; diff --git a/branches/sage/mds/common/Logger.cc b/branches/sage/mds/common/Logger.cc index 4a2a6d89b071f..2e7db26027a57 100644 --- a/branches/sage/mds/common/Logger.cc +++ b/branches/sage/mds/common/Logger.cc @@ -212,8 +212,10 @@ void Logger::_flush() } else { if (fvals[i] > 0 && vals[i] == 0) out << "\t" << fvals[i]; - else + else { + //cout << this << " p " << i << " and size is " << vals.size() << std::endl; out << "\t" << vals[i]; + } } } out << std::endl; @@ -265,6 +267,7 @@ long Logger::set(const char *key, long v) if (i < 0) i = type->add_set(key); maybe_resize(i+1); + //cout << this << " set " << i << " to " << v << std::endl; long r = vals[i] = v; logger_lock.Unlock(); return r; @@ -279,6 +282,7 @@ double Logger::fset(const char *key, double v) if (i < 0) i = type->add_set(key); maybe_resize(i+1); + //cout << this << " fset " << i << " to " << v << std::endl; double r = fvals[i] = v; logger_lock.Unlock(); return r; diff --git a/branches/sage/mds/ebofs/Ebofs.cc b/branches/sage/mds/ebofs/Ebofs.cc index 97cba8285b463..b1f6ab7539467 100644 --- a/branches/sage/mds/ebofs/Ebofs.cc +++ b/branches/sage/mds/ebofs/Ebofs.cc @@ -410,6 +410,7 @@ void Ebofs::prepare_super(version_t epoch, bufferptr& bp) // put in a buffer bp = buffer::create_page_aligned(EBOFS_BLOCK_SIZE); + bp.zero(); memcpy(bp.c_str(), (const char*)&sb, sizeof(sb)); } diff --git a/branches/sage/mds/include/buffer.h b/branches/sage/mds/include/buffer.h index b6255d6ace457..5e48b6ce91bf6 100644 --- a/branches/sage/mds/include/buffer.h +++ b/branches/sage/mds/include/buffer.h @@ -716,6 +716,7 @@ public: unsigned gap = append_buffer.unused_tail_length(); if (gap > 0) { if (gap > len) gap = len; + //cout << "append first char is " << data[0] << ", last char is " << data[len-1] << std::endl; append_buffer.append(data, gap); append(append_buffer, append_buffer.end() - gap, gap); // add segment to the list len -= gap; diff --git a/branches/sage/mds/include/frag.h b/branches/sage/mds/include/frag.h index 41d040b172821..eac9d5bfa9e36 100644 --- a/branches/sage/mds/include/frag.h +++ b/branches/sage/mds/include/frag.h @@ -165,7 +165,7 @@ class fragtree_t { // pairs : // frag_t f is split by b bits. // if child frag_t does not appear, it is not split. - std::map _splits; + std::map _splits; public: // ------------- diff --git a/branches/sage/mds/msg/msg_types.h b/branches/sage/mds/msg/msg_types.h index 23c14c8c25c11..648d6a4f5ee92 100644 --- a/branches/sage/mds/msg/msg_types.h +++ b/branches/sage/mds/msg/msg_types.h @@ -108,8 +108,9 @@ struct entity_addr_t { uint8_t ipq[4]; uint32_t port; uint32_t nonce; // bind time, or pid, or something unique! + uint32_t _pad; - entity_addr_t() : port(0), nonce(0) { + entity_addr_t() : port(0), nonce(0), _pad(0) { ipq[0] = ipq[1] = ipq[2] = ipq[3] = 0; } diff --git a/branches/sage/mds/osd/OSD.cc b/branches/sage/mds/osd/OSD.cc index 30c320c623aac..ab57f0c603302 100644 --- a/branches/sage/mds/osd/OSD.cc +++ b/branches/sage/mds/osd/OSD.cc @@ -838,6 +838,8 @@ void OSD::send_pg_stats() bool OSD::_share_map_incoming(const entity_inst_t& inst, epoch_t epoch) { bool shared = false; + dout(20) << "_share_map_incoming " << inst << " " << epoch << dendl; + assert(osd_lock.is_locked()); // does client have old map? if (inst.name.is_client()) { @@ -851,8 +853,10 @@ bool OSD::_share_map_incoming(const entity_inst_t& inst, epoch_t epoch) // does peer have old map? if (inst.name.is_osd()) { // remember - if (peer_map_epoch[inst.name] < epoch) + if (peer_map_epoch[inst.name] < epoch) { + dout(20) << "peer " << inst.name << " has " << epoch << dendl; peer_map_epoch[inst.name] = epoch; + } // older? if (peer_map_epoch[inst.name] < osdmap->get_epoch()) { -- 2.39.5