Actions
Bug #53243
closedwrong encoding of snap protection record in exporting image
Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:
0%
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
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