]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: refuse to mkfs or mount if osd_max_object_size >= MAX_OBJECT_SIZE
authorSage Weil <sage@redhat.com>
Fri, 9 Aug 2019 15:57:14 +0000 (10:57 -0500)
committerNathan Cutler <ncutler@suse.com>
Tue, 8 Oct 2019 08:50:45 +0000 (10:50 +0200)
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 <sage@redhat.com>
(cherry picked from commit 377fdb1484e9ed34c3d46d2a9b99df926531c675)

src/os/bluestore/BlueStore.cc

index 60baa85da0999b875b07e54a9b62c3695db5d2dc..086ae5562fa1eab600c2d3bd59c57e6a7133f6fb 100644 (file)
@@ -5968,6 +5968,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);
@@ -6594,6 +6601,13 @@ int BlueStore::_mount(bool kv_only, bool open_db)
     }
   }
 
+  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;