diff options
author | Sage Weil <sage@inktank.com> | 2013-09-23 16:23:33 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-23 16:23:33 -0700 |
commit | abb88d70643c3a76435b7a9d5b04ff29f7502361 (patch) | |
tree | 2e2038d250d4831afab606d10b275aeed5d598f7 | |
parent | da42355a6d8ef7197ae6f9f3bef2eb6f9f8ca9cb (diff) | |
download | ceph-abb88d70643c3a76435b7a9d5b04ff29f7502361.tar.gz |
osd: revert 'osd max xattr size' limit
Set it to 0 (unlimited) for now.
Backport: dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/common/config_opts.h | 2 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.cc | 3 | ||||
-rw-r--r-- | 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<OSDOp>& 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)); |