diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 9eee57af9eb..775d54cac48 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -489,6 +489,7 @@ OPTION(osd_recovery_op_priority, OPT_INT, 10) OPTION(osd_mon_shutdown_timeout, OPT_DOUBLE, 5) OPTION(osd_max_object_size, OPT_U64, 100*1024L*1024L*1024L) // OSD's maximum object size +OPTION(osd_max_attr_size, OPT_U64, 65536) OPTION(filestore, OPT_BOOL, false) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 4ce0404740c..ada720ed36b 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2758,6 +2758,10 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) case CEPH_OSD_OP_SETXATTR: { + if (op.xattr.value_len > g_conf->osd_max_attr_size) { + result = -EFBIG; + break; + } if (!obs.exists) { t.touch(coll, soid); ctx->delta_stats.num_objects++;