From 3e328c54086cb03b1c79bc7d4f6a451815ae6bd6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 19 Sep 2013 06:15:56 -0700 Subject: osd: revert 'osd max xattr size' limit Set it to 0 (unlimited) for now. Signed-off-by: Sage Weil --- src/common/config_opts.h | 2 +- src/osd/ReplicatedPG.cc | 3 ++- src/test/librados/misc.cc | 24 ++++++++++++++---------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 2fa72d4ce0f..dc1ac7d88c3 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -521,7 +521,7 @@ OPTION(osd_recovery_op_warn_multiple, OPT_U32, 16) 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(osd_max_attr_size, OPT_U64, 0) OPTION(filestore, OPT_BOOL, false) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index d8aa8b1d02b..9b4d069370b 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2898,7 +2898,8 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) case CEPH_OSD_OP_SETXATTR: ++ctx->num_write; { - if (op.xattr.value_len > g_conf->osd_max_attr_size) { + if (g_conf->osd_max_attr_size > 0 && + op.xattr.value_len > g_conf->osd_max_attr_size) { result = -EFBIG; break; } diff --git a/src/test/librados/misc.cc b/src/test/librados/misc.cc index af17847aeab..4f91c5a776a 100644 --- a/src/test/librados/misc.cc +++ b/src/test/librados/misc.cc @@ -538,21 +538,25 @@ TEST(LibRadosMisc, BigAttrPP) { bufferlist got; - bl.clear(); - got.clear(); - bl.append(buffer::create(g_conf->osd_max_attr_size)); - ASSERT_EQ(0, ioctx.setxattr("foo", "one", bl)); - ASSERT_EQ((int)bl.length(), ioctx.getxattr("foo", "one", got)); - ASSERT_TRUE(bl.contents_equal(got)); + if (g_conf->osd_max_attr_size) { + bl.clear(); + got.clear(); + bl.append(buffer::create(g_conf->osd_max_attr_size)); + ASSERT_EQ(0, ioctx.setxattr("foo", "one", bl)); + ASSERT_EQ((int)bl.length(), ioctx.getxattr("foo", "one", got)); + ASSERT_TRUE(bl.contents_equal(got)); - bl.clear(); - bl.append(buffer::create(g_conf->osd_max_attr_size+1)); - ASSERT_EQ(-EFBIG, ioctx.setxattr("foo", "one", bl)); + bl.clear(); + bl.append(buffer::create(g_conf->osd_max_attr_size+1)); + ASSERT_EQ(-EFBIG, ioctx.setxattr("foo", "one", bl)); + } else { + cout << "osd_max_attr_size == 0; skipping test" << std::endl; + } for (int i=0; i<1000; i++) { bl.clear(); got.clear(); - bl.append(buffer::create(g_conf->osd_max_attr_size)); + bl.append(buffer::create(MIN(g_conf->osd_max_attr_size, 1024))); char n[10]; snprintf(n, sizeof(n), "a%d", i); ASSERT_EQ(0, ioctx.setxattr("foo", n, bl)); -- cgit v1.2.1