mds: fix crash when exporting unlinked dir
When fetch() an unlinked dir, we set fnode->version = 1, but leave
projected_version = 0. This will trigger the assert
`dir->get_projected_version() == dir->get_version()`
in Migrator::encode_export_dir().
projected_version should equal to `fnode->version` unless this dir is
projected.
Fix this by introducing a new helper CDir::set_fresh_fnode(), which will ensure
versions are correctly set.
Fixes: https://tracker.ceph.com/issues/53597
Signed-off-by: 胡玮文 <huww98@outlook.com>
(cherry picked from commit
fcdee486697ca98a44960e6150bfd36dc34e5fe5)