Repository navigation
quincy: librbd: make diff-iterate in fast-diff mode aware of encryption - #58342
Conversation
|
Temporarily based on #58210 to avoid conflicts in |
Sigh, I forgot that I'll try to look into it, but might choose leaving this unfixed in quincy given that it's almost EOL. |
8f2a713 to
01ed47a
Compare
This turned out easier that I thought it would be due to the fact that diff-iterate only needs the area -> raw mapping. |
|
jenkins test api |
In preparation for extending coverage, extract test logic into a couple of parametrized helpers. Signed-off-by: Ilya Dryomov <[email protected]> (cherry picked from commit 1df8799)
Currently we are laying data only at the beginning of an object. Extend the skeletons to write to three different offsets in the middle and also at the end of the object. Separately, make C and C++ API test variants slightly different in terms of offsets being targeted to not go through exactly the same scenario twice. Signed-off-by: Ilya Dryomov <[email protected]> (cherry picked from commit da69d1f)
diff-iterate wasn't updated when librbd was being prepared to support encryption in commit 8d6a479 ("librbd: add crypto image dispatch layer"). This is even noted in [1]: > The two places I skipped for now are DiffIterate and TrimRequest. CryptoImageDispatch has since been removed, but diff-iterate in fast-diff mode is still unaware of encryption and just assumes that all offsets are raw. This means that the callback gets invoked with incorrect image offsets when encryption is loaded. For example, for a LUKS1-formatted image with some data at offsets 0 and 20971520, diff-iterate with encryption loaded reports 0~4194304 4194304~4194304 25165824~4194304 instead of 0~4194304 20971520~4194304 as "exists". For any piece of code that is using diff-iterate to optimize block-by-block processing (e.g. copy an encrypted source image to a differently-encrypted destination image), this is fatal: it would skip processing block 20971520 which has data and instead process block 25165824 which doesn't have any data and was to be skipped, producing a corrupted destination image. [1] ceph#37935 (comment) Fixes: https://tracker.ceph.com/issues/66570 Signed-off-by: Ilya Dryomov <[email protected]> (cherry picked from commit cdeb0ef) Conflicts: src/librbd/api/DiffIterate.cc [ ImageArea support not in quincy ] src/test/librbd/test_librbd.cc [ commit 4a5a0a5 ("librbd: add cloned images encryption API") not in quincy
01ed47a to
bb2461e
Compare
|
Rebased after #58210 merged. |
|
jenkins test make check |
|
Tests actually passed -- this just needed a rebase. |
backport tracker: https://tracker.ceph.com/issues/66745
backport of #58201
parent tracker: https://tracker.ceph.com/issues/66570