From 1b0f779ca7fae0fd6cd6876bb0d012048c3d84c2 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 2 Sep 2026 23:59:01 -0700 Subject: [PATCH] ceph: wake up i_cap_wq waiters on inode shutdown ceph_inode_shutdown() purges every cap on the inode but never wakes i_cap_wq, unlike remove_session_caps_cb() which does so after the same kind of purge. Anyone blocked in ceph_get_caps() is waiting on that queue for caps that are now gone for good, so the wait only ends when the task is killed. Wake the queue after purging so the waiters get a chance to notice the shutdown and bail out. Signed-off-by: Xiubo Li Reviewed-by: Alex Markuze Signed-off-by: Ilya Dryomov --- fs/ceph/inode.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 12d94f2d6ad6..a2bc650b237a 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -3320,6 +3320,13 @@ void ceph_inode_shutdown(struct inode *inode) } spin_unlock(&ci->i_ceph_lock); + /* + * The caps are gone now, so wake up anyone waiting for them -- they + * are never coming back and the waiters need to notice the shutdown + * instead. remove_session_caps_cb() does the same after purging. + */ + wake_up_all(&ci->i_cap_wq); + if (invalidate) ceph_queue_invalidate(inode); while (iputs--)