]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: fix 'if there is lock cache on dir' check 34273/head
authorYan, Zheng <zyan@redhat.com>
Thu, 5 Mar 2020 14:54:50 +0000 (22:54 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 30 Mar 2020 01:23:07 +0000 (09:23 +0800)
commit094f77b33378fa9580b97e7a12759127e3ff2197
tree15cd1a2943aaf9ab9f1fde387f36104f610bff9b
parent9267cc03e1b1612109dd57cc6ce74c34ed1f1d00
mds: fix 'if there is lock cache on dir' check

When invalidating lock cache, current code detach lock cache from all
its locks immediately. So diri->filelock.is_cached() only tells us if
there is active (not being invalidated) lock cache on a dir.

But MDCache::path_traverse() and Server::_dir_is_nonempty_unlocked() use
diri->filelock.is_cached() to check if there is any lock cache on a dir.
This bug can result in processing async requests and normal requests out
of order.

The fix is detaching lock cache from its locks when lock cache is
completely invalidated .

Fixes: https://tracker.ceph.com/issues/44448
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 20d21cff89e1bb2bd6d7af311b4cc3272ce5fe65)
src/mds/Locker.cc
src/mds/Mutation.cc
src/mds/Mutation.h
src/mds/SimpleLock.cc
src/mds/SimpleLock.h