Skip to content

Commit

Permalink
Merge remote-tracking branch 'gh/next'
Browse files Browse the repository at this point in the history
  • Loading branch information
liewegas committed Nov 13, 2014
2 parents 4509674 + 20f99ca commit c15391b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/crush/CrushWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -779,11 +779,11 @@ class CrushWrapper {
// get the parent bucket
crush_bucket *parent_bucket = get_bucket(parent_id);

// zero out the bucket weight
crush_bucket_adjust_item_weight(parent_bucket, item, 0);
adjust_item_weight(cct, parent_bucket->id, parent_bucket->weight);

if (!IS_ERR(parent_bucket)) {
// zero out the bucket weight
crush_bucket_adjust_item_weight(parent_bucket, item, 0);
adjust_item_weight(cct, parent_bucket->id, parent_bucket->weight);

// remove the bucket from the parent
crush_bucket_remove_item(parent_bucket, item);
} else if (PTR_ERR(parent_bucket) != -ENOENT) {
Expand Down
1 change: 0 additions & 1 deletion src/mds/Mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ struct MDRequestImpl : public MutationImpl, public TrackedOp {
int getattr_caps; ///< caps requested by getattr

bufferlist reply_extra_bl;
bufferlist reply_snapbl;

// inos we did a embedded cap release on, and may need to eval if we haven't since reissued
map<vinodeno_t, ceph_seq_t> cap_releases;
Expand Down
3 changes: 0 additions & 3 deletions src/mds/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,6 @@ void Server::early_reply(MDRequestRef& mdr, CInode *tracei, CDentry *tracedn)
}

reply->set_extra_bl(mdr->reply_extra_bl);
assert(mdr->reply_snapbl.length() == 0); // only used on mksnap
req->get_connection()->send_message(reply);

mdr->did_early_reply = true;
Expand Down Expand Up @@ -1060,7 +1059,6 @@ void Server::reply_client_request(MDRequestRef& mdr, MClientReply *reply)
// We can set the extra bl unconditionally: if it's already been sent in the
// early_reply, set_extra_bl will have claimed it and reply_extra_bl is empty
reply->set_extra_bl(mdr->reply_extra_bl);
reply->snapbl = mdr->reply_snapbl;

reply->set_mdsmap_epoch(mds->mdsmap->get_epoch());
client_con->send_message(reply);
Expand Down Expand Up @@ -7531,7 +7529,6 @@ void Server::_mksnap_finish(MDRequestRef& mdr, CInode *diri, SnapInfo &info)
// yay
mdr->in[0] = diri;
mdr->snapid = info.snapid;
mdr->reply_snapbl = diri->snaprealm->get_snap_trace();
mdr->tracei = diri;
respond_to_request(mdr, 0);
}
Expand Down
12 changes: 7 additions & 5 deletions src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8007,8 +8007,8 @@ void OSD::handle_op(OpRequestRef& op, OSDMapRef& osdmap)
OSDMapRef send_map = service.try_get_map(m->get_map_epoch());
// check send epoch
if (!send_map) {

dout(7) << "don't have sender's osdmap; assuming it was valid and that client will resend" << dendl;
dout(7) << "don't have sender's osdmap; assuming it was valid and that"
<< " client will resend" << dendl;
return;
}
if (!send_map->have_pg_pool(pgid.pool())) {
Expand All @@ -8021,7 +8021,8 @@ void OSD::handle_op(OpRequestRef& op, OSDMapRef& osdmap)
<< " when pool " << m->get_pg().pool() << " did not exist"
<< "\n";
return;
} else if (send_map->get_pg_acting_role(pgid.pgid, whoami) < 0) {
}
if (!send_map->osd_is_valid_op_target(pgid.pgid, whoami)) {
dout(7) << "we are invalid target" << dendl;
clog->warn() << m->get_source_inst() << " misdirected " << m->get_reqid()
<< " pg " << m->get_pg()
Expand All @@ -8037,8 +8038,9 @@ void OSD::handle_op(OpRequestRef& op, OSDMapRef& osdmap)

// check against current map too
if (!osdmap->have_pg_pool(pgid.pool()) ||
osdmap->get_pg_acting_role(pgid.pgid, whoami) < 0) {
dout(7) << "dropping; no longer have PG (or pool); client will retarget" << dendl;
!osdmap->osd_is_valid_op_target(pgid.pgid, whoami)) {
dout(7) << "dropping; no longer have PG (or pool); client will retarget"
<< dendl;
return;
}

Expand Down
12 changes: 12 additions & 0 deletions src/osd/OSDMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,18 @@ class OSDMap {
return calc_pg_role(osd, group, nrep);
}

bool osd_is_valid_op_target(pg_t pg, int osd) const {
int primary;
vector<int> group;
int nrep = pg_to_acting_osds(pg, &group, &primary);
if (osd == primary)
return true;
if (pg_is_ec(pg))
return false;

return calc_pg_role(osd, group, nrep) >= 0;
}


/*
* handy helpers to build simple maps...
Expand Down

0 comments on commit c15391b

Please sign in to comment.