Merge pull request #20602 from gregsfortytwo/wip-23141-rotational

os/bluestore: correctly check all block devices to decide if journal is_rotational

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
Kefu Chai 2018-02-28 09:35:17 +08:00 committed by GitHub
commit 054d0c54f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2448,7 +2448,10 @@ int BlueFS::unlink(const string& dirname, const string& filename)
bool BlueFS::wal_is_rotational()
{
if (!bdev[BDEV_WAL] || bdev[BDEV_WAL]->is_rotational())
return true;
return false;
if (bdev[BDEV_WAL]) {
return bdev[BDEV_WAL]->is_rotational();
} else if (bdev[BDEV_DB]) {
return bdev[BDEV_DB]->is_rotational();
}
return bdev[BDEV_SLOW]->is_rotational();
}