From 90b7fd8a0accc2f8f458d35199361344652d8859 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Fri, 17 Feb 2017 12:27:36 -0800 Subject: [PATCH] bluestore: Fix BlueStore::statfs available amount to not include bluefs min reserved This fixes OSD crashes because checking osd_failsafe_full_ratio won't work without accurate statfs information. Signed-off-by: David Zafman (cherry picked from commit 72d83f848a35e8831d66e8529c4e26f51e845da6) --- src/os/bluestore/BlueStore.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 2f7132bcf552f..c2360822667a6 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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) { -- 2.39.5