]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: wait reintegrate to finish when unlinking 51684/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:41:58 +0000 (08:41 +0800)
commitec5aa02c10d7a1bd2fd6e9fbc6f6221d8fa4a3b8
treed86cfb01fabe3aef84f379016262ca9359200b35
parent3cceddd14ec0849857f13e230125fca6ee0f3180
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