From: Jeff Layton Date: Wed, 20 May 2020 14:36:07 +0000 (-0400) Subject: ceph: flush release queue when handling caps for unknown inode X-Git-Tag: v5.6.16~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33156b2764191bf33c58adb84a0a8ac2912d7962;p=thirdparty%2Fkernel%2Fstable.git ceph: flush release queue when handling caps for unknown inode [ Upstream commit fb33c114d3ed5bdac230716f5b0a93b56b92a90d ] It's possible for the VFS to completely forget about an inode, but for it to still be sitting on the cap release queue. If the MDS sends the client a cap message for such an inode, it just ignores it today, which can lead to a stall of up to 5s until the cap release queue is flushed. If we get a cap message for an inode that can't be located, then go ahead and flush the cap release queue. Cc: stable@vger.kernel.org URL: https://tracker.ceph.com/issues/45532 Fixes: 1e9c2eb6811e ("ceph: delete stale dentry when last reference is dropped") Reported-and-Tested-by: Andrej Filipčič Suggested-by: Yan, Zheng Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index f50204380a65d..3ae88ca03ccd4 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -3952,7 +3952,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, __ceph_queue_cap_release(session, cap); spin_unlock(&session->s_cap_lock); } - goto done; + goto flush_cap_releases; } /* these will work even if we don't have a cap yet */