From: Sage Weil Date: Sun, 20 Jul 2014 14:48:47 +0000 (-0700) Subject: os/FileStore: fix max object name limit X-Git-Tag: v0.84~84^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2111%2Fhead;p=ceph.git os/FileStore: fix max object name limit 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 --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 6b33f97314c7..d0be5714e730 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -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; -} - /// ----------------------------- diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 6e407285073a..bbd587a7c6ed 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -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