Project

General

Profile

Actions

Bug #53243

closed

wrong encoding of snap protection record in exporting image

Added by Satoru Takeuchi over 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The size of the protection flag should be 1 but 8.

src/tools/rbd/action/Export.cc
```
int do_export_diff_fd(librbd::Image& image, const char *fromsnapname,
...
if (endsnapname && export_format == 2) {
tag = RBD_SNAP_PROTECTION_STATUS;
encode(tag, bl);
bool is_protected = false;
r = image.snap_is_protected(endsnapname, &is_protected);
if (r < 0) {
return r;
}
len = 8; // is_protected is bool
encode(len, bl);
encode(is_protected, bl);
}
```

This bug causes misinterpretation of subsequent metadata records.

Reported in this tweet.
https://mobile.twitter.com/bradfitz/status/1459033318419152898

Actions #1

Updated by Deepika Upadhyay over 2 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 43907
Actions #2

Updated by Ilya Dryomov about 2 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF