From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6DEA8F57 for ; Mon, 13 Feb 2023 14:59:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 400C2C433EF; Mon, 13 Feb 2023 14:59:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676300393; bh=HppmGfJzgngERve3L6+874tmPEcMILLc8mO4PUGWgpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oyf81KUvvaU39UDQ9AGay50NbB/dX0vWVTfCidmXYVuP3820yOafF4mWqr5qUk62N OjOalRk2NwnDiJcgV7DgYmi1XL/j6SfW/LlMf5uWRVGXb1ema7xyfvbaL9wcGAmrEq yrb4JKiD5Jm9cwGTwIRp1EvzS1JqmIs1HwL5EejA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xiubo Li , Venky Shankar , Jeff Layton , Ilya Dryomov Subject: [PATCH 5.15 56/67] ceph: flush cap releases when the session is flushed Date: Mon, 13 Feb 2023 15:49:37 +0100 Message-Id: <20230213144735.047041537@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213144732.336342050@linuxfoundation.org> References: <20230213144732.336342050@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Xiubo Li commit e7d84c6a1296d059389f7342d9b4b7defb518d3a upstream. MDS expects the completed cap release prior to responding to the session flush for cache drop. Cc: stable@vger.kernel.org Link: http://tracker.ceph.com/issues/38009 Signed-off-by: Xiubo Li Reviewed-by: Venky Shankar Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Greg Kroah-Hartman --- fs/ceph/mds_client.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -3543,6 +3543,12 @@ static void handle_session(struct ceph_m break; case CEPH_SESSION_FLUSHMSG: + /* flush cap releases */ + spin_lock(&session->s_cap_lock); + if (session->s_num_cap_releases) + ceph_flush_cap_releases(mdsc, session); + spin_unlock(&session->s_cap_lock); + send_flushmsg_ack(mdsc, session, seq); break;