Skip to content

Commit

Permalink
bluestore: Fix BlueStore::statfs available amount to not include blue…
Browse files Browse the repository at this point in the history
…fs min reserved

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>
  • Loading branch information
dzafman committed Feb 24, 2017
1 parent 8b62023 commit 57a9c66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5424,8 +5424,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) {
Expand Down

0 comments on commit 57a9c66

Please sign in to comment.