From patchwork Tue Jan 28 23:01:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 3548421 Return-Path: X-Original-To: patchwork-linux-nfs@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 25D20C02DD for ; Tue, 28 Jan 2014 23:01:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C37E200E6 for ; Tue, 28 Jan 2014 23:01:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C8B220171 for ; Tue, 28 Jan 2014 23:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755422AbaA1XBW (ORCPT ); Tue, 28 Jan 2014 18:01:22 -0500 Received: from mx11.netapp.com ([216.240.18.76]:43757 "EHLO mx11.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932115AbaA1XBV (ORCPT ); Tue, 28 Jan 2014 18:01:21 -0500 X-IronPort-AV: E=Sophos;i="4.95,739,1384329600"; d="scan'208";a="98713412" Received: from vmwexceht05-prd.hq.netapp.com ([10.106.77.35]) by mx11-out.netapp.com with ESMTP; 28 Jan 2014 15:01:21 -0800 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCEHT05-PRD.hq.netapp.com (10.106.77.35) with Microsoft SMTP Server id 14.3.123.3; Tue, 28 Jan 2014 15:01:21 -0800 Received: from fc19-2.androsad.fake (vpn2ntap-112891.vpn.netapp.com [10.55.77.56]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id s0SN1JmW010311; Tue, 28 Jan 2014 15:01:20 -0800 (PST) From: To: CC: , Andy Adamson Subject: [PATCH 1/1] NFSv4.1 free slot before resending I/O to MDS Date: Tue, 28 Jan 2014 18:01:14 -0500 Message-ID: <1390950074-7245-2-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1390950074-7245-1-git-send-email-andros@netapp.com> References: <1390950074-7245-1-git-send-email-andros@netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 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: Andy Adamson Free an allocated slot from nfs41_wake_and_assign_slot prior to rpc_exit. Prevents a state_manager hang when draining a data server session. Signed-off-by: Andy Adamson --- fs/nfs/nfs4filelayout.c | 6 ++++++ fs/nfs/nfs4session.c | 1 + 2 files changed, 7 insertions(+) diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 03fd8be..9611999 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c @@ -314,6 +314,9 @@ static void filelayout_read_prepare(struct rpc_task *task, void *data) if (filelayout_reset_to_mds(rdata->header->lseg)) { dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid); filelayout_reset_read(rdata); + if (rdata->res.seq_res.sr_slot != NULL) + nfs4_free_slot(&rdata->ds_clp->cl_session->fc_slot_table, + rdata->res.seq_res.sr_slot); rpc_exit(task, 0); return; } @@ -425,6 +428,9 @@ static void filelayout_write_prepare(struct rpc_task *task, void *data) if (filelayout_reset_to_mds(wdata->header->lseg)) { dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid); filelayout_reset_write(wdata); + if (wdata->res.seq_res.sr_slot != NULL) + nfs4_free_slot(&wdata->ds_clp->cl_session->fc_slot_table, + wdata->res.seq_res.sr_slot); rpc_exit(task, 0); return; } diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c index cf883c7..5226846 100644 --- a/fs/nfs/nfs4session.c +++ b/fs/nfs/nfs4session.c @@ -98,6 +98,7 @@ void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot) dprintk("%s: slotid %u highest_used_slotid %u\n", __func__, slotid, tbl->highest_used_slotid); } +EXPORT_SYMBOL_GPL(nfs4_free_slot); static struct nfs4_slot *nfs4_new_slot(struct nfs4_slot_table *tbl, u32 slotid, u32 seq_init, gfp_t gfp_mask)