Skip to contentSkip to conversation

ceph: wake up the waiters if any new caps comes

PATCH New [email protected] 1 participant 1 message Aug 5, 2022 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: wake up the waiters if any new caps comes

From: Xiubo Li <[email protected]>

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

---
 fs/ceph/caps.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/ceph/caps.c +4 -0
index 5a4e7e53015a..139d21b8fb49 100644
@@ -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) {
Signature · 1 line
2.36.0.rc1