]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore: Fix BlueStore::statfs available amount to not include bluefs min reserved
authorDavid Zafman <dzafman@redhat.com>
Fri, 17 Feb 2017 20:27:36 +0000 (12:27 -0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 18 Jul 2017 20:12:57 +0000 (22:12 +0200)
This fixes OSD crashes because checking osd_failsafe_full_ratio won't work
without accurate statfs information.

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 72d83f848a35e8831d66e8529c4e26f51e845da6)

src/os/bluestore/BlueStore.cc

index 2f7132bcf552f3447c5ad5de2bbebb08ec7cf2a6..c2360822667a64e93ce1fe4e91bcf27cb723f074 100644 (file)
@@ -4712,8 +4712,10 @@ int BlueStore::statfs(struct store_statfs_t *buf)
   buf->available = alloc->get_free();
 
   if (bluefs) {
-    // part of our shared device is "free" accordingly to BlueFS
-    buf->available += bluefs->get_free(bluefs_shared_bdev);
+    // part of our shared device is "free" according to BlueFS
+    // Don't include bluestore_bluefs_min because that space can't
+    // be used for any other purpose.
+    buf->available += bluefs->get_free(bluefs_shared_bdev) - cct->_conf->bluestore_bluefs_min;
 
     // include dedicated db, too, if that isn't the shared device.
     if (bluefs_shared_bdev != BlueFS::BDEV_DB) {