]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mds: wait reintegrate to finish when unlinking
authorXiubo Li <xiubli@redhat.com>
Fri, 23 Dec 2022 04:50:31 +0000 (12:50 +0800)
committerXiubo Li <xiubli@redhat.com>
Thu, 18 May 2023 05:28:03 +0000 (13:28 +0800)
commitc3b36723defae32b0a3ef1ac37b58ec57d356b65
tree4a5965c78805860dbeebabbf7b65fd69b172f85b
parent4e039349ebc52309a593e98f04874a027c92de50
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>
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