// we don't need encoded payload anymore
m->clear_payload();
- // object name too long?
- unsigned max_name_len = MIN(g_conf->osd_max_object_name_len,
- store->get_max_object_name_length());
- if (m->get_oid().name.size() > max_name_len) {
- dout(4) << "handle_op '" << m->get_oid().name << "' is longer than "
- << max_name_len << " bytes" << dendl;
- service.reply_op_error(op, -ENAMETOOLONG);
- return;
- }
-
- // blacklisted?
- if (osdmap->is_blacklisted(m->get_source_addr())) {
- dout(4) << "handle_op " << m->get_source_addr() << " is blacklisted" << dendl;
- service.reply_op_error(op, -EBLACKLISTED);
- return;
- }
-
// set up a map send if the Op gets blocked for some reason
send_map_on_destruct share_map(this, m, osdmap, m->get_map_epoch());
Session *client_session =
client_session->put();
}
- if (op->rmw_flags == 0) {
- int r = init_op_flags(op);
- if (r) {
- service.reply_op_error(op, r);
- return;
- }
- }
-
if (cct->_conf->osd_debug_drop_op_probability > 0 &&
!m->get_source().is_mds()) {
if ((double)rand() / (double)RAND_MAX < cct->_conf->osd_debug_drop_op_probability) {
// calc actual pgid
pg_t _pgid = m->get_pg();
int64_t pool = _pgid.pool();
- if (op->may_write()) {
- const pg_pool_t *pi = osdmap->get_pg_pool(pool);
- if (!pi) {
- return;
- }
-
- // invalid?
- if (m->get_snapid() != CEPH_NOSNAP) {
- service.reply_op_error(op, -EINVAL);
- return;
- }
-
- // too big?
- if (cct->_conf->osd_max_write_size &&
- m->get_data_len() > ((int64_t)g_conf->osd_max_write_size) << 20) {
- // journal can't hold commit!
- derr << "handle_op msg data len " << m->get_data_len()
- << " > osd_max_write_size " << (cct->_conf->osd_max_write_size << 20)
- << " on " << *m << dendl;
- service.reply_op_error(op, -OSD_WRITETOOBIG);
- return;
- }
- }
if ((m->get_flags() & CEPH_OSD_FLAG_PGOP) == 0 &&
osdmap->have_pg_pool(pool))
{
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
assert(m->get_type() == CEPH_MSG_OSD_OP);
+
+ if (op->rmw_flags == 0) {
+ int r = osd->osd->init_op_flags(op);
+ if (r) {
+ osd->reply_op_error(op, r);
+ return;
+ }
+ }
+
if (op->includes_pg_op()) {
if (pg_op_must_wait(m)) {
wait_for_all_missing(op);
return do_pg_op(op);
}
+ // object name too long?
+ unsigned max_name_len = MIN(g_conf->osd_max_object_name_len,
+ osd->osd->store->get_max_object_name_length());
+ if (m->get_oid().name.size() > max_name_len) {
+ dout(4) << "do_op '" << m->get_oid().name << "' is longer than "
+ << max_name_len << " bytes" << dendl;
+ osd->reply_op_error(op, -ENAMETOOLONG);
+ return;
+ }
+
+ // blacklisted?
if (get_osdmap()->is_blacklisted(m->get_source_addr())) {
dout(10) << "do_op " << m->get_source_addr() << " is blacklisted" << dendl;
osd->reply_op_error(op, -EBLACKLISTED);
<< dendl;
return;
}
+ int64_t poolid = get_pgid().pool();
+ if (op->may_write()) {
+
+ const pg_pool_t *pi = get_osdmap()->get_pg_pool(poolid);
+ if (!pi) {
+ return;
+ }
+
+ // invalid?
+ if (m->get_snapid() != CEPH_NOSNAP) {
+ osd->reply_op_error(op, -EINVAL);
+ return;
+ }
+
+ // too big?
+ if (cct->_conf->osd_max_write_size &&
+ m->get_data_len() > cct->_conf->osd_max_write_size << 20) {
+ // journal can't hold commit!
+ derr << "do_op msg data len " << m->get_data_len()
+ << " > osd_max_write_size " << (cct->_conf->osd_max_write_size << 20)
+ << " on " << *m << dendl;
+ osd->reply_op_error(op, -OSD_WRITETOOBIG);
+ return;
+ }
+ }
// order this op as a write?
bool write_ordered =