]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mds: fix 'if there is lock cache on dir' check
authorYan, Zheng <zyan@redhat.com>
Thu, 5 Mar 2020 14:54:50 +0000 (22:54 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 12 Mar 2020 03:03:49 +0000 (11:03 +0800)
commit20d21cff89e1bb2bd6d7af311b4cc3272ce5fe65
tree485b6e4acd4134dfe530b5087fb0cc322af4be22
parent6bbb159cb0d118087b71e693845b07ca03017e56
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>
src/mds/Locker.cc
src/mds/Mutation.cc
src/mds/Mutation.h
src/mds/SimpleLock.cc
src/mds/SimpleLock.h