From patchwork Mon Jun 1 17:54:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AF0EC433DF for ; Mon, 1 Jun 2020 18:38:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E15720678 for ; Mon, 1 Jun 2020 18:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591036718; bh=g2lKDiPLDujWPW0RzLGJ93VyCybYHzEJD2bPGoE6DsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NEX0Z7AfuMHAw54uJukX3uMDphZWY4VcUSCD6UFCFhnkK3Kb0gOwD5Mrijfnh1Jr8 JuX1/OlGm4Ntl4daFjWmovrEkzoFIcz85gsur6evx6/rSOIpTr70+wm2q9KFw4A21Z ABWtqIgEomIVBUbIzIFSXqqwLv9eJnDel1uD8AN8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731450AbgFASih (ORCPT ); Mon, 1 Jun 2020 14:38:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:49448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729439AbgFASig (ORCPT ); Mon, 1 Jun 2020 14:38:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0758F20776; Mon, 1 Jun 2020 18:33:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591036421; bh=g2lKDiPLDujWPW0RzLGJ93VyCybYHzEJD2bPGoE6DsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XuRusajlYp4JDLnAPfUc2aR3sp1+xPM2j/e0pVkCGKkl75Tr7D0SENIoZ/6062N/b nygdMF7M0JfovUlwHvceVboHTDJmQmgUaZIlHbaLKZA63iv7aUlNaoGegHwDRVHuJF KsvhU1cw7IJu/GbBSvlQUGSW0aP8TInKrHAEh5mA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Yan, Zheng" , Jeff Layton , Ilya Dryomov , Sasha Levin , =?utf-8?b?QW5kcmVqIEZpbGlwxI1pxI0=?= Subject: [PATCH 5.6 122/177] ceph: flush release queue when handling caps for unknown inode Date: Mon, 1 Jun 2020 19:54:20 +0200 Message-Id: <20200601174058.743301144@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174048.468952319@linuxfoundation.org> References: <20200601174048.468952319@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jeff Layton [ 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 --- fs/ceph/caps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index f50204380a65..3ae88ca03ccd 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 */