]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mds: flush mdlog if locked and still has wanted caps not satisfied
authorXiubo Li <xiubli@redhat.com>
Mon, 7 Mar 2022 07:42:42 +0000 (15:42 +0800)
committerXiubo Li <xiubli@redhat.com>
Thu, 18 Aug 2022 00:52:57 +0000 (08:52 +0800)
commit0680eae2ab3c26dda410255f092d5a966b8481ae
tree0119040a38748dbba7055a3e4549c522eee4062e
parentbbd203bca402874c8081b7d8e49cf9e263025293
mds: flush mdlog if locked and still has wanted caps not satisfied

In _do_cap_update() if one client is releasing the Fw caps the
relevant client range will be erased, and then new_max will be 0.
It will skip flushing the mdlog after it submitting a journal log,
which will keep holding the wrlock for the filelock.

So when a new client is trying to open the file for reading, since
the wrlock is locked for the filelock the file_eval() is possibly
couldn't changing the lock state and at the same time if the
filelock is in stable state, such as in EXECL, MIX. The mds may
skip flushing the mdlog in the open related code too.

We need to flush the mdlog if there still has any wanted caps
couldn't be satisfied and has any lock for the filelock after the
file_eval().

Fixes: https://tracker.ceph.com/issues/54463
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 52918175f0190581ae46897f19be6e870f24291c)
src/mds/Locker.cc
src/mds/Locker.h