]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: wake up the waiters if any new caps comes
authorXiubo Li <xiubli@redhat.com>
Fri, 5 Aug 2022 04:33:03 +0000 (12:33 +0800)
committerXiubo Li <xiubli@redhat.com>
Thu, 18 Aug 2022 02:59:53 +0000 (10:59 +0800)
When new caps comes we need to wake up the waiters and also when
revoking the caps, there also could be new caps comes.

https://tracker.ceph.com/issues/54044
Signed-off-by: Xiubo Li <xiubli@redhat.com>
fs/ceph/caps.c

index 5a4e7e53015afda1d36e5c62b3923251ebc33ad3..139d21b8fb4984e09e3ac695c99ae927477ccef6 100644 (file)
@@ -755,6 +755,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);
 }
 
 /*
@@ -3601,6 +3602,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) {