]> 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 02:47:42 +0000 (10:47 +0800)
commit7005de0f6ff9bb1c154b3d28e7dfaad9abcf7030
treef649753e5485e4811c0534a12706329539de1b41
parent71b6eb1c6a39b6120476761afb050c1c8d085966
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)
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