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)
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) {