summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2022-08-05 07:33:03 +0300
committerIlya Dryomov <idryomov@gmail.com>2022-10-04 20:18:08 +0300
commitf791357330b0043ec953ce122ab7519af4b9d24a (patch)
tree6e5cdbfb80a4d81d7aa21e69837d5abb71919e0b
parentda4ab869e37cf81f93333ba74b16e0ea6d322e15 (diff)
downloadlinux-f791357330b0043ec953ce122ab7519af4b9d24a.tar.xz
ceph: wake up the waiters if any new caps comes
When new caps comes we need to wake up the waiters and also when revoking the caps, there also could be new caps comes. Link: https://tracker.ceph.com/issues/54044 Signed-off-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--fs/ceph/caps.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 53cfe026b3ea..0ddd91eadbce 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -754,6 +754,7 @@ void ceph_add_cap(struct inode *inode,
cap->issue_seq = seq;
cap->mseq = mseq;
cap->cap_gen = gen;
+ wake_up_all(&ci->i_cap_wq);
}
/*
@@ -3550,6 +3551,9 @@ static void handle_cap_grant(struct inode *inode,
check_caps = 1; /* check auth cap only */
else
check_caps = 2; /* check all caps */
+ /* If there is new caps, try to wake up the waiters */
+ if (~cap->issued & newcaps)
+ wake = true;
cap->issued = newcaps;
cap->implemented |= newcaps;
} else if (cap->issued == newcaps) {