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)