From: Adam Kupczyk Date: Tue, 13 Feb 2024 12:54:27 +0000 (+0000) Subject: os/bluestore: Small fix to mkfs X-Git-Tag: v20.0.0~1321^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eac365cd1a7554f31d0018a3b45f060e22ad7add;p=ceph.git os/bluestore: Small fix to mkfs Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index b6379c4eef2c..61109b0e5802 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -8329,22 +8329,6 @@ int BlueStore::mkfs() return r; // idempotent } } - - { - string type; - r = read_meta("type", &type); - if (r == 0) { - if (type != "bluestore") { - derr << __func__ << " expected bluestore, but type is " << type << dendl; - return -EIO; - } - } else { - r = write_meta("type", "bluestore"); - if (r < 0) - return r; - } - } - r = _open_path(); if (r < 0) return r; @@ -8397,6 +8381,20 @@ int BlueStore::mkfs() r = _open_bdev(true); if (r < 0) goto out_close_fsid; + { + string type; + r = read_meta("type", &type); + if (r == 0) { + if (type != "bluestore") { + derr << __func__ << " expected bluestore, but type is " << type << dendl; + return -EIO; + } + } else { + r = write_meta("type", "bluestore"); + if (r < 0) + return r; + } + } freelist_type = "bitmap"; dout(10) << " freelist_type " << freelist_type << dendl;