]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: fix max object name limit 2111/head
authorSage Weil <sage@redhat.com>
Sun, 20 Jul 2014 14:48:47 +0000 (07:48 -0700)
committerSage Weil <sage@redhat.com>
Sun, 20 Jul 2014 14:48:47 +0000 (07:48 -0700)
Our max object name is not limited by file name size, but by the length of
the name we can stuff in an xattr.  That will vary from file system to
file system, so just make this 4096.  In practice, it should be limited
via the global tunable, if it is adjusted at all.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/FileStore.cc
src/os/FileStore.h

index 6b33f97314c72b29278b2d7a36f23cc0f3247fbc..d0be5714e730ced6b134e5f655059a7ea704e0e4 100644 (file)
@@ -1562,21 +1562,6 @@ int FileStore::umount()
 }
 
 
-int FileStore::get_max_object_name_length()
-{
-  lock.Lock();
-  int ret = pathconf(basedir.c_str(), _PC_NAME_MAX);
-  if (ret < 0) {
-    int err = errno;
-    lock.Unlock();
-    if (err == 0)
-      return -EDOM;
-    return -err;
-  }
-  lock.Unlock();
-  return ret;
-}
-
 
 
 /// -----------------------------
index 6e407285073a892252ac7b39289dad5ca2770034..bbd587a7c6ed0a0a30545b5835689bb627d4c308 100644 (file)
@@ -410,7 +410,10 @@ public:
   int write_op_seq(int, uint64_t seq);
   int mount();
   int umount();
-  int get_max_object_name_length();
+  int get_max_object_name_length() {
+    // not safe for all file systems, btw!  use the tunable to limit this.
+    return 4096;
+  }
   int get_max_attr_name_length() {
     // xattr limit is 128; leave room for our prefixes (user.ceph._),
     // some margin, and cap at 100