]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: wait unlink to finish to avoid conflict when creating same dentries
authorXiubo Li <xiubli@redhat.com>
Wed, 18 May 2022 04:59:38 +0000 (12:59 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 12 Oct 2022 03:12:50 +0000 (11:12 +0800)
commit76b099b29cefbee770aba1fafea678e6891795c0
tree77ae53bcad0cb52dff27619da97d62d2286b1c38
parent6077f98c7ee1b9fd5f048e931ff91864373b8e05
mds: wait unlink to finish to avoid conflict when creating same dentries

If the previous unlink request has been delayed due to some reasons,
and the new creating for the same dentry may fail or new open will
succeeds but new contents wrote to it will be lost.

The kernel client will make sure before the unlink getting the first
reply it won't send the followed create requests for the same dentry.
Here we need to make sure that before the first reply has been sent
out the dentry must be marked as unlinking.

Fixes: https://tracker.ceph.com/issues/55332
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit d4b9431dfe23a97075766fa2a2b76d7554543b0c)
Conflicts:
    src/messages/MDentryUnlink.h
src/mds/CDentry.h
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/Server.cc
src/mds/Server.h
src/messages/MDentryUnlink.h
src/msg/Message.cc
src/msg/Message.h