All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: wake up the waiters if any new caps comes
@ 2022-08-05  4:37 xiubli
  0 siblings, 0 replies; only message in thread
From: xiubli @ 2022-08-05  4:37 UTC (permalink / raw)
  To: ceph-devel; +Cc: Xiubo Li

From: Xiubo Li <xiubli@redhat.com>

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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 5a4e7e53015a..139d21b8fb49 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -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) {
-- 
2.36.0.rc1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-05  4:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05  4:37 [PATCH] ceph: wake up the waiters if any new caps comes xiubli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.