From 04c808878df772e7ee88c99d61162c8671d3eb2f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 9 Aug 2019 10:57:14 -0500 Subject: [PATCH] os/bluestore: refuse to mkfs or mount if osd_max_object_size >= MAX_OBJECT_SIZE BlueStore has its own object size limit (2^32-1). Make sure the cluster limit is below that or refuse to mkfs or mount. Signed-off-by: Sage Weil (cherry picked from commit 377fdb1484e9ed34c3d46d2a9b99df926531c675) --- src/os/bluestore/BlueStore.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 211faf39592..3c7c29f1b7c 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5579,6 +5579,13 @@ int BlueStore::mkfs() int r; uuid_d old_fsid; + if (cct->_conf->osd_max_object_size > OBJECT_MAX_SIZE) { + derr << __func__ << " osd_max_object_size " + << cct->_conf->osd_max_object_size << " > bluestore max " + << OBJECT_MAX_SIZE << dendl; + return -EINVAL; + } + { string done; r = read_meta("mkfs_done", &done); @@ -5815,6 +5822,13 @@ int BlueStore::_mount(bool kv_only) } } + if (cct->_conf->osd_max_object_size > OBJECT_MAX_SIZE) { + derr << __func__ << " osd_max_object_size " + << cct->_conf->osd_max_object_size << " > bluestore max " + << OBJECT_MAX_SIZE << dendl; + return -EINVAL; + } + int r = _open_path(); if (r < 0) return r; -- 2.47.3