]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: revert 'osd max xattr size' limit
authorSage Weil <sage@inktank.com>
Mon, 23 Sep 2013 23:23:33 +0000 (16:23 -0700)
committerSage Weil <sage@inktank.com>
Mon, 23 Sep 2013 23:23:33 +0000 (16:23 -0700)
Set it to 0 (unlimited) for now.

Backport: dumpling

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
src/common/config_opts.h
src/osd/ReplicatedPG.cc
src/test/librados/misc.cc

index 2fa72d4ce0f003d7831b19ba39954077f42fea5a..dc1ac7d88c364f0fba5588e11b27245d2aa28ba4 100644 (file)
@@ -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)
 
index d8aa8b1d02b827a3bd1c23cf6c7d3569457c579f..9b4d069370bae2e8fe40bad13415201c80b2b4ff 100644 (file)
@@ -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;
        }
index af17847aeabbdc34573a24d74903856da279c2a7..4f91c5a776a5b07cb560074fa9e473eea385da4e 100644 (file)
@@ -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));