mirror of
https://github.com/ceph/ceph
synced 2024-12-18 17:37:38 +00:00
os/bluestore: save "mkfs_done" only if we pass fsck() tests
In our local test bed, we found mkfs() sometimes can fail due to errors discovered by fsck(), and is therefore unrecoverable by redoing mkfs() as the "mkfs_done" flag has been successfully saved into disk. This patch fixes the above case. Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
parent
2839052174
commit
58291dd69c
@ -4880,12 +4880,6 @@ int BlueStore::mkfs()
|
||||
}
|
||||
}
|
||||
|
||||
// indicate success by writing the 'mkfs_done' file
|
||||
r = write_meta("mkfs_done", "yes");
|
||||
if (r < 0)
|
||||
goto out_close_alloc;
|
||||
dout(10) << __func__ << " success" << dendl;
|
||||
|
||||
out_close_alloc:
|
||||
_close_alloc();
|
||||
out_close_fm:
|
||||
@ -4909,8 +4903,16 @@ int BlueStore::mkfs()
|
||||
r = -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
if (r == 0) {
|
||||
// indicate success by writing the 'mkfs_done' file
|
||||
r = write_meta("mkfs_done", "yes");
|
||||
}
|
||||
|
||||
if (r < 0) {
|
||||
derr << __func__ << " failed, " << cpp_strerror(r) << dendl;
|
||||
} else {
|
||||
dout(0) << __func__ << " success" << dendl;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user