mirror of
https://github.com/ceph/ceph
synced 2025-01-19 17:41:39 +00:00
rbd: rbd-mirroring: Fixed if clause in mirror_image_get_info
This fix targets the case when journaling is not enabled but someone calls mirror_image_get_info. Signed-off-by: Ricardo Dias <rdias@suse.com>
This commit is contained in:
parent
c472493659
commit
6ebb4f36b2
@ -2718,11 +2718,15 @@ int validate_mirroring_enabled(ImageCtx *ictx) {
|
||||
static_cast<rbd_mirror_image_state_t>(mirror_image_internal.state);
|
||||
}
|
||||
|
||||
r = Journal<>::is_tag_owner(ictx, &mirror_image_info->primary);
|
||||
if (r < 0) {
|
||||
lderr(cct) << "failed to check tag ownership: "
|
||||
<< cpp_strerror(r) << dendl;
|
||||
return r;
|
||||
if (mirror_image_info->state == RBD_MIRROR_IMAGE_ENABLED) {
|
||||
r = Journal<>::is_tag_owner(ictx, &mirror_image_info->primary);
|
||||
if (r < 0) {
|
||||
lderr(cct) << "failed to check tag ownership: "
|
||||
<< cpp_strerror(r) << dendl;
|
||||
return r;
|
||||
}
|
||||
} else {
|
||||
mirror_image_info->primary = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user