]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephfs-journal-tool: Fix purging when importing an zero-length journal. 22981/head
authorchenyupeng360 <chenyupeng-it@360.cn>
Tue, 22 May 2018 04:34:51 +0000 (12:34 +0800)
committerJos Collin <jcollin@redhat.com>
Wed, 11 Jul 2018 06:15:24 +0000 (11:45 +0530)
commitb2bc84d172b85534b4be577cb165b4ddb9d1f5f6
treeca5eab2d8c85e0518a4fc5b9f9f2d0b7185005ea
parent836d4de9334066eb4ab0ee72acdd3ab653933d54
cephfs-journal-tool: Fix purging when importing an zero-length journal.

When importing a zero-length purge_queue journal exported previously, the last object and
the following one are now being purged for removing potential junks. In this case,
there will be no writing performed actually, so the purged last object get lost permanently.

This can be fixed by purging the object following the last object, and by zeroing the last object
starting from the offset determined by the write_pos.

Fixes: https://tracker.ceph.com/issues/24239
Signed-off-by: yupeng chen <chenyupeng-it@360.cn>
Signed-off-by: zhongyan gu <guzhongyan@360.cn>
(cherry picked from commit b6c68dd55272f9066d7b5cf2fa30ea44f7c36533)
src/tools/cephfs/Dumper.cc