]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: fix crash when exporting unlinked dir
author胡玮文 <huww98@outlook.com>
Thu, 16 Dec 2021 14:31:17 +0000 (22:31 +0800)
committer胡玮文 <huww98@outlook.com>
Wed, 25 May 2022 07:50:36 +0000 (15:50 +0800)
commitfcdee486697ca98a44960e6150bfd36dc34e5fe5
tree0e75926befa3953835d77d8007f41b4be9dd7bcf
parent805d2320b32f02da710847fb822791bfe72fedf8
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>
src/mds/CDir.cc
src/mds/CDir.h