]> 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>
Fri, 12 Aug 2022 09:37:23 +0000 (17:37 +0800)
commitd4b9431dfe23a97075766fa2a2b76d7554543b0c
tree5086c36dfd9637dbb617a0417f19e5e53358c58e
parentc4d6729fb8e792eab90c0bf436446da71c8e313c
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>
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