From patchwork Tue Dec 31 00:13:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 3421181 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B2D73C02DC for ; Tue, 31 Dec 2013 00:14:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0160920107 for ; Tue, 31 Dec 2013 00:14:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 395D5200FE for ; Tue, 31 Dec 2013 00:14:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932420Ab3LaAOF (ORCPT ); Mon, 30 Dec 2013 19:14:05 -0500 Received: from cobra.newdream.net ([66.33.216.30]:34240 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932403Ab3LaAOA (ORCPT ); Mon, 30 Dec 2013 19:14:00 -0500 Received: from nine.front.sepia.ceph.com (unknown [38.122.20.226]) by cobra.newdream.net (Postfix) with ESMTPA id 14AB5803BB; Mon, 30 Dec 2013 16:14:00 -0800 (PST) From: Sage Weil To: stable@vger.kernel.org Cc: ceph-devel@vger.kernel.org, "Yan, Zheng" , Sage Weil Subject: [PATCH 2/4] ceph: cleanup aborted requests when re-sending requests. Date: Mon, 30 Dec 2013 16:13:49 -0800 Message-Id: <1388448831-10324-3-git-send-email-sage@inktank.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1388448831-10324-1-git-send-email-sage@inktank.com> References: <1388448831-10324-1-git-send-email-sage@inktank.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Yan, Zheng" Aborted requests usually get cleared when the reply is received. If MDS crashes, no reply will be received. So we need to cleanup aborted requests when re-sending requests. Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum Signed-off-by: Sage Weil (cherry picked from commit eb1b8af33c2e42a9a57fc0a7588f4a7b255d2e79) --- fs/ceph/mds_client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index b7bda5d..91214b2 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1875,8 +1875,11 @@ static int __do_request(struct ceph_mds_client *mdsc, int mds = -1; int err = -EAGAIN; - if (req->r_err || req->r_got_result) + if (req->r_err || req->r_got_result) { + if (req->r_aborted) + __unregister_request(mdsc, req); goto out; + } if (req->r_timeout && time_after_eq(jiffies, req->r_started + req->r_timeout)) {