]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: wait reintegrate to finish when unlinking 51685/head
authorXiubo Li <xiubli@redhat.com>
Fri, 23 Dec 2022 04:50:31 +0000 (12:50 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 23 May 2023 00:45:58 +0000 (08:45 +0800)
commite10bdb2d36063516335a1d2d31c55bdbe1b46a02
tree518e3ef444ddc824afd1c4746a49e2da12134c47
parentbb5496b1dcda8fbaff97b3ecc494a044140c5870
mds: wait reintegrate to finish when unlinking

When unlinking a remote dentry while primary dentry has been just
unlinked and was trying to reintegrate, which will finally be a
RENAME client request to current MDS, the stray dentry.

If the RENAME request is sleeping and waiting for some resources
just after authpin the CInode, so the unlinking request will mark
the remote dentry as UNLINKING state and then add itself to the
wait list just waiting for the CInode to be authpined.

Then after the RENAME request is retried later it will add to a
wait list again and waiting for the UNLINKING state to be cleared.
And finally the RENAME and UNLINK requests will be deadlock.

This fix will block the UNLINK request if the reintegrate_stray
is going on for current dentry.

Fixes: https://tracker.ceph.com/issues/58340
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit c3b36723defae32b0a3ef1ac37b58ec57d356b65)
src/mds/CDentry.cc
src/mds/CDentry.h
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/Server.cc
src/mds/Server.h
src/mds/StrayManager.cc