mds: fix mds damaged due to unexpected journal length
We used first next_safe_pos in pending_safe to update journal's safe_pos, but
it might not be flushed at this time, so journal's header may get incorrect
write_pos in some case, which could cause mds damaged.
This fix is trying to use current min next_safe_pos in pending_safe to update
journal's safe_pos.
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
(cherry picked from commit
d17790f299c282dff9c28569b10c46a54b4cfd51)
Conflicts:
src/osdc/Journaler.cc : Resolved in _finish_flush