From: Sage Weil Date: Tue, 22 Jul 2014 20:37:20 +0000 (-0700) Subject: os/KeyValueStore: make get_max_object_name_length() sane X-Git-Tag: v0.84~75^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=daac7508d2aeb8470442ea0dc047c023db021237;p=ceph.git os/KeyValueStore: make get_max_object_name_length() sane This is getting the NAME_MAX from the OS, but in reality the backend KV store is the limiter. And for leveldb, there is no real limit. Return 4096 for now. Signed-off-by: Sage Weil --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index d98d7af4eedc..b184f53cfc4d 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -911,21 +911,6 @@ int KeyValueStore::umount() return 0; } -int KeyValueStore::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; -} - int KeyValueStore::queue_transactions(Sequencer *posr, list &tls, TrackedOpRef osd_op, ThreadPool::TPHandle *handle) diff --git a/src/os/KeyValueStore.h b/src/os/KeyValueStore.h index ae9b0c721332..c0991cc2e5e2 100644 --- a/src/os/KeyValueStore.h +++ b/src/os/KeyValueStore.h @@ -491,7 +491,9 @@ class KeyValueStore : public ObjectStore, int write_version_stamp(); int mount(); int umount(); - int get_max_object_name_length(); + int get_max_object_name_length() { + return 4096; // no real limit for leveldb + } int get_max_attr_name_length() { return 256; // arbitrary; there is no real limit internally }