]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd: correct encoding of snap protection record in exporting image
authorSatoru Takeuchi <satoru.takeuchi@gmail.com>
Fri, 12 Nov 2021 12:08:33 +0000 (12:08 +0000)
committerSatoru Takeuchi <satoru.takeuchi@gmail.com>
Sat, 13 Nov 2021 22:09:04 +0000 (22:09 +0000)
Correct the size of `protection` field. This bug is harmless since Export/Import writes/reads
one byte for `protected` field regardless of `length` field. So the current wrong diff works
correctly by chance

Fixes: https://tracker.ceph.com/issues/53243
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
src/tools/rbd/action/Export.cc

index 21ece1fecfafff0a9e1a6760b7ab5532176ba41a..dff10c97e1ac6679105fc0966026972f95bd2abb 100644 (file)
@@ -173,7 +173,7 @@ int do_export_diff_fd(librbd::Image& image, const char *fromsnapname,
       if (r < 0) {
         return r;
       }
-      len = 8;
+      len = 1;
       encode(len, bl);
       encode(is_protected, bl);
     }