From b80c3b84382b775ae781c3fa042b09fdbfdc0a69 Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Fri, 12 Nov 2021 12:08:33 +0000 Subject: [PATCH] rbd: correct encoding of snap protection record in exporting image 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 --- src/tools/rbd/action/Export.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rbd/action/Export.cc b/src/tools/rbd/action/Export.cc index 21ece1fecfa..dff10c97e1a 100644 --- a/src/tools/rbd/action/Export.cc +++ b/src/tools/rbd/action/Export.cc @@ -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); } -- 2.39.5