mirror of
https://github.com/ceph/ceph
synced 2025-01-02 00:52:22 +00:00
librbd: report an error if rbd header does not match
This will fail on future incompatible versions of the header format. Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
This commit is contained in:
parent
353ee0004a
commit
363ebb6ccc
@ -585,6 +585,12 @@ int read_header_bl(IoCtx& io_ctx, const string& md_oid, bufferlist& header, uint
|
||||
header.claim_append(bl);
|
||||
} while (r == READ_SIZE);
|
||||
|
||||
if (memcmp(RBD_HEADER_TEXT, header.c_str(), sizeof(RBD_HEADER_TEXT))) {
|
||||
CephContext *cct = io_ctx.cct();
|
||||
lderr(cct) << "unrecognized header format" << dendl;
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
if (ver)
|
||||
*ver = io_ctx.get_last_version();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user