]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mds: let Locker::acquire_locks()'s caller choose locking order
authorYan, Zheng <zyan@redhat.com>
Wed, 14 Aug 2019 03:22:35 +0000 (11:22 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 25 Nov 2019 06:05:25 +0000 (14:05 +0800)
commit60f03a489e5dfa00835ebf46cea812d4b13ef0f7
tree8099ba63808120f1525fb4a5c0c924f97cfc4a5a
parentd7821ce8ec6899cbf9f789c8df4d1921c0052e1f
mds: let Locker::acquire_locks()'s caller choose locking order

This patch makes Locker::acquire_locks() lock objects in the order
specified by its caller. Locker::acquire_locks() only rearranges locks
in the same object (relieve of remembering the order). This patch is
preparation for 'lock object in top-down order'.

Besides, this patch allows MDRequest to lock objects step by step. For
example: call Locker::acquire_locks() to lock a dentry. After the dentry
is locked, call Locker::acquire_locks() to lock inode that is linked by
the dentry.

Locking object step by step introduces a problem. MDRequest may needs to
auth pin extra objects after taking same locks. If any object can not be
auth pinned, MDRequest needs to drop all locks before going to wait. For
slave auth pin request, this patch make slave mds send a notification
back to master mds if the auth pin request is blocked. The master mds
drops locks when receiving the notification.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Locker.cc
src/mds/Locker.h
src/mds/MDCache.cc
src/mds/Migrator.cc
src/mds/Mutation.cc
src/mds/Mutation.h
src/mds/Server.cc
src/messages/MMDSSlaveRequest.h